[FFmpeg-user] Reduce mux overhead of HLS stream creation

Wesley Wen delbin.wen at gmail.com
Mon Feb 16 11:31:17 CET 2015


On Mon Feb 16 2015 at 4:46:34 PM Moritz Barsnick <barsnick at gmx.net> wrote:

> On Mon, Feb 16, 2015 at 04:38:47 +0000, Wesley Wen wrote:
> > I'm using FFmpeg to create HLS stream, but noticed significant TS muxing
> > overhead (especially for low bitrate condition). I used Elecard Stream
> > Analyzer to look at the stream and came up some questions.
>
> [...]
>
> > ffmpeg -loglevel fatal -y -i audio_p0.mp4 -i video_p0.mp4 -dn -sn
> -threads
> > 0 -map 0:0 -map 1:0 -f ssegment -segment_time 5.005 -segment_list p0.m3u8
> > -segment_list_entry_prefix p0/ -segment_format mpegts -c:v copy -c:a copy
> > -vbsf h264_mp4toannexb -flags -global_header p0/%d.ts
>
> You should always also show us the complete, uncut console output from
> your command.
>
> $ffmpeg -y -i audio_p0.mp4 -i video_p0.mp4 -dn -sn -threads 0 -map 0:0
-map 1:0 -f ssegment -egment_time 5.005 -segment_list p0.m3u8
-segment_list_entry_prefix p0/ -segment_format mpegts -c:v copy -c:a copy
-vbsf h264_mp4toannexb -flags -global_header "%d.ts"

ffmpeg version git-2015-02-12-cac2295 Copyright (c) 2000-2015 the FFmpeg
developers
  built with Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared
--enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables
--enable-avresample --cc=clang --host-cflags= --host-ldflags=
--enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid
--enable-libfaac --enable-ffplay --enable-libfdk-aac --enable-libx265
--enable-nonfree --enable-vda
  libavutil      54. 18.100 / 54. 18.100
  libavcodec     56. 21.102 / 56. 21.102
  libavformat    56. 19.101 / 56. 19.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 10.100 /  5. 10.100
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'audio_p0.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf56.15.101
  Duration: 00:00:49.73, start: 0.046440, bitrate: 33 kb/s
    Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz,
stereo, fltp, 32 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'video_p0.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.15.101
  Duration: 00:00:49.73, start: 0.000000, bitrate: 78 kb/s
    Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p,
426x240 [SAR 640:639 DAR 16:9], 78 kb/s, 15 fps, 15 tbr, 15360 tbn, 30 tbc
(default)
    Metadata:
      handler_name    : VideoHandler
Output #0, stream_segment,ssegment, to '%d.ts':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf56.19.101
    Stream #0:0(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, 32
kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Stream #0:1(und): Video: h264 (avc1 / 0x31637661), yuv420p, 426x240
[SAR 640:639 DAR 16:9], q=2-31, 78 kb/s, 15 fps, 15 tbr, 90k tbn, 15 tbc
(default)
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #1:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=  746 fps=0.0 q=-1.0 Lsize=N/A time=00:00:49.73 bitrate=N/A
video:477kB audio:194kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: unknown

Question: why muxing overhead filed shows unknown?


> For one, we might identify that your problem has been fixed already.
> Here's a (fixed) ticket concerning a similar matter:
>
> https://trac.ffmpeg.org/ticket/2857
>
> In my case, overhead is mostly introduced by small video frames, e.g.
P-frame.


> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>


More information about the ffmpeg-user mailing list