[FFmpeg-user] HLS-Stream via ffmpeg/Mediaserver to TV

Thomas Schmiedl thomas.schmiedl at web.de
Thu Apr 14 14:36:26 CEST 2016


I tried with this command on a linux pc:

ffmpeg-3.0.1-installation/bin/ffmpeg -i 
http://62.113.210.250/medienasa-live/_definst_/mp4:tvhalle_high/playlist.m3u8 
-acodec copy -vcodec copy -f mpeg -listen 1 http://192.168.178.27:8899

output:

ffmpeg version 3.0.1 Copyright (c) 2000-2016 the FFmpeg developers
   built with gcc 4.4.5 (Debian 4.4.5-8)
   configuration: --prefix=/home/user/ffmpeg-3.0.1-installation
   libavutil      55. 17.103 / 55. 17.103
   libavcodec     57. 24.102 / 57. 24.102
   libavformat    57. 25.100 / 57. 25.100
   libavdevice    57.  0.101 / 57.  0.101
   libavfilter     6. 31.100 /  6. 31.100
   libswscale      4.  0.100 /  4.  0.100
   libswresample   2.  0.101 /  2.  0.101
Input #0, hls,applehttp, from 
'http://62.113.210.250/medienasa-live/_definst_/mp4:tvhalle_high/playlist.m3u8':
   Duration: N/A, start: 812.762000, bitrate: N/A
   Program 0
     Metadata:
       variant_bitrate : 1925436
     Stream #0:0: Video: h264 (Baseline) ([27][0][0][0] / 0x001B), 
yuv420p(tv), 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
     Metadata:
       variant_bitrate : 1925436
     Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, 
stereo, fltp, 280 kb/s
     Metadata:
       variant_bitrate : 1925436
[mpeg @ 0xa92e3c0] VBV buffer size not set, using default size of 130KB
If you want the mpeg file to be compliant to some specification
Like DVD, VCD or others, make sure you set the correct buffer size
Output #0, mpeg, to 'http://192.168.178.27:8899':
   Metadata:
     encoder         : Lavf57.25.100
     Stream #0:0: Video: h264 ([27][0][0][0] / 0x001B), yuv420p, 
1280x720 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 90k tbn, 25 tbc
     Metadata:
       variant_bitrate : 1925436
     Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, 
stereo, 280 kb/s
     Metadata:
       variant_bitrate : 1925436
Stream mapping:
   Stream #0:0 -> #0:0 (copy)
   Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help

The stream plays on the TV, but without audio. When I stop the stream on 
the TV, ffmpeg exits with:

[http @ 0xa84e780] Stream ends prematurely at 472320, should be 
17066643.3kbits/s speed= 1.6x
skipping 4 segments ahead, expired from playlists
[mpegts @ 0xa84d940] PES packet size mismatch
av_interleaved_write_frame(): Broken pipeB time=00:01:40.75 bitrate= 
861.0kbits/s speed=3.31x
Error writing trailer of http://192.168.178.27:8899: Broken pipeframe= 
1286 fps= 42 q=-1.0 Lsize=   10690kB time=00:01:40.80 bitrate= 
868.8kbits/s speed= 3.3x
video:9399kB audio:1222kB subtitle:0kB other streams:0kB global 
headers:0kB muxing overhead: 0.648537%
Conversion failed!

What I need to add in the command for audio output and that ffmpeg does 
not exit. DLNA-server is mediatomb.

Thomas

Am 12.04.2016 um 16:27 schrieb Moritz Barsnick:
> On Sun, Apr 10, 2016 at 17:08:42 +0200, Thomas Schmiedl wrote:
>> I try to receive this HLS-stream:
>> http://62.113.210.250/medienasa-live/_definst_/mp4:tvhalle_high/playlist.m3u8
>> on my router (Fritzbox 7312; MIPS-based) via a mediaserver (e.g.
>> Mediatomb) and transfer the stream to my DLNA-TV (Panasonic).
>>
>> The TV doesn't play the .m3u8 directly ("file not readable"). My idea is
>> to process the .m3u8 in ffmpeg (without transcoding), which sends the
>> stream to a network socket, the mediaserver reads from this socket and
>> transfers the stream to my TV.
>
> Isn't mediatomb itself capable of sourcing from HLS URLs? I don't
> remember. (I may be confusing it with Universal Media Server.)
>
> What sort of socket are you thinking of? Is the mediaserver listening
> on a socket of its own? Is it connecting to another server's socket?
> What protocol does it expect? (Pure TCP/UDP, or HTTP? RTMP, RTSP?) What
> container types will it accept?
>
> Anyway: ffmpeg can host its own listening socket, e.g.:
> $ ffmpeg -f lavfi -i testsrc2 -c:v libx264 -f matroska -listen 1 tcp://localhost:1234
> $ ffmpeg -f lavfi -i testsrc2 -c:v libx264 -f matroska -listen 1 http://localhost:8899
> ffmpeg can send to another host's socket, e.g.:
> $ ffmpeg -f lavfi -i testsrc2 -c:v libx264 -f mpegts udp://otherhost:2222
>
>> Could someone help me to realize this? I'm not an expert in this issue.
>
> You need to be more precise in terms of what your environment needs.
> One of those three examples could work, but what do we know. ffmpeg
> can't host DLNA by itself though AFAIK, but that's what you have
> mediatomb for.
>
> 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