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?
+ Reply to Thread
Results 1 to 18 of 18
-
-
-
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?
-
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.
-
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 -
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) -
I'm a bit confused, what is the full process you are suggesting?
-
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. -
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)
Mpeg2Source("filename.d2v", CPU=6) #6 --> deblock and dering YUV
BilinearResize(1280,720,0,0,width/2,height) -
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. -
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.
-
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.
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.
That is better than me trying to describe everything that might be done.
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 -
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. -
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)
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.
-
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.
-
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.
Similar Threads
-
How to import MPEG2-TS to Adobe Premier? How to convert MPEG2-TS to MKV? :)
By farzad in forum EditingReplies: 19Last Post: 29th Feb 2012, 16:25 -
mpeg2 ts file convert to mkv or mpeg2 ts......change only video bitrate...
By jrblack in forum Video ConversionReplies: 4Last Post: 24th Jan 2011, 18:45 -
Merging MPEG2 stream with its AC3 audio... or converting MKV to MPEG2
By cwt in forum Video ConversionReplies: 2Last Post: 5th May 2010, 14:18 -
MPEG2-->MPEG2 Crop + Resize
By wincrazy in forum Newbie / General discussionsReplies: 26Last Post: 24th Jan 2009, 01:30 -
Simple question: how to compress 4GB mpeg2 to 1GB mpeg2
By jimdagys in forum Newbie / General discussionsReplies: 29Last Post: 3rd Jan 2008, 08:45