7

I've been working a couple of days on this issue. I need to set a stream up that streams audio and video (doesn't matter if I need to open separate connections for it, as long as it works) from the webcam that is connected to the Raspberry Pi. Now the video was easily solvable by using motion, but I'd rather use VLC for this. Now I have been looking into raspivid, but that only gives me errors about not being able to create certain folders and that there is nothing to play.

Another thing I tried was using FFmpeg. Executing something like this:

ffmpeg -f alsa -ac 1 -i hw:1 -ar 44100 -f flv rtmp://10.255.11.53/

only tells me that the version is deprecated and that 'alsa' is an unknown input..

Does anyone know how to either solve these problems, or a different/better way to reach my goal? Like I said, I don't mind opening 2 VLCs with one for audio and the other for video, as long as I get it working I'm fine.

EDIT: I changed the ffmpeg command to an avconv command, it does do something now, but returns a Connection Refused 111 error, haven't found a way to solve this yet

2
  • 'omxplayer' is default for Raspberry PI. It helped a lot for me when trying to play RTSP stream from live cameras where all other players failed. Give it a shot, it might just work for you too.
    – MVSR
    Commented Feb 17, 2015 at 12:50
  • ffmpeg packages for raspbian can be found at: johnvansickle.com/ffmpeg
    – le cuong
    Commented May 19, 2020 at 21:31

2 Answers 2

4

Do not use the package ffmpeg from the Raspbian repository apt-get - It's, as it says, obsolete. Who knows why its still there.

The only solution to stream to another VLC is to compile ffmpeg on your own, but on a Pi takes about 2 hours!

cd /usr/src
sudo git clone git://source.ffmpeg.org/ffmpeg.git
cd ffmpeg

On a Raspberry Pi 2 you run this to speed it a bit. (about 50%)

 ./configure && make -j4 && make -j4 install

On any other Raspberry run

 ./configure && make && make install

It would be better to stream using UDP since it uses less bandwidth and is latency ignorant (you might get a few artefacts though). Configure VLC on the listening machine as udp://@:1234

ffmpeg -f alsa -ac 1 -i hw:1 -ar 44100 -f mpegts udp://10.255.11.53:1234

For audio suggestions have a look herer


Alternatively, if you streaming to another Linux machine, then use gstreamer which can be installed from apt-get, but be warned, the pipelines are pretty complex.


Raspivid is only used for the CSI Camera, made by Raspberry Pi.

1

I had the same problem and spent some time searching for possible solutions.

You can use GStreamer for a very low-latency stream if you're fine with also using it on the receiving end. If you do not want GStreamer you can either use FFmpeg (as described above, allows you to combine both audio and video but needs to be compiled first) or VLC (open two separate streams). The easiest solution however appears to be the software Picam that supports http streaming or forwarding to a rtps server (easiest option: use node-rtsp-rtmp-server from the same author).

I've compiled all the ressources I've found into a separate blog post with detailed instructions on how to set both audio and video streams and recording up on a raspberry pi - hopefully this will save some time for others with the same questions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.