LeoWhite
Posts: 131
Joined: Mon Apr 08, 2013 9:20 am
Contact: Website

Re: Using VLC to stream from the camera - Help needed

Wed May 22, 2013 8:06 am

wallarug wrote:no luck there either.

here is what I put into the command line:

Code: Select all

raspivid -o - -t 99999999 |cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/}' :demux=h264
Hmm that should work. Is VLC failing to run, or is it just the client failing to connect?

In your previous post you were setting up a http output, do you get any different results with that configuration?

Leo

User avatar
wallarug
Posts: 460
Joined: Mon May 14, 2012 8:21 am
Location: Sydney, Australia

Re: Using VLC to stream from the camera - Help needed

Wed May 22, 2013 8:10 am

Same result:

Code: Select all

[0x1d63a08] main playlist debug: changing item without a request (current 0/1)
[0x1d63a08] main playlist debug: nothing to play
...with both http and rtsp

is there some other package that I should have installed? I am running this on pwnpi3 (which seems ok since it is just raspbain with loads more software).

I think I might have changed something in config.txt

I am investigating that now.

PS: using copied commands from: http://www.mybigideas.co.uk/RPi/RPiCamera/


EDIT: Now when I try to open just raspivid it gives off this error:

Code: Select all

pi@pwnpi:~$ raspivid -t 10000
* failed to open vchiq instance


EDIT2:

I think I worked it out.

I created a user called 'pi' on the pwnpi OS. I don't think this user has any privlages. That is why it can't access the camera and the 'root' user can.

I was running vlc under the 'pi' user with no camera privlages. hence why there was no video stream. Is there any way I can give 'pi' more privlages?
Last edited by wallarug on Wed May 22, 2013 8:18 am, edited 1 time in total.

LeoWhite
Posts: 131
Joined: Mon Apr 08, 2013 9:20 am
Contact: Website

Re: Using VLC to stream from the camera - Help needed

Wed May 22, 2013 8:18 am

wallarug wrote:Same result:

Code: Select all

[0x1d63a08] main playlist debug: changing item without a request (current 0/1)
[0x1d63a08] main playlist debug: nothing to play
...with both http and rtsp
Certainly looks like its not getting any input to process
wallarug wrote:
is there some other package that I should have installed? I am running this on pwnpi3 (which seems ok since it is just raspbain with loads more software).
Not that I'm aware of.

wallarug wrote:EDIT: Now when I try to open just raspivid it gives off this error:

Code: Select all

pi@pwnpi:~$ raspivid -t 10000
* failed to open vchiq instance
Hmm, do you have a monitor connected to the RPi? I did see mention in another forum post that if you don't then the preview window may fail to open and then cause problems (Although mine is running with out a display attached)

One thing to do is narrow down where the problem is. its worth checking that raspivid is actually generating a video file. running something like

Code: Select all

raspivid -o - -t 10000 > test.h264
Should generate a 10 second video that you can play back in VLC to validate video is being output correctly.

Leo

User avatar
wallarug
Posts: 460
Joined: Mon May 14, 2012 8:21 am
Location: Sydney, Australia

Re: Using VLC to stream from the camera - Help needed

Wed May 22, 2013 8:21 am

You might have missed this one... or be reading it now :lol:
EDIT2:

I think I worked it out.

I created a user called 'pi' on the pwnpi OS. I don't think this user has any privlages. That is why it can't access the camera and the 'root' user can.

I was running vlc under the 'pi' user with no camera privlages. hence why there was no video stream. Is there any way I can give 'pi' more privlages?

User avatar
wallarug
Posts: 460
Joined: Mon May 14, 2012 8:21 am
Location: Sydney, Australia

Re: Using VLC to stream from the camera - Help needed

Wed May 22, 2013 8:39 am

That wasn't to hard:

I fixed the raspivid so it now works for user 'pi'

Code: Select all

sudo chmod 777 /dev/vchiq
moving onto video stream now.

User avatar
wallarug
Posts: 460
Joined: Mon May 14, 2012 8:21 am
Location: Sydney, Australia

Re: Using VLC to stream from the camera - Help needed

Wed May 22, 2013 8:43 am

