[FFmpeg-user] No luck with live stream from ffmpeg to ffserver

Roger Pack rogerdpack2 at gmail.com
Wed May 6 12:49:06 CEST 2015


On 5/4/15, En Figureo Canal <figureo56.com at gmail.com> wrote:
> Thanks W Jansen for replying.
>
> I've done what you requested, I would like to do a live stream from my pc
> to our network. My PC has a video capture card and would like to send the
> feed to a server in our LAN so, others can watch certain  videos during a
> seminar.

I don't have too much experience with broadcast.  perhaps udp
multicast broadcast (examples bottom of this page) but don't know if
that's appropriate/would work for you.

https://trac.ffmpeg.org/wiki/StreamingGuide

That's only if low latency is your goal, dunno about stability.
GL!

>> Splitting the commandline.
>>
>> Reading option '-v' ... matched as option 'v' (set logging level) with
>>> argument 'debug'.
>>
>> Reading option '-i' ... matched as input file with argument
>>> 'videos/david-diaz.mp4'.
>>
>> Reading option '-vcodec' ... matched as option 'vcodec' (force video codec
>>> ('copy' to copy stream)) with argument 'copy'.
>>
>> Reading option '-bsf:v' ... matched as option 'bsf' (A comma-separated
>>> list of bitstream filters) with argument 'h264_mp4toannexb'.
>>
>> Reading option '-acodec' ... matched as option 'acodec' (force audio codec
>>> ('copy' to copy stream)) with argument 'copy'.
>>
>> Reading option '-override_ffserver' ... matched as option
>>> 'override_ffserver' (override the options from ffserver) with argument
>>> '1'.
>>
>> Reading option '-f' ... matched as option 'f' (force format) with argument
>>> 'mpegts'.
>>
>> Reading option 'http://172.16.0.3:8090/channel2.ffm' ... matched as
>>> output file.
>>
>> Finished splitting the commandline.
>>
>> Parsing a group of options: global .
>>
>> Applying option v (set logging level) with argument debug.
>>
>> Applying option override_ffserver (override the options from ffserver)
>>> with argument 1.
>>
>> Successfully parsed a group of options.
>>
>> Parsing a group of options: input file videos/david-diaz.mp4.
>>
>> Successfully parsed a group of options.
>>
>> Opening an input file: videos/david-diaz.mp4.
>>
>> [mov,mp4,m4a,3gp,3g2,mj2 @ 0xacb99c0] Format mov,mp4,m4a,3gp,3g2,mj2
>>> probed with size=2048 and score=100
>>
>> [mov,mp4,m4a,3gp,3g2,mj2 @ 0xacb99c0] ISO: File Type Major Brand: M4V
>>
>> [mov,mp4,m4a,3gp,3g2,mj2 @ 0xacb99c0] Before avformat_find_stream_info()
>>> pos: 53738 bytes read:65536 seeks:0
>>
>> [mov,mp4,m4a,3gp,3g2,mj2 @ 0xacb99c0] All info found
>>
>> [mov,mp4,m4a,3gp,3g2,mj2 @ 0xacb99c0] After avformat_find_stream_info()
>>> pos: 366677 bytes read:373112 seeks:0 frames:11
>>
>> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'videos/david-diaz.mp4':
>>
>>   Metadata:
>>
>>     major_brand     : M4V
>>
>>     minor_version   : 1
>>
>>     compatible_brands: M4V mp42isom
>>
>>     creation_time   : 2014-05-01 02:41:00
>>
>>   Duration: 00:02:08.38, start: 0.000000, bitrate: 4153 kb/s
>>
>>     Stream #0:0(eng), 10, 1/24000: Video: h264 (Baseline), 2 reference
>>> frames (avc1 / 0x31637661), yuv420p(tv, left), 1280x720 [SAR 1:1 DAR
>>> 16:9],
>>> 1001/48000, 3994 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
>>
>>     Metadata:
>>
>>       creation_time   : 2014-05-01 02:41:00
>>
>>       handler_name    : Mainconcept MP4 Video Media Handler
>>
>>       encoder         : AVC Coding
>>
>>     Stream #0:1(eng), 1, 1/48000: Audio: aac (LC) (mp4a / 0x6134706D),
>>> 48000 Hz, stereo, fltp, 157 kb/s (default)
>>
>>     Metadata:
>>
>>       creation_time   : 2014-05-01 02:41:00
>>
>>       handler_name    : Mainconcept MP4 Sound Media Handler
>>
>> Successfully opened the file.
>>
>> Parsing a group of options: output file
>>> http://172.16.0.3:8090/channel2.ffm.
>>
>> Applying option vcodec (force video codec ('copy' to copy stream)) with
>>> argument copy.
>>
>> Applying option bsf:v (A comma-separated list of bitstream filters) with
>>> argument h264_mp4toannexb.
>>
>> Applying option acodec (force audio codec ('copy' to copy stream)) with
>>> argument copy.
>>
>> Applying option f (force format) with argument mpegts.
>>
>> Successfully parsed a group of options.
>>
>> Opening an output file: http://172.16.0.3:8090/channel2.ffm.
>>
>> Using network protocols without global network initialization. Please use
>>> avformat_network_init(), this will become mandatory later.
>>
>>     Last message repeated 1 times
>>
>> [http @ 0xae878c0] request: POST /channel2.ffm HTTP/1.1
>>
>> Transfer-Encoding: chunked
>>
>> User-Agent: Lavf/56.31.100
>>
>> Accept: */*
>>
>> Connection: close
>>
>> Host: 172.16.0.3:8090
>>
>> Icy-MetaData: 1
>>
>>
>>>
>>> Successfully opened the file.
>>
>> [mpegts @ 0xae864c0] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt
>>> every 40 pkts
>>
>> Output #0, mpegts, to 'http://172.16.0.3:8090/channel2.ffm':
>>
>>   Metadata:
>>
>>     major_brand     : M4V
>>
>>     minor_version   : 1
>>
>>     compatible_brands: M4V mp42isom
>>
>>     encoder         : Lavf56.31.100
>>
>>     Stream #0:0(eng), 0, 1/90000: Video: h264, 1 reference frame (avc1 /
>>> 0x31637661), yuv420p(left), 1280x720 (0x0) [SAR 1:1 DAR 16:9],
>>> 1001/24000,
>>> q=2-31, 3994 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 23.98 tbc (default)
>>
>>     Metadata:
>>
>>       creation_time   : 2014-05-01 02:41:00
>>
>>       handler_name    : Mainconcept MP4 Video Media Handler
>>
>>       encoder         : AVC Coding
>>
>>     Stream #0:1(eng), 0, 1/90000: Audio: aac (mp4a / 0x6134706D), 48000
>>> Hz, stereo, 157 kb/s (default)
>>
>>     Metadata:
>>
>>       creation_time   : 2014-05-01 02:41:00
>>
>>       handler_name    : Mainconcept MP4 Sound Media Handler
>>
>> Stream mapping:
>>
>>   Stream #0:0 -> #0:0 (copy)
>>
>>   Stream #0:1 -> #0:1 (copy)
>>
>> Press [q] to stop, [?] for help
>>
>> av_interleaved_write_frame(): Connection reset by peer
>>
>> No more output streams to write to, finishing.
>>
>> frame=   10 fps=0.0 q=-1.0 Lsize=     165kB time=00:00:00.41
>>> bitrate=3238.1kbits/s
>>
>> video:305kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
>>> muxing overhead: unknown
>>
>> Input file #0 (videos/david-diaz.mp4):
>>
>>   Input stream #0:0 (video): 10 packets read (312519 bytes);
>>
>>   Input stream #0:1 (audio): 1 packets read (420 bytes);
>>
>>   Total: 11 packets (312939 bytes) demuxed
>>
>> Output file #0 (http://172.16.0.3:8090/channel2.ffm):
>>
>>   Output stream #0:0 (video): 10 packets muxed (312555 bytes);
>>
>>   Output stream #0:1 (audio): 1 packets muxed (420 bytes);
>>
>>   Total: 11 packets (312975 bytes) muxed
>>
>> 0 frames successfully decoded, 0 decoding errors
>>
>> [AVIOContext @ 0xb06bf20] Statistics: 0 seeks, 7 writeouts
>>
>> [AVIOContext @ 0xacc1f60] Statistics: 373112 bytes read, 0 seeks
>>
>> Conversion failed!
>>
>>
>>
> Thanks again for replying.
>
>
> On Mon, May 4, 2015 at 3:09 AM, W Jansen <widojansen at gmail.com> wrote:
>
>> On Sun, May 3, 2015 at 9:47 PM, En Figureo Canal <figureo56.com at gmail.com>
>> wrote:
>>
>> > Can someone please guide me to get this working.
>> >
>> > I can easily stream to rtmp server: ustream and even nginx but can't
>> really
>> > feed ffserver and get
>> >
>> > av_interleaved_write_frame(): Unknown error
>> >
>> >
>> > and have run out of patience trying to get this working. I'll really
>> > appreciate if someone can please help me out with this problem.
>> >
>> > Thanks in advanced for your time.
>> >
>> > On Sat, May 2, 2015 at 6:50 PM, En Figureo Canal <
>> figureo56.com at gmail.com>
>> > wrote:
>> >
>> > > I haven’t had much luck deploying ffserver, nothing works out for me
>> > > streaming live from ffmpeg to ffserver. Had different problems, I
>> > > don’t
>> > > know if my configuration is correct but, can’t really get ffsever to
>> > > do
>> > > what I need and things are just frustrating me.
>> > >
>> > > The last error message I’m getting is av_interleaved_write_frame():
>> > > Unknown error along with Past duration too large. I’ve read somewhere
>> > > saying that it might be incompatible versions of ffmpeg, which I found
>> > odd
>> > > and stupid.
>> > >
>> > > I believed ffmpeg should work with any current version.
>> > >
>> > > First, I’m trying to do a live stream using a capture card I’ve
>> installed
>> > > and/or using VidBlaster but, haven’t been able. Audio can be done
>> easily
>> > > but not Video.
>> > >
>> > > Here’s my ffmpeg conf:
>> > >
>> > >
>> > > <Feed channel2.ffm>
>> > >>         File /root/channel2.ffm
>> > >>         FileMaxSize 64M
>> > >> </Feed>
>> > >>
>> > >> <Stream channel2.sdp>
>> > >>         Feed channel2.ffm
>> > >>
>> > >>         Format rtp
>> > >>
>> > >>         VideoCodec libx264
>> > >> #       VideoFrameRate 30
>> > >> #       VideoSize 640x360
>> > >>         VideoBitRate 1000
>> > >>
>> > >>         # Audio settings
>> > >>         AudioCodec libmp3lame #libfdk_aac
>> > >>         AudioSampleRate 41000
>> > >>         AudioBitRate 96
>> > >>         AudioChannels 2 #this is creating problem
>> > >>  #      AVOptionAudio flags +global_header
>> > >>
>> > >>         MaxTime 0
>> > >>         AVOptionVideo me_range 16
>> > >>         AVOptionVideo qdiff 4
>> > >>         AVOptionVideo qmin 4
>> > >>         AVOptionVideo qmax 40
>> > >>         #AVOptionVideo good
>> > >> #       AVOptionVideo flags +global_header
>> > >>
>> > >>         # Streaming settings
>> > >>         PreRoll 10
>> > >>         StartSendOnKey
>> > >>
>> > >> NoDefaults
>> > >>
>> > >> </Stream>
>> > >
>> > >
>> > > When I send the feed to the server I get the previous mentioned error.
>> > > What exactly am I doing wrong? I’ve tried different combinations to
>> send
>> > > the feed but nothing works, this is the last conf to send to the
>> server:
>> > >
>> > >
>> > >
>> > > Ffmpeg –re –rtbufsize 1500M –f dshow –I video=”input”:audio=”input”
>> > > –acodec libmp3lame –ar 44100 –ab 96k –vcodec libx264 –f flv
>> > > http://ip:8090/channel2.ffm
>> > >
>> > >
>> > > I've even tried feeding a video from my pc to the server, and still no
>> > > luck.
>> > >
>> > >
>> > > Please guide me to the correct path to get this working, thanks.
>> > >
>> > _______________________________________________
>> > ffmpeg-user mailing list
>> > ffmpeg-user at ffmpeg.org
>> > http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>> >
>>
>> Hi,
>>
>> My suggestion would be a minimum ffserver config and put all transcode
>> parameters in ffmpeg with -override_ffserver.
>> That way it is easier to find out what goes wrong while ffserver keeps
>> running.
>>
>> I assume your input stream is ok as you say you stream to other servers.
>> Otherwise test with 'ffprobe <input stream>'.
>>
>> Setup ffserver.conf like this:
>> HTTPPort xxxxx
>> HTTPBindAddress 0.0.0.0
>>
>> <Feed channel2.ffm>
>> File /tmp/channel2.ffm
>> FileMaxSize 64M
>> </Feed>
>>
>> <Stream channel.ts>
>> Feed channel2.ffm
>> </Feed>
>>
>> <Stream status,html>
>> Format status
>> </Stream>
>>
>> Run ffserver in daemon mode and see what is going on on the status page
>> <serverip:port/status.html>
>>
>> Then start to feed it with ffmpeg command like
>>
>> ffmpeg -v debug -i <input stream> -c:v copy -c:a copy -override_ffserver
>> -f
>> mpegts <ffserver ip:port/channel2.ffm>
>>
>> You can easily change the transcode settings. I am not sure what you want
>> to do.
>> From your previous email I assume your input is RTMP and you want change
>> it
>> to RTSP. My example has a MPEG-TS output.
>>
>> This way you isolate what goes wrong. FFserver keeps running and ffmpeg
>> will give you some clue.
>>
>> Wido
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>


More information about the ffmpeg-user mailing list