dostei
Posts: 5
Joined: Thu Jun 06, 2013 8:56 am

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Fri Jun 07, 2013 5:08 am

hi,

when i use the command : make (before i set the command ./configure). i got a error message at the end:

Code: Select all

CC      ffmpeg.o
ffmpeg.c: In function âwrite_frameâ:
ffmpeg.c:577:9: warning: âdestructâ is deprecated (declared at ./libavcodec/avcodec.h:1095) [-Wdeprecated-declarations]
CC      ffmpeg_opt.o
CC      ffmpeg_filter.o
CC      cmdutils.o
LD      ffmpeg_g
collect2: ld terminated with signal 9 [Getötet]
make: *** [ffmpeg_g] Fehler 1
root@raspberrypi:/usr/src/ffmpeg#

janek
Posts: 8
Joined: Sun Aug 05, 2012 4:10 pm

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Sat Jun 08, 2013 8:33 pm

./configure needs some time to finish, so wait until you go back to command prompt and then run make.

larry104
Posts: 14
Joined: Sun Jun 09, 2013 8:34 pm

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Sun Jun 09, 2013 8:39 pm

I can confirm the 6 sec delay as well - did anyone figure out yet where this is coming from? btw/ I had the same 6 sec delay when using the VLC method.

B0SC0
Posts: 22
Joined: Tue Jun 04, 2013 3:46 pm

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Sun Jun 09, 2013 11:06 pm

larry104 wrote:I can confirm the 6 sec delay as well - did anyone figure out yet where this is coming from? btw/ I had the same 6 sec delay when using the VLC method.

How far away from your router?

Testing mine 3 feet away gives me a 2 second delay.

I would imagine a lot has to do with the quality of your wifi signal.

larry104
Posts: 14
Joined: Sun Jun 09, 2013 8:34 pm

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Mon Jun 10, 2013 12:31 am

How far away from your router?
My Pi is connected to a gigabit switch so is the laptop I'm watching the feed on - it doesn't get closer than that ...

guivi01
Posts: 3
Joined: Mon Jun 10, 2013 9:26 am

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Mon Jun 10, 2013 9:39 am

Hi,

I have follow all the steps as described above. The camera seems to be streaming find, but when I try to connect to the server from another computer it says error loading player, could not load player configuration. :?
I do have the html and the jwplayer folder on the /var/www/ folder.
I have copied the html as per the description above into the default index.html file at /var/www/.
to star the camera I run the command: "raspivid -t 999999 -w 960 -h 540 -fps 25 -b 500000 -vf -o - | ffmpeg -i - -vcodec copy -an -f flv -metadata streamName=myStream tcp://0.0.0.0:6666" as per described above.
On the other computer I put on the browser: "http://raspberrypiIP/index.html"

Could anyone point out what may I be doing wrong? and how could I go about fixing this?

Cheers

Guivi

larry104
Posts: 14
Joined: Sun Jun 09, 2013 8:34 pm

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Mon Jun 10, 2013 3:40 pm

... error loading player, could not load player configuration
Do you see some strange ASCII characters at the top and bottom of the page?
jwplayer.jpg
jwplayer.jpg (30.02 KiB) Viewed 9358 times
You probably did a cut and paste of the html code from the forum web page - for some reason there are some strange ASCII characters embedded (check with od -c <nameoffile>.html). If you remove these it should work fine.

guivi01
Posts: 3
Joined: Mon Jun 10, 2013 9:26 am

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Mon Jun 10, 2013 4:17 pm

Thanks!!
Indeed I had the bad characters on my screen. I have deleted these and now is all good. :D
my laziness got me!! :roll:
Cheers!

larry104
Posts: 14
Joined: Sun Jun 09, 2013 8:34 pm

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Mon Jun 10, 2013 4:24 pm

Well I was lazy too ... it took me a while to figure it out ;)

dostei
Posts: 5
Joined: Thu Jun 06, 2013 8:56 am

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Mon Jun 10, 2013 5:49 pm

does anybody now how to change the output to play quicktime videos. because the smartphone (ios, android) dont support that .flv

guivi01
Posts: 3
Joined: Mon Jun 10, 2013 9:26 am

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Tue Jun 11, 2013 8:22 am

@dostei:

have a look at running "ffmpeg -formats" and "ffmpeg -codecs". These two may help you.

sithlord2
Posts: 27
Joined: Fri Aug 24, 2012 11:13 pm

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Tue Jun 11, 2013 8:55 am

Anyone tried this with "flumotion" as a web-frontend?

TomNH
Posts: 2
Joined: Sun Mar 03, 2013 10:11 pm

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Tue Jun 11, 2013 11:53 am

dostei wrote:hi,

when i use the command : make (before i set the command ./configure). i got a error message at the end:

Code: Select all

