[FFmpeg-user] ffmpeg hls output acts as if it has buffering issues but it does not

Michael Billings m_j_billings at yahoo.com
Tue Aug 11 17:08:49 CEST 2015


Hello everyone, thanks in advance for your help.  If there is a better forum for this please let me know.

Thanks,
Michael

Background:  Creating HLS files using ffmpeg from an existing mp4 and mp3 audio files.  I am combining the files on the fly and creating the appropriate .m3u8 and .ts files using ffmpeg.  All seems to be working fine, the files are valid and I can play them in an HTML 5 player as well as a VLC player.

Symptoms:  While I can play them in multiple players, they act as if they are buffering because of large pauses between some of the segments.  I don’t think this is buffering however due to a network connection because I have a broadband connection and can see the player requesting the .ts files in a timely fashion.  They just aren’t played seamlessly in the players.  One item to note, the audio track is longer than the video track and once the video is finished the audio plays seamlessly just fine.

Live link:  If it would help to see the hls stream yourself the link is -> http://www.takemethere.tv/sav-ent/segment_cache/DEST_BCH_01_3_Slip_Into_Something_More_Comfortable.mp3.m3u8

ffmpeg command line:
/opt/savent/hls/ffmpeg -i ${video_base}${video}.mp4 \
	-i ${audio_base}${genre}/${audio} -c:v libx264 -c:a aac -strict experimental \
	-map 0:v:0 -map 1:a:0 -f ssegment -segment_list \
	${destination_dir}/${video}_${audio}_200000.m3u8 -segment_list_flags cache -segment_time 2 \
	${destination_dir}/${video}_${audio}%03d.ts

files generated:
-rw-rw-r-- 1 developer developer   2796124 Aug 11 08:01 DEST_BCH_01_3_Slip_Into_Something_More_Comfortable.mp3000.ts
-rw-rw-r-- 1 developer developer   2778640 Aug 11 08:01 DEST_BCH_01_3_Slip_Into_Something_More_Comfortable.mp3001.ts
-rw-rw-r-- 1 developer developer   2746868 Aug 11 08:01 DEST_BCH_01_3_Slip_Into_Something_More_Comfortable.mp3002.ts
-rw-rw-r-- 1 developer developer   2692348 Aug 11 08:02 DEST_BCH_01_3_Slip_Into_Something_More_Comfortable.mp3003.ts
-rw-rw-r-- 1 developer developer   2705508 Aug 11 08:02 DEST_BCH_01_3_Slip_Into_Something_More_Comfortable.mp3004.ts
-rw-rw-r-- 1 developer developer   2730512 Aug 11 08:02 DEST_BCH_01_3_Slip_Into_Something_More_Comfortable.mp3005.ts
-rw-rw-r-- 1 developer developer   2713216 Aug 11 08:02 DEST_BCH_01_3_Slip_Into_Something_More_Comfortable.mp3006.ts
-rw-rw-r-- 1 developer developer   2726188 Aug 11 08:02 DEST_BCH_01_3_Slip_Into_Something_More_Comfortable.mp3007.ts
-rw-rw-r-- 1 developer developer   2670728 Aug 11 08:02 DEST_BCH_01_3_Slip_Into_Something_More_Comfortable.mp3008.ts
-rw-rw-r-- 1 developer developer   2732392 Aug 11 08:02 DEST_BCH_01_3_Slip_Into_Something_More_Comfortable.mp3009.ts
-rw-rw-r-- 1 developer developer   2758148 Aug 11 08:02 DEST_BCH_01_3_Slip_Into_Something_More_Comfortable.mp3010.ts
-rw-rw-r-- 1 developer developer   2706824 Aug 11 08:02 DEST_BCH_01_3_Slip_Into_Something_More_Comfortable.mp3011.ts
-rw-rw-r-- 1 developer developer   5523628 Aug 11 08:02 DEST_BCH_01_3_Slip_Into_Something_More_Comfortable.mp3012.ts
-rw-rw-r-- 1 developer developer    704812 Aug 11 08:02 DEST_BCH_01_3_Slip_Into_Something_More_Comfortable.mp3013.ts
-rw-rw-r-- 1 developer developer      1231 Aug 11 08:02 DEST_BCH_01_3_Slip_Into_Something_More_Comfortable.mp3_200000.m3u8
-rw-rw-r-- 1 developer developer       124 Aug 11 08:01 DEST_BCH_01_3_Slip_Into_Something_More_Comfortable.mp3.m3u8

