Adventures in linux video. A stream of conscience. - MAKLab/Moons-of-MAKLab GitHub Wiki
From what I can see the codec of the web cam seems to be what is the limiting factor. We may be able to find it with on the pi
v4l2-ctl --list-formats
Dont seem to be able to get vlc to work on pi. It does work on ubuntu, the cams is using YUYV. Could be hardware or codec not sure.
MJPG-Streamer seems like a good way to go.
Kieran
Euans ... Don’t really what to build apps they never build (at least I dont have much luck), so lets stay away from mjpg-streamer. If we can. https://wiki.videolan.org/Documentation:Modules/v4l2/ Run vlc. Its there lets install. Lets stream. cvlc to run on command prompt. https://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples/#Transcoding Type in vlc –vvv et more info. Talks about broken chains –Do we need to the hardware store? Does not work.
Ok lets face it vlc is not working very well.
Lets try something else. how about ffmeg. Is it on the pi/ no apt-get install does pull anything meaningful.
google pulls up this
oh rats http://www.jeffreythompson.org/blog/2014/11/13/installing-ffmpeg-for-raspberry-pi/ we are going to have to compile it . Might as well start with something that is suppose to work
Ok lets try build this mjpg-streamer.
http://blog.miguelgrinberg.com/post/how-to-build-and-run-mjpg-streamer-on-the-raspberry-pi
Step 1
works
Step 2
works This is going well
Step 3
Fails - Cannot write to ‘mjpg-streamer-code-182.zip.1’ (No space left on device)..... Hmm doubt full it has 16g on the disk. Lets see how big the disk is.
Lets try df -h
ok don’t really know what I am looking at.
Root is 100% full is that important.... probably not.
Lets ignore and find out were wget is saving
wget --help |less is giving me a lot of options. All I want to know is how to set the save path to the home folder.
Google wget
ok here http://www.thegeekstuff.com/2009/09/the-ultimate-wget-download-guide-with-15-awesome-examples/
Download Single File with wget The following example downloads a single file from internet and stores in the current directory. What is our current directory. Pwd - /home/pi??? Should be plenty.
http://www.cyberciti.biz/faq/check-free-space/ df /home/pi
output ….. Filesystem 1K-blocks Used Available Use% Mounted on /dev/root 3743376 3542972 0 100% /
ok sure enough. Why? put in ubuntu sd disk. Ok sure enough most of the space is unformatted. 12g. Use gparted to resize. Seems to have worked. Lets try again.
Step 3 worked Step 4 worked Step 5 ….the build... only one error “make: svnversion: Command not found” lets carry on Step 6 worked Step 7 need a camera ..Seems to work lets spend some money on a camera! Going to need a pi camera. – Raspistill is it really going to be that fast?
Next Day.. Brain wave maybe it is not the decoding that is causing the problems maybe it is the encoding the stream. Cvlc keeps on talking about broken chain? Lets look at all those optional packages.
Lets try apt-get install vlc. No just tells me it is there. Lets look at the help … there is a flag for suggested. --install-suggests No just tells me it is there again
ok give in. lets look for one of these codecs directly. X264
sudo apt-get install x264
“The following NEW packages will be installed x264”
That will do it, (this is ubuntu may not be there on the pi)
Run through the gui for vlc stream mp4. Turn of sound.
:sout=#transcode{vcodec=h264,scale=Auto,acodec=none}:http{mux=ffmpeg{mux=flv},dst=:8080/} :sout-keep oh oh. Ffmpeg, no Ffmpeg on the pi. Needs to be compiled. Try Ts --- what ever that is. Vlc says it is streaming. Lets look at it in a browser. http://localhost:8080/ “You have chosen to open a BIN file.” - well its progress. Lets open another instance of vlc. http://localhost:8080/ We are streaming! Admittedly from one instance of vlc to another on ubuntu, not a pi
Next up the pi
installed vlc on pi. install h264 its tere.
run vlc on the command line wit cvlc. cvlc v4l2:///dev/video0 --sout "#transcode{vcodec=h264,vb=800,scale=Auto,acodec=none}:http{mux=ts,dst=:8080}"
We are having to convert raw data to mpg this is likely to be heavy on the processor.
On the receiving end we get. [0x96aa438] main stream error: cannot pre fill buffer.
Try ogg.
cvlc v4l2:///dev/video0 --sout "#transcode{vcodec=theo,vb=800,scale=Auto,acodec=none}:http{mux=ogg,dst=:8080}" It works! all be it painfully slow. Lets see how we get on wit a better pi.