Opened 11 years ago

Closed 10 years ago

#2857 closed defect (fixed)

overhead of HLS muxing too large

Reported by: aviadr1 Owned by:
Priority: normal Component: avformat
Version: git-master Keywords: hls
Cc: rixweb@hydentech.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
the muxing overhead when creating .ts files using FFMPEG is too large, often exceeding 25% for certain .ts files

How to reproduce:

ffmpeg.exe -i input/128p164k.mp4 -codec copy -map 0 -f stream_segment -segment_time 3 -segment_time_delta 1 -segment_list out/128p164k.m3u8 -bsf:v h264_mp4toannexb out/captain_america_Stream1_128p164k-%d.ts

ffmpeg version N-54772-g53c853e Copyright (c) 2000-2013 the FFmpeg developers
built on Jul 16 2013 22:25:42 with gcc 4.7.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 40.100 / 52. 40.100
libavcodec 55. 18.102 / 55. 18.102
libavformat 55. 12.102 / 55. 12.102
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 81.101 / 3. 81.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'c:\media\transcodes\test\captain_america_Stream1_128p164k.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.1.0
Duration: 00:02:30.42, start: 0.000000, bitrate: 155 kb/s
Chapter #0.0: start 0.119002, end 150.419000
Metadata:
title :
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 224x128 [SAR 160:119 DAR 40:17], 113 kb/s, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 22050 Hz, stereo, fltp, 38 kb/s
Metadata:
handler_name : SoundHandler
Output #0, stream_segment,ssegment, to 'c:\media\packages\test\captain_america_Stream1_128p164k-%d.ts':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf55.12.102
Chapter #0.0: start 0.119002, end 150.419000
Metadata:
title :
Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p, 224x128 [SAR 160:119 DAR 40:17], q=2-31, 113 kb/s, 23.98 fps, 90k tbn, 23.98 tbc
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 22050 Hz, stereo, 38 kb/s
Metadata:
handler_name : SoundHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, ? for help
[adts @ 0000000004bb9920] Encoder did not produce proper pts, making some up.
frame= 3242 fps=0.0 q=-1.0 size=N/A time=00:02:15.21 bitrate=N/A
frame= 3603 fps=0.0 q=-1.0 Lsize=N/A time=00:02:30.41 bitrate=N/A
video:2075kB audio:716kB subtitle:0 global headers:0kB muxing overhead -100.000770%

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Change History (9)

comment:1 by Carl Eugen Hoyos, 11 years ago

Keywords: hls added

Please provide the input sample.

comment:2 by Rich W., 11 years ago

Cc: rixweb@hydentech.com added

comment:3 by Stefano Sabatini, 11 years ago

Is this a problem related to the segment muxer or the MPEG-TS muxer? Why do you think it is a problem of segment?

How much overhead do you expect from the TS muxer? Note that "muxing too large" is pretty vague.

Can you provide numbers and a sample to reproduce the problem, or the problem does not depend on the input?

comment:4 by Carl Eugen Hoyos, 11 years ago

Resolution: needs_more_info
Status: newclosed

Please reopen this ticket if you can provide the missing information.

comment:5 by Mista_D, 11 years ago

Resolution: needs_more_info
Status: closedreopened

Same problem here. The generated segment files are 60% bigger. A very low bitrate 1 fps slide show video is used as example, the higher the bitrate of the video file, the lower the overhead percentage. Same file segmente

$ ffmpeg213 -i ../56k.ts -c copy -copyts -hls_time 8.9 -hls_list_size 0 -f hls ff.m3u8
ffmpeg version 2.1.3 Copyright (c) 2000-2013 the FFmpeg developers

built on Jan 20 2014 18:00:04 with gcc 4.1.2 (GCC) 20080704 (Red Hat 4.1.2-52)
configuration: --enable-static --enable-postproc --enable-gpl --enable-avfilter --enable-libx264 --enable-libxvid --enable-libmp3lame --enable-libfaac --enable-pthreads --enable-swscale --enable-runtime-cpudetect --disable-devices --disable-avdevice --extra-ldflags=-static --disable-shared --enable-bzlib --enable-zlib --extra-libs='-lx264 -lxvidcore -lmp3lame -lpthread -lm -lbz2 -lz -lpthread -lvpx -lass -lfontconfig -lexpat -lfreetype -lfaac' --disable-encoder=libgsm --disable-decoder=libgsm --disable-doc --enable-libvpx --enable-libass --enable-version3 --enable-nonfree --enable-libfreetype
libavutil 52. 48.101 / 52. 48.101
libavcodec 55. 39.101 / 55. 39.101
libavformat 55. 19.104 / 55. 19.104
libavfilter 3. 90.100 / 3. 90.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100

[mpegts @ 0x18009f80] decoding for stream 0 failed
Input #0, mpegts, from '../56k.ts':

Duration: 00:09:58.02, start: 1.378667, bitrate: 57 kb/s
Program 1

Metadata:

service_name : Service01
service_provider: FFmpeg

Stream #0:0[0x100]: Video: h264 (Constrained Baseline) ([27][0][0][0] / 0x001B), yuv420p, 192x112, 1 fps, 1 tbr, 90k tbn, 2 tbc
Stream #0:1[0x101](eng): Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz, mono, fltp, 28 kb/s

Output #0, hls, to 'ff.m3u8':

Metadata:

encoder : Lavf55.19.104
Stream #0:0: Video: h264 ([27][0][0][0] / 0x001B), yuv420p, 192x112, q=2-31, 1 fps, 90k tbn, 1 tbc
Stream #0:1(eng): Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz, mono, 28 kb/s

Stream mapping:

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

Press [q] to stop, ? for help
frame= 599 fps=0.0 q=-1.0 Lsize=N/A time=00:10:00.40 bitrate=N/A
video:1396kB audio:2335kB subtitle:0 global headers:0kB muxing overhead -100.000576%

Size of all segments is:
$ du
7420 .

Using 1ffmpeg -i ../56k.ts -c copy -map 0 -copyts -f segment -segment_time 10 -segment_list test.m3u8 -segment_format mpegts 56k_%05d.ts` produces same result.

Size of the source file is:
ls -al ../56k.ts
-rw------- 1 user01 UnixUsers 4296928 Jan 21 14:26 ../56k.ts

The sample file is at http://www.mediafire.com/download/o21u4487joyohoi/56k.ts

comment:6 by Mista_D, 11 years ago

Component: undeterminedFFmpeg
Priority: normalimportant
Status: reopenedopen
Version: unspecified2.1.3

comment:7 by Carl Eugen Hoyos, 11 years ago

Component: FFmpegundetermined
Priority: importantnormal
Version: 2.1.3unspecified

comment:9 by Carl Eugen Hoyos, 10 years ago

Component: undeterminedavformat
Resolution: fixed
Status: openclosed
Version: unspecifiedgit-master

Should be fixed by Mika Raento in 75c8d7c2b4972f6ba2cef605949f57322f7c0361

Note: See TracTickets for help on using tickets.