[FFmpeg-user] Sending a UDP stream out via HLS

Simon Brown simon.k.brown at gmail.com
Mon Apr 10 19:50:53 EEST 2017


Hi,
I can take an MP4 file and stream it out using FFMpeg as HLS.  This works
well.
What I want is to take a stream that is coming into my computer and I want
to send it out as HLS.

The working command for the MP4 file is:
ffmpeg -i sintel.mp4 -f hls -hls_time 2 -hls_list_size 5 -vcodec copy
-acodec copy sintel.m3u8

and it works just fine.
if I change it to:
ffmpeg -i udp://@65111 -f hls -hls_time 2 -hls_list_size 5 -vcodec copy
-acodec copy browser.m3u8

I get a browser.m3u8 file and browser0.ts
However, browser0.ts doesn't change to browser1.ts at any stage and just
keeps growing.  The status information as it's doing this shows speed as
1.0x (or slightly above), but I'd expect that given that the stream coming
in is in real time.  If I press 'q' to quit it then tells me that it copied
0kb of video but eg 162kb of audio.  And the resultant browser0.ts does
indeed just have audio packets in it (and some TS control packets).

What am I doing wrong?

Output from ffmpeg is:
Input #0, mpegts, from 'udp://@:65111':
  Duration: N/A, start: 16818.048833, bitrate: N/A
  Program 1
    Stream #0:0[0x1100]: Video: h264 (Main), 1 reference frame
([27][0][0][0] / 0x001B), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 59.94 fps,
60 tbr, 90k tbn, 119.88 tbc
    Stream #0:1[0x1110]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000
Hz, stereo, fltp, 109 kb/s
[hls @ 0x11623c0] Using AVStream.codec to pass codec parameters to muxers
is deprecated, use AVStream.codecpar instead.
    Last message repeated 1 times
[mpegts @ 0xc27c10] muxrate VBR, pcr every 5 pkts, sdt every 2147483647,
pat/pmt every 2147483647 pkts
Output #0, hls, to 'browser.m3u8':
  Metadata:
    encoder         : Lavf57.49.100
    Stream #0:0: Video: h264 (Main), 1 reference frame ([27][0][0][0] /
0x001B), yuv420p, 1280x720 (0x0) [SAR 1:1 DAR 16:9], q=2-31, 59.94 fps, 60
tbr, 90k tbn, 59.94 tbc
    Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz,
stereo, 109 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[hls @ 0x11623c0] EXT-X-MEDIA-SEQUENCE:0=00:00:23.63 bitrate=N/A speed=1.27x
frame=    0 fps=0.0 q=-1.0 Lsize=N/A time=00:00:23.91 bitrate=N/A
speed=1.27x
video:0kB audio:336kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: unknown
Input file #0 (udp://@:65111):
  Input stream #0:0 (video): 1432 packets read (14115198 bytes);
  Input stream #0:1 (audio): 1121 packets read (344521 bytes);
  Total: 2553 packets (14459719 bytes) demuxed
Output file #0 (browser.m3u8):
  Output stream #0:0 (video): 0 packets muxed (0 bytes);
  Output stream #0:1 (audio): 1121 packets muxed (344521 bytes);
  Total: 1121 packets (344521 bytes) muxed

Any clues gratefully received,
Regards,
Simon


More information about the ffmpeg-user mailing list