PDA

View Full Version : FPS fixing and Interlacing autodetect (mencoder)


Lamb
16th June 2008, 03:43
Hi all!

I am using mencoder on a web video hosting platform, and I am having troubles with FPS and Deinterlacing. I don’t have any control on my video sources: they can be PAL or NTSC, interlaced or progressive, 24, 25, 30 (or anything you want) FPS. Because they will mainly come from amateurs, I guess I’ll have to deal with a couple of interlaced videos.

I am trying to automatically produce 25 FPS Progressive videos which will be encoded in MPEG4-AVC @ 320kbit/sec, using x264. These videos will then be played from a Flash Player.

- My first question is about the “ofps” option:
If I get FPS bigger than 25 using "mplayer -identify" on the source, my script adds “-ofps 25” to the command line. But I don’t know how mencoder changes the framerate. For example, if I use the “-ofps 25” option on a 30 FPS video, how does mencoder select the frames which will be deleted? Is it a good idea to use this option (the goal is to optimize x264 compression / decompression: 5 extra frames make quite a difference). Or should I leave the FPS to its original value?

- My second question concerns deinterlacing:
Is there some automated way to detect if a video is interlaced or not? I didn’t find any way to grab that kind of information using mplayer. I think it’s quite a bad idea to deinterlace all my video sources (using “pp=lb” for example) because some of them will be progressive.

Thank you in advance for your help! :)

dat720
18th June 2008, 12:20
-ofps 25 will drop frames to acheive the framerate, it will drop every 5th frame for example to reduce the video to 25fps (not sure on the exact math), in my experience changing frame rate never works aswell as you plan, the video may look choppy or in the case of reduced framrate it may develop a skip.... i generally leave the frame rate alone, unless i need to convert 29.976fps content to PAL DVD which is 25fps.....

mencoder does not have a automatic deinterlacer, you could specify to always deinterlace, this would not effect non interlaced content, it would increase processing time but the output would still be fine, but deinterlaced could be a problem as different content will require different deinterlacers.....

Lamb
18th June 2008, 14:44
Thank you for your help.

About FPS, I think I'll cap it to 30, which will let it unchanged any standard video (if fps < 30, I do not use ofps).
But if I need to make it 15 (for mobile compatibility, for example), I guess there is no better solution than -ofps 15?

For the "always deinterlace" option, and having in mind that the bitrate will be kept very low (320) which deinterlace filter would you recommand (don't wanna lose sharpness)? Sources will mainly come from amateur video cameras.

Would you know for example how they're doing on video sharing platforms like Youtube ?

stax76
18th June 2008, 15:06
mencoder does not have a automatic deinterlacer, you could specify to always deinterlace, this would not effect non interlaced content, it would increase processing time but the output would still be fine, but deinterlaced could be a problem as different content will require different deinterlacers.....

I guess it depends on the deinterlacer.