View Full Version : x264 Encoding 1080i
technomorph
31st March 2013, 21:35
I am attempting to encode the following 1080i source with x264:
Video
ID : 4113 (0x1011)
Menu ID : 1 (0x1)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : 27
Duration : 43mn 30s
Bit rate mode : Variable
Bit rate : 28.0 Mbps
Maximum bit rate : 38.9 Mbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 fps
Standard : PAL
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Top Field First
Bits/(Pixel*Frame) : 0.540
Stream size : 8.50 GiB (95%)
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
...using the following:
x264 --bitrate 10000 --preset veryslow --tune film --bluray-compat --vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 25 --open-gop --slices 4 --tff --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 1 -o out.264 input.264
x264 --bitrate 10000 --preset veryslow --tune film --bluray-compat --vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 25 --open-gop --slices 4 --tff --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 --pass 2 -o out.264 input.264
The output is a stuttering mess.
I read elsewhere that the source may not actually be interlaced, so tried removing --tff and adding --no-interlaced. This had no affect.
I also tried adding --fps 25 --force-cfr, also with no joy.
Any assistance gratefully received.
Blue_MiSfit
1st April 2013, 00:58
The output is a stuttering mess on what?
technomorph
1st April 2013, 02:41
Playing back on PC using MPC-HC with Lav and MadVR. I have used the exact same approach for other 1080i content which is playing back with no issues.
Warperus
1st April 2013, 09:27
Is it possible that source has wrong field order?
technomorph
1st April 2013, 11:59
Yeah, I tried --bff as well, and it definitely looks better, but not right. It seems to run in slow motion??
Warperus
1st April 2013, 14:21
I can imagine something like 25p packed in interlaced fields with 2:2 pulldown.
Last time I was in doubts for my camera I just opened source in avsp and wrote a simple avisynth script with AssumeTFF() and SeparateFields(), then gone through few frames.
sneaker_ger
1st April 2013, 17:17
Maybe it's a source decoding problem? Did you try a different (AviSynth) source filter, like e.g. DGDecNV and looked at the preview?
benwaggoner
1st April 2013, 18:13
Yeah, I tried --bff as well, and it definitely looks better, but not right. It seems to run in slow motion??
That would be weird, as PAL is ALWAYS top field first.
For this kind of stuff, I drop into After Effects, and drop the source onto a 1080p50 timeline. Then I see which Interpret Footage setting gives me the correct results.
kalehrl
1st April 2013, 20:07
I had similar experiences:
http://forum.doom9.org/showthread.php?t=164271
Sharc
1st April 2013, 20:47
@technomorph
Can you upload a sample of the source of few seconds duration?
technomorph
2nd April 2013, 02:13
Thanks for you help guys. I should say that my knowledge of video compression is limited. I have no experience of using AviSynth or After Effects.
I've uploaded a 10 second cut which I demuxed using tsMuxer:
source.264 (http://www.mediafire.com/?ma61j8jb11fka2i)
The metadata from MediaInfo appears different from the complete source file, so hopefully the act of taking a cut has not changed anything.
Video
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Format settings, GOP : M=3, N=24
Bit rate mode : Variable
Maximum bit rate : 38.9 Mbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 fps
Standard : PAL
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Top Field First
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Blue_MiSfit
2nd April 2013, 02:43
That's a mangled source. It's mostly top field first, but every fourth field is out of order. Then, the Machu Picchu scene is entirely progressive, with every other frame duplicated.
I'm not sure how you're going to fix it.
Sharc
2nd April 2013, 20:16
To me the source looks entirely progressive, just encoded as interlaced for blu-ray compliance @ 1080i 25fps; nothing unusual.
I re-encoded it as 1080i (MBAFF) 25fps, as well as deinterlaced it and resized to 720p. Playback is smooth in both cases ..... :confused:
To me the source looks entirely progressive
Both pyramid scenes are interlaced. Other scenes seem mostly progressive. Anyway, I also don't have problems with reencoding the clip as TFF interlaced: output looks the same as the source, with or without deinterlacing.
@technomorph:
You might have a decoding problem during encoding. Lavf input worked for me, but is x264 using something else in your case?
Sharc
2nd April 2013, 23:33
Both pyramid scenes are interlaced.
Hmmm... still wondering: When I separate the frames into fields and toggle through the fields, the fields are pairwise identical (apart from a slight vertical bobbing), means no temporal movement between two fields which constitute a frame. Therefore my conclusion that the source is actually progressive, but has been encoded as interlaced just to comply with blu-ray spec.
Do I get something wrong?
Hmmm... still wondering: When I separate the frames into fields and toggle through the fields, the fields are pairwise identical (apart from a slight vertical bobbing), means no temporal movement between two fields which constitute a frame.
That happens in some of the scenes, but in the first scene (Egyptian pyramids), sky is moving to the right between fields. In the Mayan pyramid scene, lower left part of the image is moving 1-2 pixels to the left between fields while the view is zoomed in.
smok3
3rd April 2013, 07:34
sounds like progressively shoot and then unfortunately treated in interlaced timeline during post.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.