ffprobe returns wrong bitrate on fragmented mp4

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ffprobe returns wrong bitrate on fragmented mp4

daniel jee
I tried running ffprobe on a fragmented mp4 file with a bunch of moof +
mdat boxes.
The command that I tried was: ffprobe -show_streams -show_format ./video.mp4
The output was as follows:

ffprobe version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2007-2019 the FFmpeg
developers
  built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
  configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1
--toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
--incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping
--enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libflite --enable-libfontconfig
--enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm
--enable-libmp3lame --enable-libmysofa --enable-libopenjpeg
--enable-libopenmpt --enable-libopus --enable-libpulse
--enable-librubberband --enable-librsvg --enable-libshine
--enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh
--enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx
--enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2
--enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx
--enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394
--enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r
--enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './bass.mp4':
  Metadata:
    major_brand     : dash
    minor_version   : 0
    compatible_brands: iso6avc1mp41
    creation_time   : 2019-11-12T05:18:09.000000Z
  Duration: 00:04:48.04, start: 0.000000, bitrate: 1578 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv,
bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 32 kb/s, 23.98 fps, 23.98
tbr, 24k tbn, 47.95 tbc (default)
    Metadata:
      creation_time   : 2019-11-12T05:18:09.000000Z
      handler_name    : ISO Media file produced by Google Inc.
