VideoHelp Forum




+ Reply to Thread
Results 1 to 18 of 18
  1. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Hi folks,

    A friend sent me a capture of a 3D broadcast which I would like to convert to a standard 2D image with the best quality possible. It's an MPEG2 transport stream at 720p, with each image side by side. I can work out what I obviously need to do, crop one side of the image away and the stretch it back out to 16:9, but what is the best way to do it, quality wise?

    Obviously once cropped i'm going to have a 640x720 video in a squashed AR, it then needs stretching back out to the correct shape and size.

    I'm assuming a nice Avisynth script will be the way to go, any tips?
    Quote Quote  
  2. Originally Posted by Killer3737 View Post
    I can work out what I obviously need to do, crop one side of the image away and the stretch it back out to 16:9, but what is the best way to do it, quality wise?
    Yes as long as you are willing to use enough bitrate. Depending on what video codec, container, and player you use, you could leave the resolution at 640x720 and set the PAR/DAR flags.
    Quote Quote  
  3. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    The average bitrate on the original file is just under 17Mbps and I obviously want to maintain as high a quality as possible with the unavoidalbe re-encode. So you're saying just re-encode w/ crop to a 640x720 file at the same 17Mbps and then adjust the flags so it shows in the correct AR?
    Quote Quote  
  4. If you want to go with the 640x720 frame and PAR/DAR flags be sure your player(s) will play it properly (most do these days). You don't need the full 17 Mb/s bitrate because you only have half as much picture. I would shoot for a little over half that rate. Or just use CRF encoding at the quality level you prefer. That way you know you'll get exactly the right bitrate for the quality you want.
    Quote Quote  
  5. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    If you intend to use a settop DVD/BD player, then I'd suggest doing the resize after crop. AVISynth to a good encoder should do the trick. Check out some of the past similar threads, many solutions provided by jagabo. I'll defer to him/her on AVISynth stuff anyway.

    Scott
    Quote Quote  
  6. If the source video is very sharp I'd use BilinearResize() to avoid oversharpening halos. If it's not so sharp use BicubicResize() or LanczosResize().

    Make an index file with DgIndex and use this basic script:

    Mpeg2Source("filename.d2v", CPU=6) #6 --> deblock and dering YUV
    BilinearResize(1280,720)
    Then encode with your favorite encoder.
    Quote Quote  
  7. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    I'm a bit confused, what is the full process you are suggesting?
    Quote Quote  
  8. 1) Make an index file of your TS source with DgIndex, this will also demux the audio.
    2) Make the AviSynth script as indicated above.
    3) Encode with whatever encoder that supports AviSynth scripts. x264, HcEnc, VirtualDub, etc.
    4) Mux in the audio from step 1 if necessary.

    What encoder you use depends on your intended playback device and personal preference. If you want to leave the frame at 640x720 leave out the resize line in the AviSynth script and set the AR flags in step 3.
    Quote Quote  
  9. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Ok, I was confused with the lack of a crop line?
    Quote Quote  
  10. Originally Posted by Killer3737 View Post
    Ok, I was confused with the lack of a crop line?
    Sorry. I forgot! With an explicit Crop():

    Mpeg2Source("filename.d2v", CPU=6) #6 --> deblock and dering YUV
    Crop(0,0,width/2,height)
    BilinearResize(1280,720)
    Or you can do the crop as part of the resize:

    Mpeg2Source("filename.d2v", CPU=6) #6 --> deblock and dering YUV
    BilinearResize(1280,720,0,0,width/2,height)
    Both of those give you the left half of the frame.
    Quote Quote  
  11. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Ok thanks, I'll have a go later and let you know the results.
    Quote Quote  
  12. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by jagabo View Post
    Crop(0,0,width/2,height)
    BilinearResize(1280,720)

    Or you can do the crop as part of the resize:
    BilinearResize(1280,720,0,0,width/2,height)

    Both of those give you the left half of the frame.
    Using an explicit Crop (the first script) would be better in this case, to avoid edge artefacts.
    If you combine the crop with the resizer, it will use pixels from beyond the boundary. That's not what you want here, since the right half is a completely separate image, not a continuation of the left half.

    From http://avisynth.org/mediawiki/Resize:
    Note the edge semantics are slightly different, Crop gives a hard absolute boundary, the Resizer filter lobes can extend into the cropped region but not beyond the physical edge of the image.
    It's less of an issue if using BilinearResize, but could be significant with BicubicResize or other resizers that have a wider filter kernel.
    Quote Quote  
  13. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Ok I tried that script, worked fine but the output didn't look that great, obviously because of the crop and resize and the original video wasn't that hot. 640x720 version strected looked basically the same.

    I might be able to get a higher quality source in the future but if this is all I have, do you think an encode to DVD resolution might be a better idea? Or can you suggest some filters/HCEnc settings that might improve things?

    I can upload a sample of the original TS if you wish?

    Oh also, is there a way to choose which side of the video is saved? I think the right side is clearer than the left.
    Last edited by Killer3737; 14th Apr 2011 at 11:57.
    Quote Quote  
  14. Originally Posted by Killer3737 View Post
    Ok I tried that script, worked fine but the output didn't look that great, obviously because of the crop and resize and the original video wasn't that hot. 640x720 version strected looked basically the same.
    Different resizing algorithms might make a difference. Bilinear is softer, Bicubic is sharper, Lanczos even sharper. Whether resizing in software before encoding looks better than resizing during playback will vary depending on the resizing algorithm used before encoding and the algorithm used by the player.

    Originally Posted by Killer3737 View Post
    do you think an encode to DVD resolution might be a better idea?
    If the idea is to view the video full screen then keeping 640x720 or 1280x720 will keep more resolution than resizing to DVD frame sizes.

    Originally Posted by Killer3737 View Post
    I can upload a sample of the original TS if you wish?
    That is better than me trying to describe everything that might be done.

    Originally Posted by Killer3737 View Post
    Oh also, is there a way to choose which side of the video is saved?
    Of course. See the AviSynth docs for basics of the Crop() command.

    Crop(0,0,width/2,height) #gives you the left half
    Crop(width/2,0,width/2,height) #gives you the right half
    Quote Quote  
  15. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    The idea is basically to create as high a quality plain 2D version as possible.

    Here is a 40 odd second sample -
    http://www.megaupload.com/?d=5TYW25WN

    Thanks for the help.
    Quote Quote  
  16. That's in pretty poor shape. It's way over compressed, poorly resized, and has some weird problem where the two fields don't line up properly on some frames. At 1280x720 it looks pretty bad. Even though reducing it to DVD frame size loses vertical resolution that might be the better choice because you don't expect it to look high def.

    Try this:

    Mpeg2Source("sample.d2v", CPU=6)
    Crop(width/2,0,width/2,height)
    SelectEven()
    TDecimate()
    Blur(0,1.0)
    Sharpen(0,0.7)
    BilinearResize(720,480)
    The Crop() selects the right half of the image. SelectEven() and TDecimate() are to reduce the frame rate to 23.976 (that's the original frame rate). The Blur() gets rid of the comb-like artifacts where the fields don't match up. The sharpen sharpens up horizontal edges that were blurred by the Blur(), without restoring the comb artifacts. Finally, a BilinearResize() to NTSC DVD frame size.

    If you want to get adventurous, you might try using MCTemporalDenoise(). But it's very slow.
    Last edited by jagabo; 14th Apr 2011 at 20:39.
    Quote Quote  
  17. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    that hd broadcast clip is film, you can apply ivtc to it.. (skip the first two frame then apply) but too bad its full of pixelation, maybe the ivtc and some deblocking can help a little. the test i did (w/out deblocking) to h264 -crf 10 640x720p 24fps brought filesize down to 56mb but was still too pixelated and full of compression artifacts. i'd be curious to see other members results, cause maybe its just my system.
    Quote Quote  
  18. Member
    Join Date
    Jul 2007
    Location
    United Kingdom
    Search Comp PM
    Yeah I think the source file is just not good enough to work with. This comes from a satellite broadcast and I believe there were two copies being sent out, this one and one with much higher bitrate, 29Mbps. I'm hoping to get a copy from that but if not this is the best I have to work with unfortunatly.
    Quote Quote  



Similar Threads

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