Opened 16 years ago

Last modified 13 years ago

#1273 new defect

mencoder encodes variable framerate MP4s to wrong rate

Reported by: rectalogic@… Owned by: reimar
Priority: normal Component: demuxer
Version: HEAD Severity: normal
Keywords: Cc:
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no

Description

When mencoder encodes a variable framerate MP4 to AVI, the resulting AVI is the wrong framerate.

libavformat populates r_frame_rate with the timebase of variable framerate MP4s (see https://roundup.mplayerhq.hu/roundup/ffmpeg/issue622 )

mplayer plays these back properly, even though it reports the framerate incorrectly e.g.
VIDEO: [mp4v] 320x240 24bpp 30000.000 fps 0.0 kbps ( 0.0 kbyte/s)

mencoder doesn't encode these properly. If encoding to AVI, it sets the framerate to 300000 and encodes a very short duration (few ms). If -ofps 15 is specified, the resulting AVI is 15fps but duration is still very short.

Sample videos were uploaded for issue622 above (15fps30000fps.mp4) and some existing videos in the samples:
http://samples.mplayerhq.hu/mobileVideo_3gp/no-sound-3gp.3gp
http://samples.mplayerhq.hu/mobileVideo_3gp/Video006.3gp

This results in a 5ms duration, 30000fps AVI:
mencoder 15fps30000fps.mp4 -v -ovc raw -vf format=i420 -oac pcm -o test.avi

If -ofps 15 is specified, the AVI is 15fps and 67ms duration:
mencoder 15fps30000fps.mp4 -v -ovc raw -vf format=i420 -oac pcm -ofps 15 -o test.avi

mencoder seems to handle encoding properly from VFR ASF/WMV which report 1000.0fps, as long as you specify -ofps.

Attachments (2)

mencoder-15fps30000fps.log (20.5 KB ) - added by rectalogic@… 16 years ago.
mencoder log without -ofps 15
mencoder-ofps-15fps30000fps.log (22.7 KB ) - added by rectalogic@… 16 years ago.
mencoder log with -ofps 15

Download all attachments as: .zip

Change History (6)

by rectalogic@…, 16 years ago

Attachment: mencoder-15fps30000fps.log added

mencoder log without -ofps 15

comment:1 by rectalogic@…, 16 years ago

by rectalogic@…, 16 years ago

mencoder log with -ofps 15

comment:2 by rectalogic@…, 16 years ago

comment:3 by rectalogic@…, 16 years ago

Adding -ofps 15 and -noskip seems to help:

mencoder 15fps30000fps.mp4 -v -ovc raw -vf format=i420 -oac pcm -ofps 15 -noskip -o test.avi

This results in a 15fps 9sec AVI. Without -noskip but with -ofps 15, all frames but one are skipped and the AVI has only a single frame and 15fps. With neither -noskip nor -ofps 15, the resulting AVI has 136 frames but 30000fps framerate.

So despite the docs saying you cannot use -noskip with variable framerate source, it seems to be necessary in this case.

comment:4 by compn, 13 years ago

Owner: changed from r_togni@… to reimar
Note: See TracTickets for help on using tickets.