PDA

View Full Version : Encoding from 50fps to 25


w4tt4n4b3
2nd October 2009, 21:41
The source video is h264 1280x720p, 50fps and I encode using x264 to make it smaller size, crop it and change the 25fps.
I add in the end of the avs script the SelectEven() command to make the produced video 25fps but I have the sense that the final file lacks in smoothness.
Especially in the department of motion, the result is not smooth and seems a bit slower...
Is there anyway to avoid this?
Should I add any kind of filter or anything else in the avs script?
Thanks.

Keiyakusha
2nd October 2009, 21:56
FPS is a "smoothness". If you lowering FPS, sure it will be less smooth. Do not touch FPS if you want to avoid it. x264's compression is pretty good with high framerates so with the same bitrate, gain in quality you can achieve by doing 25fps will be less than twice.

w4tt4n4b3
2nd October 2009, 22:19
I will leave the framerate as it is. I lower the bitrate around 2000 but I will keep the framerate at 50fps.
Another alternative is to cap in 1920x1080i which is 30 or 25 fps and then encode and resize to 1280x720 with keeping the 30 or 25 fps...

b66pak
3rd October 2009, 00:16
@ w4tt4n4b3 if your stream is a 50p TV transmission then is OK to add SelectEven() to your .avs script...
_

w4tt4n4b3
3rd October 2009, 00:19
My tv stream/feed broadcasts at 1080i but I set my satellite box to output 720p.
Maybe it would be better to cap in 1080i and then resize to 720...

w4tt4n4b3
3rd October 2009, 00:26
@ w4tt4n4b3 if your stream is a 50p TV transmission then is OK to add SelectEven() to your .avs script...
_

My stream is 1080i, 25fps, interlaced, topfield first but as I said earlier I set my sat box to output 720p.
I will try encoding using 1080i as source file...

Keiyakusha
3rd October 2009, 00:36
w4tt4n4b3
By doing 720p out of 1080i you will end up with the same result as you set in your box. Well, maybe a bit better in quality, depending how your box doing its job. Unless you want to keep it interlaced. But that will not give you better quality at the same bitrate you using now.

w4tt4n4b3
3rd October 2009, 00:41
When my box outputs 720p my source file is 720p and is encoded faster with x264 into 704p. If I cap in 1080i and resize to 720, use tomscomp for deinterlace etc then the encoding time increases...
And now I notice that the mkv file that I produced from the 1080i source file is not seekable...Well it is seekable but the cursor moves a bit strange. It does not go fluent as the file plays. The motion is natural but the cursor in the vlc player not.
The 1080i source file:
Format : MPEG-TS
File size : 97.5 MiB
Duration : 1mn 0s
Overall bit rate : 13.6 Mbps
Maximum Overall bit rate : 18.0 Mbps

Video
ID : 4113 (0x1011)
Menu ID : 1 (0x1)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Duration : 1mn 0s
Bit rate : 12.3 Mbps
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16/9
Frame rate : 25.000 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Interlaced
Scan order : Top Field First
Bits/(Pixel*Frame) : 0.236
Stream size : 87.9 MiB (90%)

The mkv file that came out of the 1080i source file:
Format : Matroska
File size : 13.0 MiB
Duration : 1mn 0s
Overall bit rate : 1 818 Kbps
Encoded date : UTC 2009-10-02 22:34:23
Writing application : mkvmerge v2.3.0 ('Freak U') built on Sep 8 2008 18:32:16
Writing library : libebml v0.7.7 + libmatroska v0.8.1

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings, CABAC : Yes
Format settings, ReFrames : 3 frames
Muxing mode : Container profile=Unknown@3.1
Codec ID : V_MPEG4/ISO/AVC
Duration : 1mn 0s
Nominal bit rate : 1 646 Kbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16/9
Frame rate : 25.000 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Bits/(Pixel*Frame) : 0.071
Writing library : x264 core 67 r1136 3f9ba82
Encoding settings : cabac=1 / ref=3 / deblock=1:-1:-1 / analyse=0x3:0x133 / me=hex / subme=6 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=6 / nr=0 / decimate=1 / mbaff=0 / bframes=16 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=3 / wpredb=1 / keyint=250 / keyint_min=25 / scenecut=40 / rc=2pass / bitrate=1646 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:1.00

benwaggoner
3rd October 2009, 02:48
What kind of content are we talking here? If it's sports or other high action, retaining 50p is going to have a bigger impact on quality than frame size in the end. Also, doubling frame rate is less expensive in bitrate increase than doubling pixel count, since sequential frames will be better matches. There's a lot of contnet that would deliver a better experience at 576p60 than 720p30.

But if it's PAL movie content or otherwise 25p sourced, or just low motion stuff like TV interview shows, it won't matter so much.

I'm confused about the MPEG-2 TS source you have. Is that a binary cap of the source bitstream? If so, that's what you want to have. Ideally you could use a H.264 decdoer with an integrated deinterlacer, which would know the MBAFF status for each macroblock and could bob in realtime quite efficiency. Windows 7 does a very impressive bob on playback with the MPEG-2, VC-1, and H.264 files I've tried so far. Maybe if you could graph that pin into your encoder somehow...

w4tt4n4b3
3rd October 2009, 05:23
The encoder is a hardware one. I mean the .ts file is a product that comes out from a hardware encoder...
The content is sports with a small ball...
The tv stream broadcasts at 1080i...
I set my set box to output instead of 1080i(25fps) 720p (50fps) and then I encode the 720p.
But I am thinking of capping in 1080i and then encoding to 720 keeping the 25fps from the 1080i.
What's your opinion?

benwaggoner
4th October 2009, 01:45
The encoder is a hardware one. I mean the .ts file is a product that comes out from a hardware encoder...
The content is sports with a small ball...
The tv stream broadcasts at 1080i...
I set my set box to output instead of 1080i(25fps) 720p (50fps) and then I encode the 720p.
But I am thinking of capping in 1080i and then encoding to 720 keeping the 25fps from the 1080i.
What's your opinion?
If it's sports, you're almost definitely better encoding 50p, and build the rest of the workflow and settings around that goal.

As for capturing 720p50 versus 1080i25, it really gets down to how good the deinterlacer and scaler are in your box. If the 720p50 output is in the ballpark of what you'd get in software preprocessing given your time budget, definitely go that way. That'll make preprocessing a non-issue, and will let you give all the CPU to the encoder.

But if the 720p50 is just a field-elimination bob with bad horizontal line detail, well, 1080i25 it is. In which case you're going to burn more preprocessing time and have less left for the codec. Doing 960x540p50 could be a decent compromise if you're encoding time or bitrate constrained.

Really, you shoudn't be sweating x264 configuration at all at until you nail capture and preprocessing. A good codec can only preserve what you give it, so make sure it's being fed the frames you want to get back.

And in the end, if this is for personal use, could you just capture what you want to watch later? HD space is dirt cheap this day; it's probably cheaper on the net to buy more drives and archive your caps than to pay the electrical bill for all that transcoding.

If you've got Win7, you'd get a nice 1080p50 bob out of those files with probably as good a quality as you could after a reencode.