Log in

View Full Version : Interlaced SD on h264 for standalone players


NoX1911
11th July 2011, 02:14
Hallo,
i have some footage (DVD, 704x576, interlace) that i want to convert to MP4/h264. There is 16px garbage at the bottom (VHS artifacts). The file should be played on SD standalone DVD players (AVCHD), PS3 and such devices. I don't want to touch y-rescaling (due to interlacing).
How should i remove the garbage and what output resolution/format is recommended?

Some thoughts:

Method 1: Blanking
768x576 16px blanked (crop/addborders), PAR1 corrected (704->768).
576 might be a native resolution for hardware players preventing rescaling (just a guess). Not sure if 768 is ok.

Method 2: Cropping
16px of the bottom and 2x8 from sides. Picture is 752x560 (PAR1).

I've picked 'Film/HP@L4.1/target:AVCHD' (MeGUI 2035 svn).

Which method is better?

Blue_MiSfit
11th July 2011, 08:30
I'd go for method 1, personally

nm
11th July 2011, 10:42
Method 1: Blanking
768x576 16px blanked (crop/addborders), PAR1 corrected (704->768).
576 might be a native resolution for hardware players preventing rescaling (just a guess). Not sure if 768 is ok.

You need a frame size of 720x576 pixels for spec compliance. Adding black borders is easier for interlaced video. The other alternative is to scale and crop (or crop and scale) each field separately. Look out for interlaced chroma issues if you go this way.

Sample aspect ratio for 576i is 16:11 for 16:9 video and 12:11 for 4:3 video.


I've picked 'Film/HP@L4.1/target:AVCHD' (MeGUI 2035 svn).

If you use DVD media, note that you need --vbv-maxrate 15000 and --vbv-bufsize 15000. When using these VBV settings, I'd also set --level 31 --keyint 50 --slices 1. Number of reference frames should be limited to 6, I guess.

See these tables for reference: http://forum.doom9.org/showthread.php?t=154533

NoX1911
11th July 2011, 16:24
I'd also set --level 31 --keyint 50 --slices 1.
1) Why go for 3.1 if you can have 4.1?
2) Keyint 50.. that's max GOP size, right? I'm on low bitrate (800-1000) so i guess its better to keep it at 250?
3) What is that --slice option for? Is larger or smaller better regarding quality?
4) What is the correct meaning of SAR? 'Sample aspect ratio' or 'simple aspect ratio'? They call it 'simple' in your link several times whereas you mentioned 'sample' and i also seen other ppl calling it 'sample'.

I think i will go for the specs even though SAR (in MP4) won't be honored by most PC players i guess.

--level 4.1 --bluray-compat --bframes 3 --ref 6 --open-gop --slices 4 --vbv-bufsize 15000 --vbv-maxrate 15000 --tff --sar 12:11

poisondeathray
11th July 2011, 17:13
1) Why go for 3.1 if you can have 4.1?


4.1 requires 4 slices, and < L4.0 does not; also you can use 2 sec GOP settings (50 instead of 25) if you use L4.0

See the link above for more info in nm's post


2) Keyint 50.. that's max GOP size, right? I'm on low bitrate (800-1000) so i guess its better to keep it at 250?


Not compatible. 1 sec GOP is 25. 2 sec GOP is 50 , if you use "long GOP" settings


3) What is that --slice option for? Is larger or smaller better regarding quality?


4 slices required for L4.1 , not for L4.0 (see above) ; fewer slices are very slightly more efficient


4) What is the correct meaning of SAR? 'Sample aspect ratio' or 'simple aspect ratio'? They call it 'simple' in your link several times whereas you mentioned 'sample' and i also seen other ppl calling it 'sample'.


SAMPLE aspect ratio , same thing as PAR in older MPEG2 terminology, it can be thought as the w:h of pixels


I think i will go for the specs even though SAR (in MP4) won't be honored by most PC players i guess.


It will be honored by all PC players

nm
11th July 2011, 17:13
1) Why go for 3.1 if you can have 4.1?

The VBV settings that I suggested for BD/AVCHD on DVD compatibility fit in level 3.1, so there's no reason to use anything higher. And some players might only support L3.1 for SD content.

2) Keyint 50.. that's max GOP size, right? I'm on low bitrate (800-1000) so i guess its better to keep it at 250?

Since you target hardware players, it may be a good idea to follow Blu-ray specs for maximum compatibility. Hence a GOP size of 1 or 2 seconds.

This has a quality penalty though. If you know that all the players you need to support can handle longer GOPs, go for 250.

3) What is that --slice option for? Is larger or smaller better regarding quality?

Blu-ray normally requires 4 slices so that decoding can be multi-threaded easily. The MeGUI preset that you were going to use should set --slices 4. However, when you drop to level 4.0 or lower, it's fine to use only one slice. More slices give slightly lower quality at the same bitrate.

4) What is the correct meaning of SAR? 'Sample aspect ratio' or 'simple aspect ratio'? They call it 'simple' in your link several times whereas you mentioned 'sample' and i also seen other ppl calling it 'sample'.

It's sample, not simple.

I think i will go for the specs even though SAR (in MP4) won't be honored by most PC players i guess.

It is honored by all software players I've used. SAR is coded within the video stream too, so it's kept even if you extract the stream and remux it.

NoX1911
11th July 2011, 18:00
Thank you.. very helpful.

With "not honored by most PC players" i meant players actually not correcting the PAR. I've tested potplayer and mpc-hc i guess with Haali Splitter and CoreAVC or ffdshow. Its been quite a while though i've tested that. VLC i'm sure did it fine.

poisondeathray
11th July 2011, 18:20
With "not honored by most PC players" i meant players actually not correcting the PAR. I've tested potplayer and mpc-hc i guess with Haali Splitter and CoreAVC or ffdshow. Its been quite a while though i've tested that. VLC i'm sure did it fine.

In my experience , it works with all the players and setups you mentioned (stretches on playback to the correct DAR).

I haven't found a PC player that doesn't honor --sar x:y . Maybe Non players like vdub or avidemux who display as 1:1