CC      ffmpeg.o
ffmpeg.c: In function âwrite_frameâ:
ffmpeg.c:577:9: warning: âdestructâ is deprecated (declared at ./libavcodec/avcodec.h:1095) [-Wdeprecated-declarations]
CC      ffmpeg_opt.o
CC      ffmpeg_filter.o
CC      cmdutils.o
LD      ffmpeg_g
collect2: ld terminated with signal 9 [Getötet]
make: *** [ffmpeg_g] Fehler 1
root@raspberrypi:/usr/src/ffmpeg#
dostei,

I am experiencing the same problem with the LD for ffmpeg_g, did you solve this problem?

Thanks

dostei
Posts: 5
Joined: Thu Jun 06, 2013 8:56 am

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Tue Jun 11, 2013 3:08 pm

TomNH wrote:
dostei wrote:hi,

when i use the command : make (before i set the command ./configure). i got a error message at the end:

Code: Select all

CC      ffmpeg.o
ffmpeg.c: In function âwrite_frameâ:
ffmpeg.c:577:9: warning: âdestructâ is deprecated (declared at ./libavcodec/avcodec.h:1095) [-Wdeprecated-declarations]
CC      ffmpeg_opt.o
CC      ffmpeg_filter.o
CC      cmdutils.o
LD      ffmpeg_g
collect2: ld terminated with signal 9 [Getötet]
make: *** [ffmpeg_g] Fehler 1
root@raspberrypi:/usr/src/ffmpeg#
dostei,

I am experiencing the same problem with the LD for ffmpeg_g, did you solve this problem?

Thanks



you have to less memory free on your rpi. so give less memory for gpu . Use raspi-config and change the memory split.

Code: Select all

memory_split - Change memory split
The Raspberry Pi has two processors, one for calculation tasks (the CPU) and one for graphical tasks (the GPU). The CPU is described as the ARM; the GPU as the VideoCore. This version takes account of the 256 MB or 512 MB boards, and allows a dynamic reallocation of memory, whereas older versions of raspi-config only split the 256 MB and could not set the dynamic option. The best setting will depend on what type of applications you are running on your Raspberry Pi.

dostei
Posts: 5
Joined: Thu Jun 06, 2013 8:56 am

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Tue Jun 11, 2013 7:39 pm

when i start the command:
raspivid -t -1 -w 960 -h 540 -fps 25 -b 500000 -vf -o - | ffmpeg -i - -vcodec copy -an -f flv -metadata streamName=myStream tcp://0.0.0.0:6666

after some time i got following error message:

Code: Select all

Failed to update header with correct duration.
flv@ 0x2880210 Failed tu pdate header with correct filesize
Whats wrong here??

TomNH
Posts: 2
Joined: Sun Mar 03, 2013 10:11 pm

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Tue Jun 11, 2013 8:14 pm

I tried to re-link, LD, ffmpeg_g after reducing the graphics memory to 16MB, the minimum. Same result. Maybe the older 256MB pi's don't have enough memory to link ffmpeg_g? Anyone else have any ideas?

User avatar
jacksonliam
Posts: 181
Joined: Tue Feb 07, 2012 10:09 pm

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Wed Jun 12, 2013 6:22 pm

TomNH wrote:I tried to re-link, LD, ffmpeg_g after reducing the graphics memory to 16MB, the minimum. Same result. Maybe the older 256MB pi's don't have enough memory to link ffmpeg_g? Anyone else have any ideas?
Try making a swap file, surely if its a memory problem that'd fix it?

sithlord2
Posts: 27
Joined: Fri Aug 24, 2012 11:13 pm

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Thu Jun 13, 2013 11:06 pm

Is anyone able to catch the stream with rtmpdump on a Windows machine?

I only get errors:

Code: Select all

C:\Users\user\Desktop\rtmpdump>rtmpdump -r "rtmp://192.168.10.204/flvplayback/
flv:myStream.flv" -o test.flv
RTMPDump v2.4
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Connecting ...
WARNING: HandShake: client signature does not match!
INFO: Connected...
ERROR: rtmp server sent error
ERROR: RTMP_ReadPacket, failed to read RTMP packet header
I just use the default command from the initial post:

Code: Select all

raspivid -t 9999999 -w 960 -h 540 -fps 25 -b 500000 -vf -o - | ffmpeg -i - -vcodec copy -an -f flv -metadata streamName=myStream tcp://0.0.0.0:6666
Which seams to be streaming fine:

Code: Select all

ffmpeg version N-54015-gfa125c5 Copyright (c) 2000-2013 the FFmpeg developers
  built on Jun 14 2013 00:23:44 with gcc 4.6 (Debian 4.6.3-14+rpi1)
  configuration:
  libavutil      52. 35.101 / 52. 35.101
  libavcodec     55. 16.100 / 55. 16.100
  libavformat    55.  8.102 / 55.  8.102
  libavdevice    55.  2.100 / 55.  2.100
  libavfilter     3. 76.101 /  3. 76.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
