mediainfo reports variable FPS with qtmux output

Simon Feltman s.feltman at gmail.com
Thu Aug 24 02:01:26 UTC 2017


Hi All,

I'm looking into an issue where files generated with qtmux report a
variable FPS with mediainfo. The source is generated as follows:

% gst-launch-1.0 --gst-debug="qtmux:5" \
  videotestsrc \
    num-buffers=10 \
  ! "video/x-raw,format=v210,width=1920,height=1080,framerate=60000/1001" \
  ! qtmux \
  ! filesink \
    location=videotestsrc-1080p5994.mov

...
0:00:00.038645151 17988 0x564a45c86d90 DEBUG                  qtmux
gstqtmux.c:3796:gst_qt_mux_video_sink_set_caps:<qtmux0> Rate of video
track selected: 6000
...

Note the qtmux debug output shows a video track timescale of 6000 was
selected. Mediainfo then reports the following with this file:

% mediainfo videotestsrc-1080p5994.mov
...
Frame rate mode                          : Variable
Frame rate                               : 59.940 FPS
Minimum frame rate                       : 59.406 FPS
Maximum frame rate                       : 60.000 FPS
...

Is this a bug in timescale selection, an issue with mediainfo, or
expected behavior?

If I generate quicktime movies with DaVinci Resolve [1], I observe a
track timescale selection (and movie timescale) of simply the
framerate numerator and mediainfo reports a constant FPS:

% gst-launch-1.0 --gst-debug-no-color --gst-debug="qtdemux:5" \
  filesrc \
    location=resolve-colorbars-1080p5994.mov \
    ! qtdemux \
    ! fakesink \
    2>&1 | grep timescale

0:00:00.021374109 18089 0x563b89bb3f20 INFO                 qtdemux
qtdemux.c:11670:qtdemux_parse_tree:<qtdemux0> timescale: 60000
0:00:00.021515748 18089 0x563b89bb3f20 DEBUG                qtdemux
qtdemux.c:7947:qtdemux_parse_segments:<qtdemux0> created segment 0
time 0:00:00.000000000, duration 0:00:01.034366666, media_start
0:00:00.000000000 (0) , media_stop 0:00:01.034366666 stop_time
0:00:01.034366666 rate 1, (65536) timescale 60000
0:00:00.021718150 18089 0x563b89bb3f20 DEBUG                qtdemux
qtdemux.c:7947:qtdemux_parse_segments:<qtdemux0> created segment 0
time 0:00:00.000000000, duration 0:00:01.034383333, media_start
0:00:00.000000000 (0) , media_stop 0:00:01.034383333 stop_time
0:00:01.034383333 rate 1, (65536) timescale 48000
0:00:00.021949885 18089 0x563b89bb3f20 DEBUG                qtdemux
qtdemux.c:6847:gst_qtdemux_configure_stream:<qtdemux0> Calculating
framerate, timescale 60000 gave fps_n 60000 fps_d 1001

% mediainfo resolve-colorbars-1080p5994.mov
...
Frame rate mode                          : Constant
Frame rate                               : 59.940 (60000/1001) FPS
...

% gst-launch-1.0 --gst-debug-no-color --gst-debug="qtdemux:5" \
  filesrc \
    location=resolve-colorbars-1080p60.mov \
    ! qtdemux \
    ! fakesink \
    2>&1 | grep timescale

0:00:00.017889701 18427 0x55863522bf20 INFO                 qtdemux
qtdemux.c:11670:qtdemux_parse_tree:<qtdemux0> timescale: 60
0:00:00.018007734 18427 0x55863522bf20 DEBUG                qtdemux
qtdemux.c:7947:qtdemux_parse_segments:<qtdemux0> created segment 0
time 0:00:00.000000000, duration 0:00:01.166666666, media_start
0:00:00.000000000 (0) , media_stop 0:00:01.166666666 stop_time
0:00:01.166666666 rate 1, (65536) timescale 60
0:00:00.018183037 18427 0x55863522bf20 DEBUG                qtdemux
qtdemux.c:7947:qtdemux_parse_segments:<qtdemux0> created segment 0
time 0:00:00.000000000, duration 0:00:01.166666666, media_start
0:00:00.000000000 (0) , media_stop 0:00:01.166666666 stop_time
0:00:01.166666666 rate 1, (65536) timescale 48000
0:00:00.018375870 18427 0x55863522bf20 DEBUG                qtdemux
qtdemux.c:6847:gst_qtdemux_configure_stream:<qtdemux0> Calculating
framerate, timescale 60 gave fps_n 60 fps_d 1

% mediainfo resolve-colorbars-1080p60.mov
...
Frame rate mode                          : Constant
Frame rate                               : 60.000 FPS
...

I can manually set the trak-timescale of qtmux, but then this value is
also used for audio tracks which is not desired. What is the correct
behavior and is there an issue with timescale selection simply using
the framerate numerator?

I was unable find much in terms of recommended timescale in Apple's
documentation [2] and I was only able to look at the Gst history up to
the point at which the "gst-qtmux" project was merged [3]. Also
relevant are commits [4] and [5].

Any pointers to help understand this better would be appreciated.

Thanks,
-Simon

References:
[1] https://file.io/TrTP0P and https://file.io/kppYbV
[2] https://developer.apple.com/library/content/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html
[3] https://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=c991a04a
[4] https://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=bee00aa7
[5] https://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=727fa1c7


More information about the gstreamer-devel mailing list