[FFmpeg-user] Using FFMpeg to produce LL-HLS

Simon Brown simon.k.brown at gmail.com
Tue Feb 18 13:47:06 EET 2020


On Tue, 18 Feb 2020 at 04:06, Gyan Doshi <ffmpeg at gyani.pro> wrote:

>
>
> On 17-02-2020 08:38 pm, Dennis Mungai wrote:
> > Hey there,
> >
> > Try this instead:
> >
> > ffmpeg.exe -i udp://127.0.0.1:9034 -codec copy -bsf:a aac_adtstoasc
> > -flags +global_header -f dash ^
> > -seg_duration 1 -frag_duration 0.1 -window_size 5 -extra_window_size 5
> > -single_file 0 -lhls 1 -hls_playlist 1 ^
> > -strict experimental -streaming 1 -adaptation_sets "id=0,streams=v
> > id=1,streams=a" c:\xampp\htdocs\video.m3u8
> >
> > Then report back.
> >
> > Btw I'd recommend re-encoding the content wherever possible. A fixed
> > GOP size combined with the -flags +cgop with an encoder such as
> > libx264 produces the best results.
> > The GOP size should ideally be a fraction of the segment length, eg 2
> > seconds. The codec neutral option -g 2 should set that for you.
>
> -g is in frames, so -g 50 for a 25 fps stream. Or you could use
> -force_key_frames
>
> Gyan
> _______________________________________________
>
> Thanks - I'm not re-encoding at the moment because I can't afford the CPU
time.  I'll tune the encoder that is generating the stream for a suitable
GOP size.

I've tried your options, Dennis and much the same result:

C:\ffmpeg-20200216-8578433-win64-static\bin>ffmpeg.exe -i udp://
127.0.0.1:9034 -codec copy -bsf:a aac_adtstoasc -flags +global_header -f
dash -seg_duration 1 -frag_duration 0.1 -window_size 5 -extra_window_size 5
-single_file 0 -lhls 1 -hls_playlist 1 -strict experimental -streaming 1
-adaptation_sets "id=0,streams=v id=1,streams=a" c:\\xampp\htdocs\video.m3u8
ffmpeg version git-2020-02-16-8578433 Copyright (c) 2000-2020 the FFmpeg
developers
  built with gcc 9.2.1 (GCC) 20200122
  configuration: --enable-gpl --enable-version3 --enable-sdl2
--enable-fontconfig --enable-gnutls --enable-iconv --enable-libass
--enable-libdav1d --enable-libbluray --enable-libfreetype
--enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy
--enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx
--enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265
--enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp
--enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc
--enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom
--enable-libmfx --enable-ffnvcodec --enable-cuvid --enable-d3d11va
--enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
--enable-libopenmpt --enable-amf
  libavutil      56. 41.100 / 56. 41.100
  libavcodec     58. 70.100 / 58. 70.100
  libavformat    58. 38.101 / 58. 38.101
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 76.100 /  7. 76.100
  libswscale      5.  6.100 /  5.  6.100
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
[h264 @ 0000018f6b0d1980] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0000018f6b0d1980] decode_slice_header error
[h264 @ 0000018f6b0d1980] no frame!
[h264 @ 0000018f6b0d1980] non-existing PPS 0 referenced
    Last message repeated 2 times
[h264 @ 0000018f6b0d1980] decode_slice_header error
[h264 @ 0000018f6b0d1980] no frame!
[h264 @ 0000018f6b0d1980] non-existing PPS 0 referenced
[h264 @ 0000018f6b0d1980] decode_slice_header error
[h264 @ 0000018f6b0d1980] no frame!
[h264 @ 0000018f6b0d1980] non-existing PPS 0 referenced
    Last message repeated 2 times
[h264 @ 0000018f6b0d1980] decode_slice_header error
[h264 @ 0000018f6b0d1980] no frame!
[h264 @ 0000018f6b0d1980] non-existing PPS 0 referenced
[h264 @ 0000018f6b0d1980] decode_slice_header error
[h264 @ 0000018f6b0d1980] no frame!
[h264 @ 0000018f6b0d1980] non-existing PPS 0 referenced
    Last message repeated 2 times
[h264 @ 0000018f6b0d1980] decode_slice_header error
[h264 @ 0000018f6b0d1980] no frame!
[h264 @ 0000018f6b0d1980] non-existing PPS 0 referenced
[h264 @ 0000018f6b0d1980] decode_slice_header error
[h264 @ 0000018f6b0d1980] no frame!
[h264 @ 0000018f6b0d1980] non-existing PPS 0 referenced
    Last message repeated 2 times
[h264 @ 0000018f6b0d1980] decode_slice_header error
[h264 @ 0000018f6b0d1980] no frame!
[h264 @ 0000018f6b0d1980] non-existing PPS 0 referenced
[h264 @ 0000018f6b0d1980] decode_slice_header error
[h264 @ 0000018f6b0d1980] no frame!
[h264 @ 0000018f6b0d1980] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0000018f6b0d1980] decode_slice_header error
[h264 @ 0000018f6b0d1980] no frame!
Input #0, mpegts, from 'udp://127.0.0.1:9034':
  Duration: N/A, start: 34730.859244, bitrate: N/A
  Program 1
    Stream #0:0[0x1100]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p(tv, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k
tbn, 50 tbc
    Stream #0:1[0x1110]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000
Hz, stereo, fltp, 48 kb/s
[dash @ 0000018f6e3eec80] No bit rate set for stream 0
[dash @ 0000018f6e3eec80] Opening 'init-stream0.m4s' for writing
[mp4 @ 0000018f6b0bac40] Could not find tag for codec h264 in stream #0,
codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?):
Invalid argument
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
    Last message repeated 1 times

Thanks,
Simon


More information about the ffmpeg-user mailing list