Opened 5 years ago

Closed 4 years ago

#403 closed defect (invalid)

-r to specify input frame rate does not work

Reported by: etienne Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords:
Cc: buhman Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

ffmpeg -r 25 -i badly_interpreted_as_50fps.ts [...]
ffmpeg version N-31898-g95b5b52, Copyright (c) 2000-2011 the FFmpeg developers

built on Aug 15 2011 10:57:29 with gcc 4.4.5
configuration: --prefix=/home/etienne/usr/ --enable-gpl --enable-version3 --enable-postproc --enable-avfilter --disable-stripping --enable-nonfree --enable-libfaac --enable-libmp3lame --enable-libx264
libavutil 51. 12. 0 / 51. 12. 0
libavcodec 53. 10. 0 / 53. 10. 0
libavformat 53. 7. 0 / 53. 7. 0
libavdevice 53. 3. 0 / 53. 3. 0
libavfilter 2. 31. 1 / 2. 31. 1
libswscale 2. 0. 0 / 2. 0. 0
libpostproc 51. 2. 0 / 51. 2. 0

Option framerate not found.

The framerate is put in format_opts dict in opt_input_file, but not ate (nor used) by avformat_open_input, hence choking on following assert_avoptions.

Also tried with a tree from today, with same outcome.

Change History (8)

comment:1 Changed 5 years ago by cehoyos

  • Status changed from new to open

Could you explain what you are trying to achieve?
The -r input option is expected to work on inputs where fps is unknown. If you are playing a file (a transport stream?), fps cannot be selected but is a property of the file.

If you have problems with A/V sync on a specific file, please upload a sample - you can attach small samples, bigger files can be uploaded to http://www.datafilehost.com/

comment:2 Changed 5 years ago by etienne

Right, I though -r before -i could be used to force input fps. Sorry about the noise.