[h264 @ 0x1e2cce0] max_analyze_duration 5000000 reached at 5000000 microseconds
Input #0, h264, from 'pipe:':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (High), yuv420p, 960x540, 25 fps, 25 tbr, 1200k tbn, 50 tbc
Output #0, flv, to 'tcp://0.0.0.0:6666':
  Metadata:
    streamName      : myStream
    encoder         : Lavf55.8.102
    Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p, 960x540, q=2-31, 25 fps, 1k tbn, 1200k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
frame= 1108 fps= 28 q=-1.0 size=    2276kB time=00:00:44.28 bitrate= 421.1kbits/s

[/code]

sithlord2
Posts: 27
Joined: Fri Aug 24, 2012 11:13 pm

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Fri Jun 14, 2013 5:43 am

dostei wrote:when i start the command:
raspivid -t -1 -w 960 -h 540 -fps 25 -b 500000 -vf -o - | ffmpeg -i - -vcodec copy -an -f flv -metadata streamName=myStream tcp://0.0.0.0:6666

after some time i got following error message:

Code: Select all

Failed to update header with correct duration.
flv@ 0x2880210 Failed tu pdate header with correct filesize
Whats wrong here??
Seems I have the same issue too. It stops broadcasting after +- 3 hours.

User avatar
josch222
Posts: 1
Joined: Sat Jun 15, 2013 8:30 pm

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Sun Jun 16, 2013 9:00 am

For using a Pi as a baby monitor I wanted to add audio from an USB soundcard to the stream and ran into some difficulties.
The used version of ffmpeg seems not to support audio from alsa.
This may be fixed by editing some dependencies in the build configuration, but I was too lazy to find out and ffmpeg would possibly needed recompilation, so I found a different solution.

It requires the installation of the oss-compat package to get the dsp(1) device:

Code: Select all

sudo apt-get install oss-compat
Then, this commandline should work:

Code: Select all

raspivid -t 0 -fps 25 -ex auto -b 500000 -o - | ffmpeg -f oss -ac 1 -ar 44100 -i /dev/dsp1 -i - -vcodec copy -f flv -metadata streamName=myStream tcp://0.0.0.0:6666
I needed some time to find out what the -an switch means ;-) but after removing it finally worked.
There may be more or less of "Non-monotonous DTS in output stream" errors after starting the stream, this seems to depend on the choosen resolution of the camera and/or framerate. But after a second they are gone and the stream is stable.

There are some problems left: In the -ex night exposure mode the framerate drops to 5-6fps and ffmpeg seems to have problems to mux the audio into a stream with such a low framerate.
Does somebody know how to fix this?

Is there a more compatible output stream format available?
It works fine in browsers on windows but my android smartphone seems not to be able to display this flv. I tried 4 or 5 different players on the phone, none of them worked.
Interested in solar aviation? Take a look at
http://www.solarimpulse.com/

jericho63
Posts: 26
Joined: Mon May 27, 2013 1:20 pm

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Wed Jun 19, 2013 8:34 pm

larry104 wrote:I can confirm the 6 sec delay as well - did anyone figure out yet where this is coming from? btw/ I had the same 6 sec delay when using the VLC method.
Hello,

i have also +/- 6sec delay and i don't use wifi, all are connected on gigabyte switch.

Anybody have find an answer to this issue?

Thank you

larry104
Posts: 14
Joined: Sun Jun 09, 2013 8:34 pm

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Fri Jul 05, 2013 12:05 am

Sorry to bring this up again but did anyone find a solution to the 6sec delay - did anyone find a different method of steaming in realtime or near realtime? /btw I just noticed that the delay get's worse the longer the camera runs - really strange

gotdatwmd
Posts: 4
Joined: Sat May 18, 2013 6:21 pm

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Fri Jul 05, 2013 7:04 pm

What other ports need to be forwarded in order for this to be viewed outside of the network? Forwarding port 80 works fine but when connecting the jwplayer applet reports "error loading stream cannot connect to server."

suzimu
Posts: 6
Joined: Fri May 17, 2013 8:37 pm

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Fri Jul 05, 2013 7:23 pm

rtmp uses port 1935 as default i believe.

jericho63
Posts: 26
Joined: Mon May 27, 2013 1:20 pm

Re: Streaming Raspberry Pi Camera H264 into HTML over RTMP

Fri Jul 19, 2013 1:53 pm

Subject: Streaming Raspberry Pi Camera H264 into HTML over RTMP
suzimu wrote:rtmp uses port 1935 as default i believe.
Hello,

forwarding port 1935 don't work , i have the same message :
error loading stream : could not connect to server


i don't understand...

Return to “Camera board”