vlc (running on PC) does not want to open the stream... :( :( :( :(

LeoWhite
Posts: 131
Joined: Mon Apr 08, 2013 9:20 am
Contact: Website

Re: Using VLC to stream from the camera - Help needed

Wed May 22, 2013 8:57 am

wallarug wrote:vlc (running on PC) does not want to open the stream... :( :( :( :(
Once VLC has run out of video to stream I suspect its closing the network connection.

Does the raspicam preview window open up on the HDMI output to confirm that video is being captured?

User avatar
wallarug
Posts: 460
Joined: Mon May 14, 2012 8:21 am
Location: Sydney, Australia

Re: Using VLC to stream from the camera - Help needed

Wed May 22, 2013 8:58 am

wallarug wrote:vlc (running on PC) does not want to open the stream... :( :( :( :(

looks like a job for tomorrow. I did get http stream working in th end but not rtsp.

I will try and see what I can do tomorrow.

User avatar
wallarug
Posts: 460
Joined: Mon May 14, 2012 8:21 am
Location: Sydney, Australia

Re: Using VLC to stream from the camera - Help needed

Wed May 22, 2013 9:00 am

LeoWhite wrote:
wallarug wrote:vlc (running on PC) does not want to open the stream... :( :( :( :(
Once VLC has run out of video to stream I suspect its closing the network connection.

Does the raspicam preview window open up on the HDMI output to confirm that video is being captured?
yes.

I will look at tomorrow though. We can't have fun all the time :D

LeoWhite
Posts: 131
Joined: Mon Apr 08, 2013 9:20 am
Contact: Website

Re: Using VLC to stream from the camera - Help needed

Wed May 22, 2013 9:29 am

wallarug wrote: yes.

I will look at tomorrow though. We can't have fun all the time :D
I do need to get on with some work myself :D

Surfinger
Posts: 6
Joined: Tue May 21, 2013 2:41 pm

Re: Using VLC to stream from the camera - Help needed

Wed May 22, 2013 11:53 am

Hey everyone! I'm struggling with the Cam.

I tried every command to stream into lan, but everytime I'm hitting enter the pi shutdown and wont come back online since I do a "hardreset" (power off/on)..

Does anybody know, why this is happening?


Model B 512MB, Inet over eth0, Debian squeez, USB HUB (external power supply).

Thx.

znanev
Posts: 6
Joined: Fri Oct 19, 2012 3:22 pm

Re: Using VLC to stream from the camera - Help needed

Wed May 22, 2013 12:15 pm

Surfinger wrote:Hey everyone! I'm struggling with the Cam.

I tried every command to stream into lan, but everytime I'm hitting enter the pi shutdown and wont come back online since I do a "hardreset" (power off/on)..

Does anybody know, why this is happening?


Model B 512MB, Inet over eth0, Debian squeez, USB HUB (external power supply).

Thx.
Hi,

it seems that you don't have enough power for your Raspberry Pi. The USB hub provides 500mA max.

If you have a USB charger for some other device (Kindle, Android phone/tablet etc.) - try with that.


Regards!

Surfinger
Posts: 6
Joined: Tue May 21, 2013 2:41 pm

Re: Using VLC to stream from the camera - Help needed

Wed May 22, 2013 12:20 pm

znanev wrote:
Hi,

it seems that you don't have enough power for your Raspberry Pi. The USB hub provides 500mA max.

If you have a USB charger for some other device (Kindle, Android phone/tablet etc.) - try with that.


Regards!
Sorry i forgot. The pi has got it's own power supply (i think its 1.2A) - And the USB Hub also got it's own.

User avatar
wallarug
Posts: 460
Joined: Mon May 14, 2012 8:21 am
Location: Sydney, Australia

Re: Using VLC to stream from the camera - Help needed

Wed May 22, 2013 12:32 pm

Surfinger wrote:
znanev wrote:
Hi,

it seems that you don't have enough power for your Raspberry Pi. The USB hub provides 500mA max.

If you have a USB charger for some other device (Kindle, Android phone/tablet etc.) - try with that.


Regards!
Sorry i forgot. The pi has got it's own power supply (i think its 1.2A) - And the USB Hub also got it's own.
Have you tried with nothing plugged in except for camera and keyboard?

Surfinger
Posts: 6
Joined: Tue May 21, 2013 2:41 pm

Re: Using VLC to stream from the camera - Help needed

Wed May 22, 2013 12:46 pm

Yep! Tryed it right now. Only Pi+Ethernet.

Same result as before. Btw. Images work.

User avatar
wallarug
Posts: 460
Joined: Mon May 14, 2012 8:21 am
Location: Sydney, Australia

Re: Using VLC to stream from the camera - Help needed

Wed May 22, 2013 12:52 pm

Surfinger wrote:Yep! Tryed it right now. Only Pi+Ethernet.

Same result as before. Btw. Images work.
so you are having a problem with just normal video from the camera? which means that the network stream isn't working?

Surfinger
Posts: 6
Joined: Tue May 21, 2013 2:41 pm

Re: Using VLC to stream from the camera - Help needed

Wed May 22, 2013 12:56 pm

Well. taking images work with raspistill. But if i try to store a video or even stream it, the pi shutsdown.

Trav
Posts: 20
Joined: Mon Mar 05, 2012 10:02 pm

Re: Using VLC to stream from the camera - Help needed

Wed May 22, 2013 1:36 pm

Surfinger wrote:Well. taking images work with raspistill. But if i try to store a video or even stream it, the pi shutsdown.
I had a similar problem; everything worked locally, but every time I tried to stream, the network stopped working and I lost control of the Raspi and it was effectively dead.
Usual suspect: power supply. And this was one I replaced the original one with for similar reasons. The camera seemed to take it over the edge, though it worked fine before.
I changed to a higher current power supply (actually a rechargeable emergency phone charger) and every thing worked as it should.
1st Batch Model B (256M) running Raspbian, Pibrow case, with RaspiCam.
Model A (256M) running Raspbmc, caseless.

Surfinger
Posts: 6
Joined: Tue May 21, 2013 2:41 pm

Re: Using VLC to stream from the camera - Help needed

Wed May 22, 2013 1:49 pm

Ok thx. I'll try to find one "stonger" ;)

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5242
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Using VLC to stream from the camera - Help needed

Wed May 22, 2013 2:13 pm

wallarug wrote:That wasn't to hard:

I fixed the raspivid so it now works for user 'pi'

Code: Select all

sudo chmod 777 /dev/vchiq
moving onto video stream now.
Correct solution would be:

Code: Select all

ls -l /dev/vchiq
crw-rw---T 1 root video 250, 0 Jan  1  1970 /dev/vchiq
so, user needs to be in video group

Code: Select all

pi@raspberrypi:~ $ groups pi
pi : pi adm tty dialout cdrom sudo audio video plugdev games users netdev input indiecity
I'm in video group, but suppose I wasn't, I would do:

Code: Select all

sudo usermod -aG video pi
(obviously replace pi with your username). You may also want to add audio and other groups.

tvjon
Posts: 683
Joined: Mon Jan 07, 2013 9:11 am

Re: Using VLC to stream from the camera - Help needed

Wed May 22, 2013 3:51 pm

LeoWhite wrote:
ProgDrums wrote:What would be the benefit, if any, of HLS?
Most people were talking about it in relation to streaming to iOS devices.

....
Leo
Buzz Player, LuberPlayer Lite, & Goodplayer on iOS see the "basic" http stream ok. I haven't tried HLS.

Several other players don't though....

ludespeedny
Posts: 103
Joined: Mon Oct 01, 2012 6:55 pm

Re: Using VLC to stream from the camera - Help needed

Thu May 23, 2013 3:43 am

Has anyone been able to stream to a Nexus 7? I am using 2 VLC apps and neither one of them is able to view the stream, but I can view it on my PC via http and rtsp

LeoWhite
Posts: 131
Joined: Mon Apr 08, 2013 9:20 am
Contact: Website

Re: Using VLC to stream from the camera - Help needed

Thu May 23, 2013 5:36 am

ludespeedny wrote:Has anyone been able to stream to a Nexus 7? I am using 2 VLC apps and neither one of them is able to view the stream, but I can view it on my PC via http and rtsp
The 'VLC for Android Beta' app from Videolabs works for me.

Leo

texy
Forum Moderator
Forum Moderator
Posts: 5154
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Using VLC to stream from the camera - Help needed

Thu May 23, 2013 7:35 am

LeoWhite wrote:Well I've now gotten HLS working! So my new stream is at http://109.145.254.207:8091/streaming/stream.m3u8

and I launched it using

Code: Select all

raspivid -o -  -w 920 -h 540 -t 9999999 |  vlc -v -I "dummy" stream:///dev/stdin  :sout="#std{access=livehttp{seglen=10,delsegs=true,numsegs=5, index=/var/www/streaming/stream.m3u8, index-url=http://109.145.254.207/streaming/stream-########.ts}, mux=ts{use-key-frames}, dst=/var/www/streaming/stream-########.ts}" :demux=h264
Which is based on some examples found on the web and previously mentioned in these forums.

This does seem to consume a lot more CPU time than the raw HTTP/RTSP stream tho..

Leo
I had another play with this last night, but still not much success. Sometimes I could get a bit of video, but mostly not. I could see your live stream without a problem however, so I think my laptop is configured OK - I even timed it right to see a train go by ;-)
One thing I just thought off - as I am running the Pi headless and ssh'ing into it, would it save a bit of processing power to include the -n option, to disable the preview to hdmi ?
The reason I want to use this method is so that I can easily stream to my iphone. Perhaps other method are also suitable for this?

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

LeoWhite
Posts: 131
Joined: Mon Apr 08, 2013 9:20 am
Contact: Website

Re: Using VLC to stream from the camera - Help needed

Thu May 23, 2013 7:48 am

texy wrote:
I had another play with this last night, but still not much success. Sometimes I could get a bit of video, but mostly not. I could see your live stream without a problem however, so I think my laptop is configured OK - I even timed it right to see a train go by ;-)
This time of day you get a train about every 5-10 minutes! Now catching the steam engine as it goes past is more tricky!
texy wrote: One thing I just thought off - as I am running the Pi headless and ssh'ing into it, would it save a bit of processing power to include the -n option, to disable the preview to hdmi ?
The reason I want to use this method is so that I can easily stream to my iphone. Perhaps other method are also suitable for this?
Does the -n option work at the moment? My RPi doesn't have a display connected to it at the moment so not sure if the preview window has a huge impact or not. Certainly changing the resolution seems to effect the amount of CPU VLC consumes so you could try running the camera at something small like 320x240 to see if that gives you a stable stream.

My camera board is currently connected up to a 512MB Model B I ordered at the same time. I might try connecting up to my Model A or one of my earlier 256MB Model Bs to see if I notice any stability issues with them.

Leo

Return to “Camera board”