Please mark this bug as invalid (seems I can't do it myself).

comment:3 follow-up: Changed 5 years ago by dgrant

Not sure if this is relevant or not, but you can do this in mencoder, in fact, it seems to be necessary for decoding the 1080i AVHCD from Canon video cameras properly.

comment:4 in reply to: ↑ 3 Changed 5 years ago by cehoyos

Replying to dgrant:

it seems to be necessary for decoding the 1080i AVHCD from Canon video cameras properly.

Do you know of an open ticket that describes this problem? Can you point us to a sample?

comment:5 Changed 5 years ago by dgrant

Sure I can make a sample of the original video that my camera produces with the settings that I use (1080 60Hz interlaced)

What I want to be able to do is de-interlace the original 60i video and produce 60p video. When I try to do that by specifying the output framerate is 60, I get a video that is half the speed. In mencoder I think I fixed this problem by telling it that the input fps was 120. Anyways, ffmpeg works just fine if I tell it to create video that is 30fps. It de-interlaces with yadif and I get de-interlaced 30p video.

comment:6 Changed 5 years ago by cehoyos

  • Resolution set to invalid
  • Status changed from open to closed

comment:7 follow-up: Changed 4 years ago by buhman

  • Resolution invalid deleted
  • Status changed from closed to reopened

I seem to have a similar problem with what appears to be video from some capture device that appears to have the wrong framerate. I would like to override the input framerate, but I am unable to do so.

Verbatim Source: http://buhman.org/CAPTURE-HD-RM164_2012-08-20_13_21_28.ts

When I try to encode normally, I end up with the video being twice as long as the audio (and the video is clearly half as fast as it is when played back directly by ffplay/mplayer).

$ ffmpeg -i CAPTURE-HD-RM164_2012-08-20_13_21_28.ts -an -vcodec mpeg2video -q 0 video.mpg
ffmpeg version 0.11.1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jun  9 2012 13:50:13 with gcc 4.7.0 20120505 (prerelease)
  configuration: --prefix=/usr --enable-libmp3lame --enable-libvorbis --enable-libxvid --enable-libx264 --enable-libvpx --enable-libtheora --enable-libgsm --enable-libspeex --enable-postproc --enable-shared --enable-x11grab --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libschroedinger --enable-libopenjpeg --enable-librtmp --enable-libpulse --enable-libv4l2 --enable-gpl --enable-version3 --enable-runtime-cpudetect --disable-debug --disable-static
  libavutil      51. 54.100 / 51. 54.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.100 / 54.  6.100
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[mpegts @ 0x1f98100] max_analyze_duration 5000000 reached at 5013333
[mpegts @ 0x1f98100] Could not find codec parameters (Unknown: none ([6][0][0][0] / 0x0006))
[NULL @ 0x1f9d220] start time is not set in estimate_timings_from_pts
Input #0, mpegts, from 'CAPTURE-HD-RM164_2012-08-20_13_21_28.ts':
  Duration: 01:30:00.57, start: 599.983333, bitrate: 2280 kb/s
  Program 1
    Stream #0:0[0x1011]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x1012]: Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz, stereo, s16, 92 kb/s
    Stream #0:2[0x1013]: Unknown: none ([6][0][0][0] / 0x0006)
[buffer @ 0x1f9ee60] w:1280 h:720 pixfmt:yuv420p tb:1/90000 sar:1/1 sws_param:flags=2
[buffersink @ 0x1f9f3a0] No opaque field provided
[mpeg @ 0x1f9dcc0] VBV buffer size not set, muxing may fail
Output #0, mpeg, to 'video.mpg':
  Metadata:
    encoder         : Lavf54.6.100
    Stream #0:0: Video: mpeg2video, yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mpeg2video)
Press [q] to stop, [?] for help
frame=341675 fps=225 q=0.0 Lsize= 5726054kB time=03:10:00.52 bitrate=4114.5kbits/s dup=179827 drop=0    
video:5699735kB audio:0kB global headers:0kB muxing overhead 0.461751%
$ ffmpeg -i CAPTURE-HD-RM164_2012-08-20_13_21_28.ts -vn -acodec pcm_s16le -q 0 audio.wav
ffmpeg version 0.11.1 Copyright (c) 2000-2012 the FFmpeg developers
  built on Jun  9 2012 13:50:13 with gcc 4.7.0 20120505 (prerelease)
  configuration: --prefix=/usr --enable-libmp3lame --enable-libvorbis --enable-libxvid --enable-libx264 --enable-libvpx --enable-libtheora --enable-libgsm --enable-libspeex --enable-postproc --enable-shared --enable-x11grab --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libschroedinger --enable-libopenjpeg --enable-librtmp --enable-libpulse --enable-libv4l2 --enable-gpl --enable-version3 --enable-runtime-cpudetect --disable-debug --disable-static
  libavutil      51. 54.100 / 51. 54.100
  libavcodec     54. 23.100 / 54. 23.100
  libavformat    54.  6.100 / 54.  6.100
  libavdevice    54.  0.100 / 54.  0.100
  libavfilter     2. 77.100 /  2. 77.100
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0. 15.100 /  0. 15.100
  libpostproc    52.  0.100 / 52.  0.100
[mpegts @ 0xa28100] max_analyze_duration 5000000 reached at 5013333
[mpegts @ 0xa28100] Could not find codec parameters (Unknown: none ([6][0][0][0] / 0x0006))
[NULL @ 0xa2d220] start time is not set in estimate_timings_from_pts
Input #0, mpegts, from 'CAPTURE-HD-RM164_2012-08-20_13_21_28.ts':
  Duration: 01:30:00.57, start: 599.983333, bitrate: 2280 kb/s
  Program 1 
    Stream #0:0[0x1011]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x1012]: Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz, stereo, s16, 92 kb/s
    Stream #0:2[0x1013]: Unknown: none ([6][0][0][0] / 0x0006)
Output #0, wav, to 'audio.wav':
  Metadata:
    encoder         : Lavf54.6.100
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #0:1 -> #0:0 (aac -> pcm_s16le)
Press [q] to stop, [?] for help
size= 1012612kB time=01:30:00.59 bitrate=1536.0kbits/s    
video:0kB audio:1012612kB global headers:0kB muxing overhead 0.000004%
Version 0, edited 4 years ago by buhman (next)

comment:8 in reply to: ↑ 7 Changed 4 years ago by cehoyos

  • Cc buhman added
  • Resolution set to invalid
  • Status changed from reopened to closed

Replying to buhman:

Verbatim Source: http://buhman.org/CAPTURE-HD-RM164_2012-08-20_13_21_28.ts

I created ticket #1715
It is generally not a good idea to open ancient tickets, especially if they were closed as invalid (and not as "needs more information"). Please read the explanation above, framerate selection only makes sense for rawvideo input (and similar), for your sample timestamps are incorrect, this is a bug that is not framerate-related.

Note: See TracTickets for help on using tickets.