Not able to view video when STREAM_METHOD is set to mpeg
Not able to view video when STREAM_METHOD is set to mpeg
When I set the STREAM_METHOD to mpeg and output type to swf I cannot see any video when monitoring or viewing events etc. in firefox.
However, when I go to an event and click on Video, then set the Format Type to swf, then Generate the Video, then click on View I can watch the video just fine in firefox. The type sent is application/x-shockwave-flash in both cases but in one it works the other it doesn't.
When the page comes up I see a quick flash that is the size the image is supposed to be then just the white background. I look on the server and see the nph-zms process running so it hasn't died and it runs until I close the window. I look in the log files but don't see any errors associated with this. I enable debugging but don't see any debugging for the nph-zms process.
I assume by the fact that the video is generated as a swf and I can then view it ffmpeg is working.
So, any ideas where to look? Or what additional information might be helpful for someone to get some ideas? I'd really like to get mpeg streaming working but am at a loss at the moment.
However, when I go to an event and click on Video, then set the Format Type to swf, then Generate the Video, then click on View I can watch the video just fine in firefox. The type sent is application/x-shockwave-flash in both cases but in one it works the other it doesn't.
When the page comes up I see a quick flash that is the size the image is supposed to be then just the white background. I look on the server and see the nph-zms process running so it hasn't died and it runs until I close the window. I look in the log files but don't see any errors associated with this. I enable debugging but don't see any debugging for the nph-zms process.
I assume by the fact that the video is generated as a swf and I can then view it ffmpeg is working.
So, any ideas where to look? Or what additional information might be helpful for someone to get some ideas? I'd really like to get mpeg streaming working but am at a loss at the moment.
More info.
This is just too bizarre, no rhyme or reason that I can discern.
First off, playing YouTube videos that are flv's sent as swf application/x-shockwave-flash play fine, don't have any issues with them.
I have two cameras currently connected to ZM, one via coax cable to a BlueCherry PV-981 4 port card, the only thing connected to that board at the moment, running at 30fps. The second camera is an IP camera thus is a network connected camera running at 15fps.
Sometimes when I switch to mpeg I can monitor the network camera and watch its events but I can never monitor or watch the events from the coax camera in mpeg mode. The only obvious difference is the frame rate, 15 verses 30. It works for the 15fps camera but not the 30fps camera. I tried setting the max frames down to 15fps on the coax camera but that did not make a difference.
It appears the stream connection is attempted but nothing comes through. Ant ideas what is going on or how to get more information as to what is going on?
This is just too bizarre, no rhyme or reason that I can discern.
First off, playing YouTube videos that are flv's sent as swf application/x-shockwave-flash play fine, don't have any issues with them.
I have two cameras currently connected to ZM, one via coax cable to a BlueCherry PV-981 4 port card, the only thing connected to that board at the moment, running at 30fps. The second camera is an IP camera thus is a network connected camera running at 15fps.
Sometimes when I switch to mpeg I can monitor the network camera and watch its events but I can never monitor or watch the events from the coax camera in mpeg mode. The only obvious difference is the frame rate, 15 verses 30. It works for the 15fps camera but not the 30fps camera. I tried setting the max frames down to 15fps on the coax camera but that did not make a difference.
It appears the stream connection is attempted but nothing comes through. Ant ideas what is going on or how to get more information as to what is going on?
Ok maybe I found something in apache's error log:
The kicker is, the /var/run/ZM/ directory does exist and is read writeableby the ZM processes, it has other sockets there, but indeed this socket is not there so my guess is it's not being created or it is but something is dieing fast and it goes away.
Code: Select all
[error] [client 0.0.0.0] socket_sendto( /var/run/ZM/zms-764902s.sock ) failed: No such file or directory, referer: http://mywebsite/?view=watch&mid=1
[error] [client 0.0.0.0] array (\n 0 => \n array (\n 'file' => '/<removed>/ZM/ajax/stream.php',\n 'line' => 55,\n 'function' => 'ajaxError',\n 'args' => \n array (\n 0 => 'socket_sendto( /var/run/ZM/zms-764902s.sock ) failed: No such file or directory',\n ),\n ),\n 1 => \n array (\n 'file' => '/<removed>/ZM/index.php',\n 'line' => 116,\n 'args' => \n array (\n 0 => '/<removed>/ZM/ajax/stream.php',\n ),\n 'function' => 'require_once',\n ),\n), referer: http://mywebsite/?view=watch&mid=1
Ok, when I get this error message not finding zms-487049s.sock:
I see these sockets:
And nph-zms is using the "s" one:
I start a tight loop with a 4 core Phenom before I try to watch:
And this is the only socket that shows up:
Is ajax looking for the wrong socket? Does anyone have any ideas or am I on my own here?
Code: Select all
[Thu Feb 04 22:29:25 2010] [error] [client 192.168.30.235] array (\n 0 => \n array (\n 'file' => '/<removed>/ZM/ajax/stream.php',\n 'line' => 55,\n 'function' => 'ajaxError',\n 'args' => \n array (\n 0 => 'socket_sendto( /var/run/ZM/zms-487049s.sock ) failed: No such file or directory',\n ),\n ),\n 1 => \n array (\n 'file' => '/<removed>/ZM/index.php',\n 'line' => 116,\n 'args' => \n array (\n 0 => '/<removed>/ZM/ajax/stream.php',\n ),\n 'function' => 'require_once',\n ),\n), referer: http://mywebsite/ZM/index.php?view=watch&mid=2
Code: Select all
# ls -al /var/run/ZM/
total 2
drwxr-xr-x 2 wwwrun www 112 Feb 4 22:30 .
drwxr-xr-x 35 root root 1672 Feb 4 22:30 ..
srwxr-xr-x 1 wwwrun www 0 Feb 4 22:22 zmdc.sock
srwxr-xr-x 1 wwwrun www 0 Feb 4 22:30 zms-005117s.sock
Code: Select all
lsof |grep zms-005117
nph-zms 19176 wwwrun 5u unix 0xffff880237b9f0c0 0t0 86031060 /var/run/ZM/zms-005117s.sock
Code: Select all
# while [[ 1 -ne 2 ]] ; do ls -al /var/run/ZM/zms-* 2>s.ss ; done | grep -v w.sock$ > s.s
Code: Select all
# sort -u s.s
srwxr-xr-x 1 wwwrun www 0 Feb 4 22:30 /var/run/ZM/zms-005117s.sock
Is ajax looking for the wrong socket? Does anyone have any ideas or am I on my own here?
I helped with a similar problem problem that was streaming jpegs. See http://www.zoneminder.com/forums/viewtopic.php?t=15248 The error log messages look to be very similar.
It turns out that the problem was the cgi-bin under apache wasn't set up correctly. Look at the thread and see if there is anything there to help you.
One other thing, you say it can view the events using an mpeg stream. An important difference between an event and a live stream is that events are finite. This means that your browser might be trying to load the entire stream before displaying it. With events it will succeed but with a live stream it will fail because the stream doesn't end.
It turns out that the problem was the cgi-bin under apache wasn't set up correctly. Look at the thread and see if there is anything there to help you.
One other thing, you say it can view the events using an mpeg stream. An important difference between an event and a live stream is that events are finite. This means that your browser might be trying to load the entire stream before displaying it. With events it will succeed but with a live stream it will fail because the stream doesn't end.
Thanks I'll read through that thread and see.
Just to clarify what I'm seeing. When set to jpeg streaming everything works. When set to mpeg streaming no streaming works. When set to mpeg streaming if I click on the Monitor to the coax 30fps camera no picture no video, white screen. When I click on the IP 15fps camera I see video but the timestamp never changes changes in the video, that says to me I'm maybe getting the first frame and that's it.
When I say I can view events it's only by generating them. I click on the events number on the console page, it pops up the list of events. I click on an event number, it pops event page when you would normally view the event except all I see is white. I then click on video on that screen, it pops up video generate screen, I set the type to swf leaving real and actual set, I click on Generate Video. When complete the Existing Video Files table shows up, I click on Action -> View for that event, I can then watch that event as a swf and it continuously loops. That tells me firefox is able to play swf application/x-shockwave-flash videos from ZM. The difference here is a file is being sent and not a live feed.
It looks to me, as far as I can tell and based on what little I know of ZM's operation that it appears to be a socket issue because when attempting to stream mpeg the socket ajax is looking for is not there.
Just a question regarding this possibly being a cgi issue, would that only affect mpeg streams and not jpeg streams? Because when set to jpeg it works.
Just popped up that thread, didn't look the same when I started this one, that was before I discovered the error message in the apache error log that does appear to be similar.
That thread looks like a apache/cgi setup issue, that's not my issue. Got a lot of cgi's in use some with .cgi and other extensions, some no extensions. When using "AddHandler cgi-script .cgi .pl" or anything any files in cgi-bin without extensions won't get executed and will be shipped out ans text, ran into that myself. Had to set up apache to execute all in the cgi-bin directory. Not a start forward task.
Read the whole thread, nope that's not this problem, his cgi's weren't executing, mine are.
Just to clarify what I'm seeing. When set to jpeg streaming everything works. When set to mpeg streaming no streaming works. When set to mpeg streaming if I click on the Monitor to the coax 30fps camera no picture no video, white screen. When I click on the IP 15fps camera I see video but the timestamp never changes changes in the video, that says to me I'm maybe getting the first frame and that's it.
When I say I can view events it's only by generating them. I click on the events number on the console page, it pops up the list of events. I click on an event number, it pops event page when you would normally view the event except all I see is white. I then click on video on that screen, it pops up video generate screen, I set the type to swf leaving real and actual set, I click on Generate Video. When complete the Existing Video Files table shows up, I click on Action -> View for that event, I can then watch that event as a swf and it continuously loops. That tells me firefox is able to play swf application/x-shockwave-flash videos from ZM. The difference here is a file is being sent and not a live feed.
It looks to me, as far as I can tell and based on what little I know of ZM's operation that it appears to be a socket issue because when attempting to stream mpeg the socket ajax is looking for is not there.
Just a question regarding this possibly being a cgi issue, would that only affect mpeg streams and not jpeg streams? Because when set to jpeg it works.
Just popped up that thread, didn't look the same when I started this one, that was before I discovered the error message in the apache error log that does appear to be similar.
That thread looks like a apache/cgi setup issue, that's not my issue. Got a lot of cgi's in use some with .cgi and other extensions, some no extensions. When using "AddHandler cgi-script .cgi .pl" or anything any files in cgi-bin without extensions won't get executed and will be shipped out ans text, ran into that myself. Had to set up apache to execute all in the cgi-bin directory. Not a start forward task.
Read the whole thread, nope that's not this problem, his cgi's weren't executing, mine are.
I got this when I set to MPEG to stream...
The DU Meter shows activity, my server is sending data, but all video is white...
On error_log I got this...
On access_log i got
What can be wrong???
The DU Meter shows activity, my server is sending data, but all video is white...
On error_log I got this...
Code: Select all
[Fri Feb 19 20:44:56 2010] [error] [client xxx.xxx.xxx.xxx] [flv @ 0xe076030]removing common factors from framerate, referer: http://mysite/zm/?view=event&eid=3493&trms=1&attr1=MonitorId&op1=%3d&val1=1&page=1
[Fri Feb 19 20:51:00 2010] [error] [client xxx.xxx.xxx.xxx] [flv @ 0xdb414e0]removing common factors from framerate, referer: http://mysite/zm/index.php?view=watch&mid=1
[Fri Feb 19 21:07:40 2010] [error] [client xxx.xxx.xxx.xxx] [flv @ 0xf4f44e0]removing common factors from framerate, referer: http://mysite/zm/index.php?view=watch&mid=1
[Fri Feb 19 21:09:22 2010] [error] [client xxx.xxx.xxx.xxx] [flv @ 0xee6c4e0]removing common factors from framerate, referer: http://mysite/zm/?view=watch&mid=1
[Fri Feb 19 21:09:35 2010] [error] [client [b]xxx.xxx.xxx.xxx[/b]] [flv @ 0xf9a5000]removing common factors from framerate, referer: http://[b]mysite[/b]/zm/?view=event&eid=3502&trms=1&attr1=MonitorId&op1=%3d&val1=1&page=1
Code: Select all
xxx.xxx.xxx.xxx - - [19/Feb/2010:21:09:22 -0600] "GET /cgi-bin/nph-zms?mode=mpeg&monitor=1&scale=100&bitrate=150000&maxfps=15&format=swf&buffer=1000&connkey=692479&rand=1266635362 HTTP/1.1" 200 - "http://mysite/zm/?view=watch&mid=1" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; MEGAUPLOADTOOLBAR; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"
xxx.xxx.xxx.xxx - - [19/Feb/2010:21:09:35 -0600] "GET /cgi-bin/nph-zms?source=event&mode=mpeg&event=3502&frame=1&scale=100&rate=100&bitrate=150000&maxfps=15&format=swf&replay=gapless&connkey=80048&rand=1266635372 HTTP/1.1" 200 - "http://mysite/zm/?view=event&eid=3502&trms=1&attr1=MonitorId&op1=%3d&val1=1&page=1" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; MEGAUPLOADTOOLBAR; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)"
What can be wrong???
I sometimes have this problem:
I attempting to stream using the swf format. When I don't get that error and the socket is created I have debug enabled so I'm watching the stream being created. In FireFox when watching, nothing but a white screen. But, xnetload is showing me the stream is getting to my laptop where I'm running FF.
I see FF fired up the Falsh viewer:
But no picture. I'm using FF 3.5.7 from the SuSE 11.2 distribution with flash-player-10.0.45.2-0.1.1.i586 also installed from the distribution.
Code: Select all
[Sat Feb 20 14:04:45 2010] [error] [client x.x.x.x] socket_sendto( /var/run/zm/zms-941507s.sock ) failed: No such file or directory, referer: http: etc.
I see FF fired up the Falsh viewer:
Code: Select all
11781 3483 root /bin/sh /usr/bin/firefox
11786 11781 root /usr/lib64/firefox/firefox
11799 11786 root /usr/lib/mozilla/kmozillahelper
13166 11786 root /usr/lib/nspluginwrapper/i386/linux/npviewer.bin --plugin /usr/lib/browser-plugins/libflashplayer.so --connection /org/wrapper/NSPlugins/libflashplayer.so/11786-6
Ok, I now have the 64 bit Flash Player installed and nspluginwrapper removed.
I can watch 1 of the 3 camera pretty reliably. That camera is a IP D-Link DCS-3410 set to 704x480 15fps and pulling the images in jpeg mode.
I cannot watch my other 2 cameras that are set to 720x480 30fps being captured via a BlueCherry 4 port PVI-981 card. The stream is getting to my laptop and the Flash Player is running in the browser window, I can right click and get the Flash Player's popup window, but all I see is a white screen. I have been trying FireFox, Opera, and Konqueror and it is the seem in all three. Sometimes the stream dies when attempting to watch one of those two cameras, usually really fast, by the 4th frame from what I saw in the debugging (that's another issue I'll tackle it if it continues if I ever get this working), but when that happens and you right click in the area where the Flash Player is in the browser you see the message "movie not loaded". So it appears the Flash Player is doing its thing, just not displaying anything. Setting the max fps to 15 on those two cameras didn't make a difference either.
I set the D-Link camera to 30fps at 352x240 and it still worked. I also tried 704x480 30fps and it worked but only at around 25fps so I keep it at 15fps normally. That's another issue I'll maybe tackle later to but I might switch to RTSP for that camera, the RTSP stream from it works with mplayer but my attempts so far to use RTSP in ZM have not been fruitful But I'm thinking I need this working first anyway.
So it's something with the Flash Player when getting a ZM stream from a camera connected to the PVI-981.
I also updated ffmpeg and the associated libs to the latest from the Packman repository:
And recompiled and installed before any of this latest testing. I'm not going to give up and am determined to get this working. Oh and I tried in Windows Vista too using Windows type formats like asf with the same results, it don't work.
Hoping someone has some ideas here.
I can watch 1 of the 3 camera pretty reliably. That camera is a IP D-Link DCS-3410 set to 704x480 15fps and pulling the images in jpeg mode.
I cannot watch my other 2 cameras that are set to 720x480 30fps being captured via a BlueCherry 4 port PVI-981 card. The stream is getting to my laptop and the Flash Player is running in the browser window, I can right click and get the Flash Player's popup window, but all I see is a white screen. I have been trying FireFox, Opera, and Konqueror and it is the seem in all three. Sometimes the stream dies when attempting to watch one of those two cameras, usually really fast, by the 4th frame from what I saw in the debugging (that's another issue I'll tackle it if it continues if I ever get this working), but when that happens and you right click in the area where the Flash Player is in the browser you see the message "movie not loaded". So it appears the Flash Player is doing its thing, just not displaying anything. Setting the max fps to 15 on those two cameras didn't make a difference either.
I set the D-Link camera to 30fps at 352x240 and it still worked. I also tried 704x480 30fps and it worked but only at around 25fps so I keep it at 15fps normally. That's another issue I'll maybe tackle later to but I might switch to RTSP for that camera, the RTSP stream from it works with mplayer but my attempts so far to use RTSP in ZM have not been fruitful But I'm thinking I need this working first anyway.
So it's something with the Flash Player when getting a ZM stream from a camera connected to the PVI-981.
I also updated ffmpeg and the associated libs to the latest from the Packman repository:
Code: Select all
ffmpeg-0.5.21861svn-0.pm.1.1.x86_64
libavcodec52-0.5.21861svn-0.pm.1.1.x86_64
libavdevice52-0.5.21861svn-0.pm.1.1.x86_64
libavformat52-0.5.21861svn-0.pm.1.1.x86_64
libavutil50-0.5.21861svn-0.pm.1.1.x86_64
libpostproc51-0.5.21861svn-0.pm.1.1.x86_64
libswscale0-0.5.21861svn-0.pm.1.1.x86_64
Hoping someone has some ideas here.
- zoneminder
- Site Admin
- Posts: 5215
- Joined: Wed Jul 09, 2003 2:07 pm
- Location: Bristol, UK
- Contact:
Have you checked your apache error logs?
If you do I suspect you might see something in there relating to non monotone timestamps. The flash encoder seems to prefer all frames to be timed at exactly the same intervals and so objects when real world timestamps vary slightly.
If that is the case then you will need to switch off Options->Images->MPEG_TIMED_FRAMES and see if that helps. I can stream using swf for both live and events with no problem with that option switched off.
If you do I suspect you might see something in there relating to non monotone timestamps. The flash encoder seems to prefer all frames to be timed at exactly the same intervals and so objects when real world timestamps vary slightly.
If that is the case then you will need to switch off Options->Images->MPEG_TIMED_FRAMES and see if that helps. I can stream using swf for both live and events with no problem with that option switched off.
Phil
Thank you for the reply.
I originally had MPEG_TIMED_FRAMES enabled and had the problem, I disabled it last week and it is still currently disabled and the problem still exists.
I have been checking my apache erro log and have seen this many times times but not always.
But I also see this:
But sometimes I see neither and do see the stream being sent on my laptop using xnetload where I am running the ZM console and trying to watch the cameras and the Flash Player appears to be running in the browser window. I have used numerous PC's to try this so it is not occurring just on my laptop.
Right now I clicked on one of the cameras to watch it but have a white screen. There is a socket in /var/run/zm/, xnetload shows that a stream is being received and right clicking in the browser window shows the Flash Player is there. In the apache error log I see one instance of this:
I have seen this many times before it usually would precede either one of the two ajax errors shown above.
I originally had MPEG_TIMED_FRAMES enabled and had the problem, I disabled it last week and it is still currently disabled and the problem still exists.
I have been checking my apache erro log and have seen this many times times but not always.
Code: Select all
[Tue Feb 23 07:40:56 2010] [error] [client x.x.x.x] array (\n 0 => \n array (\n 'file' => '/mydir/ZM/ajax/stream.php',\n 'line' => 55,\n 'function' => 'ajaxError',\n 'args' => \n array (\n 0 => 'socket_sendto( /var/run/zm/zms-460437s.sock ) failed: No such file or directory',\n ),\n ),\n 1 => \n array (\n 'file' => '/mydir/ZM/index.php',\n 'line' => 116,\n 'args' => \n array (\n 0 => '/mydir/ZM/ajax/stream.php',\n ),\n 'function' => 'require_once',\n ),\n), referer: http://mysite/ZM/?view=watch&mid=2
[Tue Feb 23 07:41:05 2010] [error] [client x.x.x.x] socket_sendto( /var/run/zm/zms-460437s.sock ) failed: No such file or directory, referer: http://mysite/ZM/?view=watch&mid=2
Code: Select all
[Sun Feb 21 08:22:18 2010] [error] [client x.x.x.x] array (\n 0 => \n array (\n 'file' => '/mydir/ZM/ajax/stream.php',\n 'line' => 55,\n 'function' => 'ajaxError',\n 'args' => \n array (\n 0 => 'socket_sendto( /var/run/zm/zms-981819s.sock ) failed: Connection refused',\n ),\n ),\n 1 => \n array (\n 'file' => '/mydir/ZM/index.php',\n 'line' => 116,\n 'args' => \n array (\n 0 => '/mydir/ZM/ajax/stream.php',\n ),\n 'function' => 'require_once',\n ),\n), referer: http://mysite/ZM/?view=event&eid=3681&filter[terms][0][attr]=Archived&filter[terms][0][op]=%3D&filter[terms][0][val]=0&filter[terms][1][cnj]=and&filter[terms][1][attr]=DateTime&filter[terms][1][op]=%3E%3D&filter[terms][1][val]=-1+hour&sort_field=StartTime&sort_asc=1&page=1
Right now I clicked on one of the cameras to watch it but have a white screen. There is a socket in /var/run/zm/, xnetload shows that a stream is being received and right clicking in the browser window shows the Flash Player is there. In the apache error log I see one instance of this:
Code: Select all
[Tue Feb 23 07:58:10 2010] [error] [client x.x.x.x] [flv @ 0x60fa3f0]removing common factors from framerate, referer: http://mysite/ZM/index.php?view=watch&mid=2
i had lots of sock problems and the weird errors 'require once' etc
that's how i got rid of them - change stream.php
http://www.zoneminder.com/forums/viewtopic.php?t=15145
don't do the 's.sock' change though, that broke the progress bars!
that's how i got rid of them - change stream.php
http://www.zoneminder.com/forums/viewtopic.php?t=15145
don't do the 's.sock' change though, that broke the progress bars!