[libav-tools] capture and stream to rtmp from a single source?

Jeremy Hansen jeremy at skidrow.la
Thu Dec 12 05:10:51 CET 2013



On Dec 11, 2013, at 5:32 AM, Luca Barbato <lu_zero at gentoo.org> wrote:

> On 11/12/13 03:41, Jeremy Hansen wrote:
>> 
>> Right now I’m using avconv to capture video from a BlackMagic Design Mini Recorder PCIe card.  This is working great.  My next step is to trying to stream live to a rtmp server (Using nginx and the rtmp module).  
>> 
>> Here’s my current command line:
>> 
>> bmdcapture -C 0 -m 14 -V 3 -A 2 -F nut -f pipe:1 | \
>> avconv -y -i - -c:v libx264 -c:a aac -ar 44100 -strict experimental -s 640x360 -b:a 160k /pub/video/"$SHOW"_$TIME.mp4
>> 
>> What would I have to do to stream to rtmp as well?
>> 
> 
> Have a rtmp server somewhere (crtmpd is my current favourite) and
> replace /pub/video/"$SHOW"_$TIME.mp4 with rtmp://serverhost/app/path/

Understood, but I’m trying to write to both a file and a stream simultaneously.  

I have this working…meaning, it starts, but rapidly fails after a few moments.  Here’s my current command line:

bmdcapture -C 0 -m 14 -V 3 -A 2 -F nut -f pipe:1 | avconv -y -i - -copytb -c:v libx264 -c:a aac -ar 44100 -strict experimental -s 640x360 -b:a 160k /pub/video/"$SHOW"_$TIME.mp4 -f flv  -c:v libx264 -c:a aac -ar 22050 -strict experimental -s 384x216 -b:a 64k rtmp://live.mysite.com/myapp/video

But it fails after some moments with this error:

Stopping Capture 22 q=28.0 q=31.0 size= 5138kB time=62.48 bitrate= 673.6kbits/s
Failed to update header with correct duration.0kB time=62.96 bitrate= 672.7kbits/s 
[flv @ 0x248b7c0] Failed to update header with correct file size.

Any clues as to what this is?

Thanks
-jeremy

> (yes it is that simple)
> 
> lu
> _______________________________________________
> libav-tools mailing list
> libav-tools at libav.org
> https://lists.libav.org/mailman/listinfo/libav-tools



More information about the libav-tools mailing list