[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=Main
codec_type=video
codec_time_base=1001/48000
codec_tag_string=avc1
codec_tag=0x31637661
width=1280
height=720
coded_width=1280
coded_height=720
has_b_frames=1
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuv420p
level=31
color_range=tv
color_space=bt709
color_transfer=bt709
color_primaries=bt709
chroma_location=left
field_order=progressive
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=24000/1001
avg_frame_rate=24000/1001
time_base=1/24000
start_pts=0
start_time=0.000000
duration_ts=6912906
duration=288.037750
bit_rate=32993
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:creation_time=2019-11-12T05:18:09.000000Z
TAG:language=und
TAG:handler_name=ISO Media file produced by Google Inc.
[/STREAM]
[FORMAT]
filename=./bass.mp4
nb_streams=1
nb_programs=0
format_name=mov,mp4,m4a,3gp,3g2,mj2
format_long_name=QuickTime / MOV
start_time=0.000000
duration=288.037750
size=56838597
bit_rate=1578642
probe_score=100
TAG:major_brand=dash
TAG:minor_version=0
TAG:compatible_brands=iso6avc1mp41
TAG:creation_time=2019-11-12T05:18:09.000000Z
[/FORMAT]

I suspect that ffprobe is not going through the entire file to output the
bitrate.
How can I get the correct bitrate for fragmented mp4 files?
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffprobe returns wrong bitrate on fragmented mp4

Moritz Barsnick
On Mon, Dec 02, 2019 at 17:18:49 +1000, daniel jee wrote:
> I tried running ffprobe on a fragmented mp4 file with a bunch of moof +
> mdat boxes.
> The command that I tried was: ffprobe -show_streams -show_format ./video.mp4
> The output was as follows:
>
> ffprobe version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2007-2019 the FFmpeg developers

This version is functionally over two years old. Could you kindly try a
very recent version from git master? Your issue may have been fixed.

(You can grab a static binary, if you don't care to compile yourself,
here:
https://johnvansickle.com/ffmpeg/
Left column, git master, please.)

>   Duration: 00:04:48.04, start: 0.000000, bitrate: 1578 kb/s
>     Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 32 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
[...]
> [STREAM]
[...]
> bit_rate=32993
[...]
> [/STREAM]
> [FORMAT]
[...]
> bit_rate=1578642

Which of the three mentioned ones do you consider incorrect?

Thanks,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffprobe returns wrong bitrate on fragmented mp4

daniel jee
I installed version 4.2.1-0york0~18.04.1 but the result is the same.

The bit_rate in the video stream is incorrect.

I tried running the command on a fragmented mp4 file with audio and video
streams and the output is as follows:
------------------------------------------------------------------------------------------
  Metadata:
    major_brand     : iso5
    minor_version   : 1
    compatible_brands: avc1iso5dsmsmsixdash
    encoder         : Lavf57.83.100
  Duration: 00:00:13.46, start: -0.021333, bitrate: 10603 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
3840x2160 [SAR 1:1 DAR 16:9], 1452 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
(default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 41 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1/50
codec_tag_string=avc1
codec_tag=0x31637661
width=3840
height=2160
coded_width=3840
coded_height=2160
has_b_frames=2
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuv420p
level=51
color_range=unknown
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=left
field_order=unknown
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=25/1
avg_frame_rate=25/1
time_base=1/12800
start_pts=0
start_time=0.000000
duration_ts=172032
duration=13.440000
bit_rate=1452239
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=und
TAG:handler_name=VideoHandler
[/STREAM]
[STREAM]
index=1
codec_name=aac
codec_long_name=AAC (Advanced Audio Coding)
profile=LC
codec_type=audio
codec_time_base=1/48000
codec_tag_string=mp4a
codec_tag=0x6134706d
sample_fmt=fltp
sample_rate=48000
channels=2
channel_layout=stereo
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/48000
start_pts=-1024
start_time=-0.021333
duration_ts=645120
duration=13.440000
bit_rate=41608
max_bit_rate=260711
bits_per_raw_sample=N/A
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=und
TAG:handler_name=SoundHandler
[/STREAM]
[FORMAT]
filename=AudioNotWorkingAfterFfmpeg_dashinit.mp4
nb_streams=2
nb_programs=0
format_name=mov,mp4,m4a,3gp,3g2,mj2
format_long_name=QuickTime / MOV
start_time=-0.021333
duration=13.461333
size=17842037
bit_rate=10603429
probe_score=100
TAG:major_brand=iso5
TAG:minor_version=1
TAG:compatible_brands=avc1iso5dsmsmsixdash
TAG:encoder=Lavf57.83.100
[/FORMAT]
------------------------------------------------------------------------------------------

The original mp4 file that is not fragmented returned a correct result:

------------------------------------------------------------------------------------------
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:13.46, start: 0.000000, bitrate: 10604 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
3840x2160 [SAR 1:1 DAR 16:9], 10353 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
(default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 260 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1/50
codec_tag_string=avc1
codec_tag=0x31637661
width=3840
height=2160
coded_width=3840
coded_height=2160
has_b_frames=2
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuv420p
level=51
color_range=unknown
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=left
field_order=unknown
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=25/1
avg_frame_rate=25/1
time_base=1/12800
start_pts=0
start_time=0.000000
duration_ts=172032
duration=13.440000
bit_rate=10353534
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=336
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=und
TAG:handler_name=VideoHandler
[/STREAM]
[STREAM]
index=1
codec_name=aac
codec_long_name=AAC (Advanced Audio Coding)
profile=LC
codec_type=audio
codec_time_base=1/48000
codec_tag_string=mp4a
codec_tag=0x6134706d
sample_fmt=fltp
sample_rate=48000
channels=2
channel_layout=stereo
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/48000
start_pts=0
start_time=0.000000
duration_ts=645120
duration=13.440000
bit_rate=260711
max_bit_rate=260711
bits_per_raw_sample=N/A
nb_frames=631
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=und
TAG:handler_name=SoundHandler
[/STREAM]
[FORMAT]
filename=AudioNotWorkingAfterFfmpeg.mp4
nb_streams=2
nb_programs=0
format_name=mov,mp4,m4a,3gp,3g2,mj2
format_long_name=QuickTime / MOV
start_time=0.000000
duration=13.462000
size=17844114
bit_rate=10604138
probe_score=100
TAG:major_brand=isom
TAG:minor_version=512
TAG:compatible_brands=isomiso2avc1mp41
TAG:encoder=Lavf57.83.100
[/FORMAT]
------------------------------------------------------------------------------------------


On Mon, 2 Dec 2019, 23:17 Moritz Barsnick <[hidden email]> wrote:

> On Mon, Dec 02, 2019 at 17:18:49 +1000, daniel jee wrote:
> > I tried running ffprobe on a fragmented mp4 file with a bunch of moof +
> > mdat boxes.
> > The command that I tried was: ffprobe -show_streams -show_format
> ./video.mp4
> > The output was as follows:
> >
> > ffprobe version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2007-2019 the
> FFmpeg developers
>
> This version is functionally over two years old. Could you kindly try a
> very recent version from git master? Your issue may have been fixed.
>
> (You can grab a static binary, if you don't care to compile yourself,
> here:
> https://johnvansickle.com/ffmpeg/
> Left column, git master, please.)
>
> >   Duration: 00:04:48.04, start: 0.000000, bitrate: 1578 kb/s
> >     Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661),
> yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 32 kb/s,
> 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
> [...]
> > [STREAM]
> [...]
> > bit_rate=32993
> [...]
> > [/STREAM]
> > [FORMAT]
> [...]
> > bit_rate=1578642
>
> Which of the three mentioned ones do you consider incorrect?
>
> Thanks,
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".