VideoHelp Forum




+ Reply to Thread
Results 1 to 10 of 10
  1. Member
    Join Date
    Jan 2008
    Location
    United Kingdom
    Search Comp PM
    So I recorded a video with the camera in landscape (correct way up)
    half way through recording I turn the camera on its side (recording now rotates 90 right)

    What I want is a program that basically can counter rotate the rotation that I did so video is always correct way up..


    freeware...
    Quote Quote  
  2. freeware...
    AviSynth's TurnLeft or TurnRight filters:

    http://avisynth.org/mediawiki/TurnLeft

    If it's OK until halfway through, then one way to rotate only the 2nd half of the video would be:

    A=Trim(0,49999)
    B=Trim(50000,0).TurnLeft()
    A+B

    That says leave the first 50000 frames alone and rotate the rest of the video.

    Of cource, since after being rotated that part won't have the same dimensions/resolution as the rest, you'll also have to crop and resize it so it's the same as the first part:

    http://avisynth.org/mediawiki/Crop
    http://avisynth.org/mediawiki/Resize
    Quote Quote  
  3. Member
    Join Date
    Jan 2008
    Location
    United Kingdom
    Search Comp PM
    I am new to this video programming to edit the video

    So far I have

    AviSource("test.avi")
    Trim(0, 2260) ++ Trim(2261, 3530).TurnRight().LanczosResize(640, 480) ++ Trim(3531, 0)


    Which basically trims from frame (0, 2260)
    then trims from frame (2261, 3530) turns it right so it is correct way up
    then resizing the video to the correct dimensions
    then add on the rest of the video

    So now the problem is the rotated bit is "short and fat" as you said, how exactly do you fix this. What would be the actual code i need...

    Thanks
    Quote Quote  
  4. AviSource("test.avi")
    Trim(0, 2260) ++ Trim(2261, 3530).TurnRight().LanczosResize(360,480).AddBorder s(140,0,140,0) ++ Trim(3531, 0)
    Quote Quote  
  5. Member gadgetguy's Avatar
    Join Date
    Feb 2002
    Location
    West Mitten, USA
    Search Comp PM
    Try this:
    A = Trim(0, 2260)
    B = Trim(2261, 3530)
    B = TurnRight(B)
    B = Addborders(B,187,0,187,0)
    B = LanczosResize(B,640, 480)
    C = Trim(3531, 0)
    A ++ B ++ C

    (I broke it out for readability)

    Edit: Jagabo beat me to it, but he resized before adding borders and I added borders before resize. His way leaves sharp edges on the borders, my way softens the border which may be easier on some encoders.
    "Shut up Wesley!" -- Captain Jean-Luc Picard
    Buy My Books
    Quote Quote  
  6. Member
    Join Date
    Jan 2008
    Location
    United Kingdom
    Search Comp PM
    Sweet thank you soo much works a treat
    Was trying to figure out how to get it like that but now I see

    I was messing about with Crop and BilinearResize

    Whats the best way to "save as" whats options have I got so it doesn't create a massive file size?

    Ive notice that your LanczosResize AddBorders values are different , just wondering is one better that the other...?
    Quote Quote  
  7. If you just "Save As" without choosing and configuring a codec, then you get huge uncompressed file sizes. Choose and configure a codec, XviD or DivX, perhaps. You do that in Video->Compression.
    Quote Quote  
  8. Originally Posted by gadgetguy
    Edit: Jagabo beat me to it, but he resized before adding borders and I added borders before resize. His way leaves sharp edges on the borders, my way softens the border which may be easier on some encoders.
    LanczosResize() is a sharpening filter. It will sharpen at the edge of the black border. A bilinear resize would have given you a softened edge. LanczosResize() on the left, BilinearResize() on the right, enlarged 8x with a PointResize() to make the individual pixels obvious:




    Another possibility for the rotation is to crop the original frame before rotating, then add borders. This way the video is rotated and cropped, but not resized:

    AviSource("test.avi")
    Trim(0, 2260) ++ Trim(2261, 3530).Crop(80, 0, -80, -0).TurnRight().AddBorders(80,0,80,0) ++ Trim(3531, 0)
    Quote Quote  
  9. Member gadgetguy's Avatar
    Join Date
    Feb 2002
    Location
    West Mitten, USA
    Search Comp PM
    I'm probably picking nits, but a side by side test of the two methods show a slightly softer border when resized after addborders. (At least on my monitor)


    Resize before addborders on left, resize after addborders on right.
    "Shut up Wesley!" -- Captain Jean-Luc Picard
    Buy My Books
    Quote Quote  
  10. Originally Posted by gadgetguy
    Resize before addborders on left, resize after addborders on right.
    Your bright area is too bright and the dark area too dark. The bright parts can't get any brighter and the dark parts can't get any darker so you're not seeing the sharpening overshoot that LanczosResize is adding. The sharpening effect is also dependent on exactly where the border is, as you can see in my example. It had 7x7 black (0,0,0) blocks with a medium gray (128, 128,128) background. The source had perfectly sharp edges, no antialiasing. It was resized from 640x480 to 480x360 before the small section was cropped and blown up. Here's a sample of the original source (8x point upsized like the others):



    LanczosResize() is both a blurring and sharpening filter. Blurring to reduce moire artifacts, sharpening to sharpen up the result. You can come pretty close to LanczosResize() with Blur(1.0).BicubicResize().Sharpen(0.7).
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!