Streaming with ffmpeg?
Forum rules
This forum is run by the BATC (British Amateur Television Club), it is service made freely available to all interested parties, please do not abuse this privilege.
Thank you
This forum is run by the BATC (British Amateur Television Club), it is service made freely available to all interested parties, please do not abuse this privilege.
Thank you
Streaming with ffmpeg?
Hi All..
Has anyone tried streaming to batc with ffmpeg or have any ideas how to do it?
It appears to function but no stream seen on batc as if i have missed some commands like the extra stream name in Adobe media encoder..
example command line which appears to connect but no video shows on the batc stream...
ffmpeg -i test.avi -acodec libmp3lame -vcodec libx264 -b 300k -vf scale=iw/2:-1 -f flv "rtmp://fms.***********************/streamname"
I would like to change my streaming pc to linux to do more things with the RTL2832 dongle for beacon monitoring etc but need streaming capability to make this possible.
Any ideas appreciated!
Rob
M0DTS
Has anyone tried streaming to batc with ffmpeg or have any ideas how to do it?
It appears to function but no stream seen on batc as if i have missed some commands like the extra stream name in Adobe media encoder..
example command line which appears to connect but no video shows on the batc stream...
ffmpeg -i test.avi -acodec libmp3lame -vcodec libx264 -b 300k -vf scale=iw/2:-1 -f flv "rtmp://fms.***********************/streamname"
I would like to change my streaming pc to linux to do more things with the RTL2832 dongle for beacon monitoring etc but need streaming capability to make this possible.
Any ideas appreciated!
Rob
M0DTS
Re: Streaming with ffmpeg?
Rob,
You are spot on about the extra stream name in Adobe encoder.
For ffmpeg append the Stream name to the FMS URL
"rtmp://fms.XXXX.XX/XXXX/XXXXX/<stream name>"
Rest of your ffmpeg command line is ok. You may have to pig around with block size and fps settings but will get you going.
Trying same thing here with RTL dongle but struggling with dropped frames at the moment, prob due to under powered Linux box and ffmpeg not coping with non constant bit rate stream I'm trying to sort out.
Dave
G0MXW
You are spot on about the extra stream name in Adobe encoder.
For ffmpeg append the Stream name to the FMS URL
"rtmp://fms.XXXX.XX/XXXX/XXXXX/<stream name>"
Rest of your ffmpeg command line is ok. You may have to pig around with block size and fps settings but will get you going.
Trying same thing here with RTL dongle but struggling with dropped frames at the moment, prob due to under powered Linux box and ffmpeg not coping with non constant bit rate stream I'm trying to sort out.
Dave
G0MXW
Re: Streaming with ffmpeg?
AHA!
Thanks Dave, that must have been the only combination of things i have not tried...hi
Playback from a file is fine, will now try get live stream to work.
Cheers,
Rob
M0DTS
Thanks Dave, that must have been the only combination of things i have not tried...hi
Playback from a file is fine, will now try get live stream to work.
Cheers,
Rob
M0DTS
Re: Streaming with ffmpeg?
Hi
I've had good luck streaming with FFMPEG and I was going to do a write up for Chris then decided to wait for the latest update to http://www.ws4gl.org as it was the commands published here that gave me clues, Patrick has been busy but I can confirm that Webcamstudio 0.57b4 will stream to BATC.tv but the JVM is quite processor intensive so if you just need the streaming with no mixing or effects you are better off just using FFMPEG from the CLI.
Make sure you have a very recent build of FFMPEG the unstripped version from Medibuntu works fine if you are Ubuntu based or an equivalent for your distro then adjust your settings to suit, once I got it figured out it worked without problems but I haven't tried VBR.
I think you know about the Docs at http://www.ffmpeg.org
I hope this helps good luck Mike G6GIF/KD5PEX
I've had good luck streaming with FFMPEG and I was going to do a write up for Chris then decided to wait for the latest update to http://www.ws4gl.org as it was the commands published here that gave me clues, Patrick has been busy but I can confirm that Webcamstudio 0.57b4 will stream to BATC.tv but the JVM is quite processor intensive so if you just need the streaming with no mixing or effects you are better off just using FFMPEG from the CLI.
Make sure you have a very recent build of FFMPEG the unstripped version from Medibuntu works fine if you are Ubuntu based or an equivalent for your distro then adjust your settings to suit, once I got it figured out it worked without problems but I haven't tried VBR.
Code: Select all
ffmpeg -f video4linux2 -i /dev/video1 -f alsa -i pulse -acodec libmp3lame -ac 1 -ab 64kb -ar 22050 -f flv -s 480x360 -r 15 -b 256kb "rtmp://fms.batc.tv/live/************/********** flashver=FMLE/3.0\20(compatible;\20FMSc/1.0)"
I hope this helps good luck Mike G6GIF/KD5PEX
Re: Streaming with ffmpeg?
I'd like to correct myself on the subject of FFMPEG and lib3lame versions, I'm using FFMPEG from Jon Severinssons PPA https://launchpad.net/~jon-severinsson/+archive/ffmpeg and I'm using libmp3lame 3.99.3+repack1-1 from the ubuntu dev team.
I can confirm these are working in Ubuntu 12.04 for streaming to BATC.tv using the command string in my previous post, sometimes its a problem remembering what is installed in each computer in the shack ( actually all the time when you get to my age )
I can confirm these are working in Ubuntu 12.04 for streaming to BATC.tv using the command string in my previous post, sometimes its a problem remembering what is installed in each computer in the shack ( actually all the time when you get to my age )
Re: Streaming with ffmpeg?
Thanks for the info,
GB3KM stream from my qth is now being sent with ffmpeg and similar settings to above using PVR-USB2 capture device as used on the Digilite.
I did have trouble with encoding when we dropped carrier and the encoder just saw noise, it did not like it and upped the stream bit-rate considerabley causing stuttering with my 1024kbps uplink! The fix for this was to use: -maxrate and -bufsize settings to limit the output bandwidth of the stream when trying to encode noise - basically CBR.
I just have to fix the lack of chroma sensitivity on the PVR-USB2 now to get some colour back on the stream!
Rob
M0DTS
GB3KM stream from my qth is now being sent with ffmpeg and similar settings to above using PVR-USB2 capture device as used on the Digilite.
I did have trouble with encoding when we dropped carrier and the encoder just saw noise, it did not like it and upped the stream bit-rate considerabley causing stuttering with my 1024kbps uplink! The fix for this was to use: -maxrate and -bufsize settings to limit the output bandwidth of the stream when trying to encode noise - basically CBR.
I just have to fix the lack of chroma sensitivity on the PVR-USB2 now to get some colour back on the stream!
Rob
M0DTS
Re: Streaming with ffmpeg?
Gidday from VK land,
I am struggling to get ffmpeg streaming to the BATC streamer.
I have got the Hauppage Live 2 working nicely with ffplay, so presumably there is no driver issues and all v4l2 utils and associated libraries are up to date. System is Ubuntu 17.04.
Command I am using is
Hauppage video is /dev/video4, sound is hw:4
Error is ->
Thanks in advance.
I am struggling to get ffmpeg streaming to the BATC streamer.
I have got the Hauppage Live 2 working nicely with ffplay, so presumably there is no driver issues and all v4l2 utils and associated libraries are up to date. System is Ubuntu 17.04.
Command I am using is
Code: Select all
ffmpeg -f video4linux2 -i /dev/video4 -f alsa -i hw:4 -acodec libmp3lame -ac 1 -ab 64kb -ar 22050 -f flv -s 480x360 -r 15 -b:v 256kb "rtmp://rtmp.batc.org.uk/live/streamname-crsmwm"
Error is ->
Code: Select all
rtmp://rtmp.batc.org.uk/live/streamname-crsmwm: Input/output error
Cheers,
Peter - VK4EA
Peter - VK4EA
Re: Streaming with ffmpeg?
Hi Peter
If I understand your quoting correctly, the problem is that "streamname" should be "vk4ea"
Dave
If I understand your quoting correctly, the problem is that "streamname" should be "vk4ea"
Dave
Re: Streaming with ffmpeg?
Hi Dave,
Changed the stream name as suggested, same result.
Changed the stream name as suggested, same result.
Cheers,
Peter - VK4EA
Peter - VK4EA
Re: Streaming with ffmpeg?
Hi Peter
The code that the Portsdown uses (with variables to define the parameters) is:
The obvious difference that I can see is that the ffmpeg command is in a different order (which does matter) and that the URL is not in quotes. The order that seems to work is to define the video input and format, define the audio input and format, define the video encoding, define the audio encoding, add any video filters, then define the output encapsulation and destination.
Hope that helps
Dave
The code that the Portsdown uses (with variables to define the parameters) is:
Code: Select all
$PATHRPI"/ffmpeg" -loglevel $MODE_DEBUG -thread_queue_size 2048\
-f v4l2 -video_size "$VIDEO_WIDTH"x"$VIDEO_HEIGHT" \
-i $VID_USB \
-f alsa -ac $AUDIO_CHANNELS -ar $AUDIO_SAMPLE \
-i hw:$AUDIO_CARD_NUMBER,0 \
-framerate 25 -c:v h264_omx -b:v 512k \
-ar 22050 -ac $AUDIO_CHANNELS -ab 64k \
-vf "$CAPTION""$SCALE"yadif=0:1:0 -g 25 \
-f flv $STREAM_URL/$STREAM_KEY
Hope that helps
Dave