Opened 14 months ago

Closed 8 months ago

#8874 closed defect (invalid)

mp4 muxer indicates Variable Frame Rate

Reported by: Chris Lavin Owned by:
Priority: normal Component: ffmpeg
Version: unspecified Keywords:
Cc: clavin@chrislavin.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

If I use the following command

~/ffmpeg_sources/ffmpeg/ffmpeg -i /Volumes/VOLUME01/Chris/sample.ts -c copy /Volumes/VOLUME01/Chris/sample.mp4

The reported frame rate mode is variable (this is a problem for our editing systems)

If I modify that command to :

~/ffmpeg_sources/ffmpeg/ffmpeg -i /Volumes/VOLUME01/Chris/sample.ts -c copy -f segment -segment_time 09:00:00 -reset_timestamps 1 /Volumes/VOLUME01/Chris/sample%03d.mp4

It reports constant frame rate and works fine in our editing systems

I am using mediinfo to confirm these issues..

Here is my output
~/ffmpeg_sources/ffmpeg/ffmpeg -i /Volumes/VOLUME01/Chris/sample.ts -c copy -f segment -segment_time 09:00:00 -reset_timestamps 1 /Volumes/VOLUME01/Chris/sample%03d.mp4
ffmpeg version N-98896-g0d46043 Copyright (c) 2000-2020 the FFmpeg developers

built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-39)
configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --extra-libs=-lpthread --extra-libs=-lm --bindir=/root/bin --enable-gpl --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
libavutil 56. 58.100 / 56. 58.100
libavcodec 58.101.100 / 58.101.100
libavformat 58. 51.101 / 58. 51.101
libavdevice 58. 11.101 / 58. 11.101
libavfilter 7. 87.100 / 7. 87.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100

Input #0, mpegts, from '/Volumes/VOLUME01/Chris/sample.ts':

Duration: 00:02:00.02, start: 1.413333, bitrate: 12478 kb/s
Program 1

Metadata:

service_name : Service01
service_provider: FFmpeg

Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc
Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 127 kb/s

[segment @ 0x452a640] Opening '/Volumes/VOLUME01/Chris/sample000.mp4' for writing
Output #0, segment, to '/Volumes/VOLUME01/Chris/sample%03d.mp4':

Metadata:

encoder : Lavf58.51.101
Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 59.94 fps, 59.94 tbr, 60k tbn, 59.94 tbc
Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 127 kb/s

Stream mapping:

Stream #0:0 -> #0:0 (copy)

Also the file uploaded has been renamed from sample.ts to VariableFrameRate.ts

Change History (7)

comment:1 by Chris Lavin, 14 months ago

Cc: clavin@chrislavin.com added
Summary: mp4 mixer indicates Variable Frame Ratemp4 muxer indicates Variable Frame Rate

comment:2 by Carl Eugen Hoyos, 14 months ago

Did you first create a vfr file with FFmpeg and then expected FFmpeg to magically make it cfr or do I misunderstand your report?

comment:3 by Chris Lavin, 14 months ago

No I dont expect magic... It is a CFR .ts that i am simply trying to demux to an mp4 and if you read through the ticket you will see that if create a segment the segment is CFR...

comment:4 by Chris Lavin, 14 months ago

Here is a link to the source file with a CFR as a ts..

https://www.dropbox.com/s/cl7gz5ej8i5992k/VariableFrameRate.ts?dl=1

comment:5 by Balling, 14 months ago

Status: newopen

The file is IMHO broken. If you will copy it to mkv and then to mp4 it will be even more crazy with
Frame rate mode : Variable
Frame rate : 60.279 FPS
Minimum frame rate : 58.824 FPS
Maximum frame rate : 16 000.000 FPS WTF?
Original frame rate : 59.940 (60000/1001) FPS

Last edited 14 months ago by Balling (previous) (diff)

comment:6 by Chris Lavin, 14 months ago

What is broken about the file? The file is captured by FFMPEG from a UDP stream to a .ts file

in reply to:  6 comment:7 by Balling, 8 months ago

Resolution: invalid
Status: openclosed

Replying to RCJetPilot:

What is broken about the file? The file is captured by FFMPEG from a UDP stream to a .ts file

Your file is VFR. You can check it with
ffmpeg -i VariableFrameRate.ts -vf vfrdet -an -f null -

It prints

[Parsed_vfrdet_0 @ 000002cef4b64a40] VFR:0.997207 (357/1) min: 1501 max: 3003 avg: 1505

VFR value is not 0, so it is VFR.

If you do -c copy to mp4 it will print the way it is. mkv conversion is broken because there are no DTS in mkv, only PTS. See #7927.

Note: See TracTickets for help on using tickets.