Page 1 of 2

Streaming with ffmpeg?

Posted: Wed Sep 12, 2012 12:38 pm
by M0DTS
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

Re: Streaming with ffmpeg?

Posted: Wed Sep 19, 2012 11:53 am
by G0MXW
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

Re: Streaming with ffmpeg?

Posted: Wed Sep 19, 2012 10:26 pm
by M0DTS
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

Re: Streaming with ffmpeg?

Posted: Mon Oct 08, 2012 7:34 pm
by G6GIF
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.

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 think you know about the Docs at http://www.ffmpeg.org

I hope this helps good luck Mike G6GIF/KD5PEX

Re: Streaming with ffmpeg?

Posted: Thu Oct 18, 2012 9:13 am
by G6GIF
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 :D )

Re: Streaming with ffmpeg?

Posted: Fri Oct 19, 2012 7:15 pm
by M0DTS
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

Re: Streaming with ffmpeg?

Posted: Sun Sep 02, 2018 3:41 am
by vk4ea
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

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"  
Hauppage video is /dev/video4, sound is hw:4

Error is ->

Code: Select all

rtmp://rtmp.batc.org.uk/live/streamname-crsmwm: Input/output error
Thanks in advance.

Re: Streaming with ffmpeg?

Posted: Sun Sep 02, 2018 10:08 am
by G8GKQ
Hi Peter

If I understand your quoting correctly, the problem is that "streamname" should be "vk4ea"

Dave

Re: Streaming with ffmpeg?

Posted: Sun Sep 02, 2018 8:15 pm
by vk4ea
Hi Dave,

Changed the stream name as suggested, same result.

Re: Streaming with ffmpeg?

Posted: Sun Sep 02, 2018 9:52 pm
by G8GKQ
Hi Peter

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
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