ffmpeg output:
*** segment.sh ***
Video 'DEST_BCH_01'
Genre 'Chill'
Audio '3_Slip_Into_Something_More_Comfortable.mp3'
ffmpeg version 2.7.2-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 4.9.3 (Debian 4.9.3-1)
  configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --enable-libass --enable-gnutls --enable-libvidstab --enable-libsoxr --cc=gcc-4.9
  libavutil      54. 27.100 / 54. 27.100
  libavcodec     56. 41.100 / 56. 41.100
  libavformat    56. 36.100 / 56. 36.100
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 16.101 /  5. 16.101
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.100 /  1.  2.100
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/html/sav-ent/content/DEST_BCH_01.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomavc1
    creation_time   : 2015-06-10 15:42:56
    compilation     : 0
    encoder         : Sorenson Squeeze
    comment         : Encoded by
  Duration: 00:02:17.01, start: 0.000000, bitrate: 5183 kb/s
    Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 192 kb/s (default)
    Metadata:
      creation_time   : 2015-06-10 15:42:56
      handler_name    : soun
    Stream #0:1(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv), 1920x1080 [SAR 1:1 DAR 16:9], 4986 kb/s, 23.98 fps, 23.98 tbr, 23976 tbn, 47.95 tbc (default)
    Metadata:
      creation_time   : 2015-06-10 15:42:56
      handler_name    : vide
      encoder         : AVC Coding
    Stream #0:2(und): Data: none (mp4s / 0x7334706D) (default)
    Metadata:
      creation_time   : 2015-06-10 15:42:57
      handler_name    : sdsm
    Stream #0:3(und): Data: none (mp4s / 0x7334706D), 0 kb/s (default)
    Metadata:
      creation_time   : 2015-06-10 15:42:57
      handler_name    : odsm
[mp3 @ 0x3962580] Skipping 0 bytes of junk at 671.
Input #1, mp3, from '/var/www/html/sav-ent/roku/Audio/Chill/3_Slip_Into_Something_More_Comfortable.mp3':
  Metadata:
    encoder         : Lavf55.12.100
  Duration: 00:04:57.77, start: 0.025057, bitrate: 192 kb/s
    Stream #1:0: Audio: mp3, 44100 Hz, stereo, s16p, 192 kb/s
[libx264 @ 0x39972e0] using SAR=1/1
[libx264 @ 0x39972e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x39972e0] profile High, level 4.0
Output #0, stream_segment,ssegment, to '/var/www/html/sav-ent/segment_cache/DEST_BCH_01_3_Slip_Into_Something_More_Comfortable.mp3%03d.ts':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isomavc1
    comment         : Encoded by
    compilation     : 0
    encoder         : Lavf56.36.100
    Stream #0:0(und): Video: h264 (libx264), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 23.98 fps, 90k tbn, 23.98 tbc (default)
    Metadata:
      creation_time   : 2015-06-10 15:42:56
      handler_name    : vide
      encoder         : Lavc56.41.100 libx264
    Stream #0:1: Audio: aac, 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc56.41.100 aac
Stream mapping:
  Stream #0:1 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (mp3 (native) -> aac (native))
Press [q] to stop, [?] for help
frame= 3286 fps= 79 q=-1.0 Lsize=N/A time=00:04:57.74 bitrate=N/A dup=1 drop=0
video:30042kB audio:4625kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[libx264 @ 0x39972e0] frame I:14    Avg QP:15.39  size:308087
[libx264 @ 0x39972e0] frame P:843   Avg QP:18.30  size: 22555
[libx264 @ 0x39972e0] frame B:2429  Avg QP:22.13  size:  3061
[libx264 @ 0x39972e0] consecutive B-frames:  1.3%  0.4%  0.4% 98.0%
[libx264 @ 0x39972e0] mb I  I16..4: 28.1% 29.4% 42.4%
[libx264 @ 0x39972e0] mb P  I16..4:  5.2%  3.0%  0.1%  P16..4: 44.9%  4.0%  4.3%  0.0%  0.0%    skip:38.5%
[libx264 @ 0x39972e0] mb B  I16..4:  0.5%  0.2%  0.0%  B16..8: 23.1%  0.3%  0.0%  direct: 5.4%  skip:70.5%  L0:41.7% L1:58.1% BI: 0.3%
[libx264 @ 0x39972e0] 8x8 transform intra:34.9% inter:63.7%
[libx264 @ 0x39972e0] coded y,uvDC,uvAC intra: 12.3% 38.5% 11.2% inter: 3.4% 15.7% 1.8%
[libx264 @ 0x39972e0] i16 v,h,dc,p: 11% 53% 10% 25%
[libx264 @ 0x39972e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  7% 14% 75%  0%  1%  1%  1%  0%  2%
[libx264 @ 0x39972e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 28% 12%  6%  5%  5%  6%  5% 12%
[libx264 @ 0x39972e0] i8c dc,h,v,p: 55% 27% 14%  4%
[libx264 @ 0x39972e0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x39972e0] ref P L0: 63.4%  2.3% 22.2% 12.1%
[libx264 @ 0x39972e0] ref B L0: 78.7% 17.5%  3.8%
[libx264 @ 0x39972e0] ref B L1: 86.9% 13.1%
[libx264 @ 0x39972e0] kb/s:1795.65



More information about the ffmpeg-user mailing list