Reply
Member
Ranger
Posts: 132
Registered: ‎11-28-2009
Posts: 132
Kudos: 15
Registered: 11-28-2009

JPEG snapshot from Aircam

You can take it from RTSP stream using ffmpeg

For example:
ffmpeg -i rtsp://89.222.174.5/live/ch00_0 -y -f image2 -ss 8 -sameq -t 0.001 /var/www/mysite/snapshot.jpg

I started script on my webserver hovrino.extip.ru (history)
------------------------------------------------------------
#!/bin/sh
export DATETIME=`date +%Y%m%d%H%M`
export DATE=`date +%Y%m%d`
export MONT=`date +%Y%m`
mkdir /var/www/image1/$MONT
mkdir /var/www/image1/$MONT/$DATE

ffmpeg -i rtsp://89.222.174.5/live/ch00_0 -y -f image2 -ss 8 -sameq -t 0.001 /var/www/image1/$MONT/$DATE/$DATETIME.jpeg
---------------------------------------------------------

Then I added my script to crontab to save image from stream every 5 minutes.
*/5 * * * * root /scripts/cam1.sh
Member
Ranger
Posts: 132
Registered: ‎11-28-2009
Posts: 132
Kudos: 15
Registered: 11-28-2009

Re: JPEG snapshot from Aircam

Snapshots of last days h.qsa5.ru/image1/201202/

If you want to test snapshots from your camera, please write me your camera address, first test it on webcamworld.pro
Newbie
lotto
Posts: 6
Registered: ‎10-27-2008
Posts: 6
Registered: 10-27-2008

Greets :)

I fully respect that you did start the stream .. I am working on this for quite some time without success. Can you tell how you configured your AIR Cam With Wowza server?. And how do you have connected Flash Player with Wowza.
I was able to connect AIR Cam to the Wowza server .. However, the flash player does not show the image.
B.r.
Piotr Pilek
LANTECH - Systemy Teleinformatyczne
www.lantech.com.pl
Member
Ranger
Posts: 132
Registered: ‎11-28-2009
Posts: 132
Kudos: 15
Registered: 11-28-2009

Re: JPEG snapshot from Aircam

I fully respect that you did start the stream .. I am working on this for quite some time without success. Can you tell how you configured your AIR Cam With Wowza server?. And how do you have connected Flash Player with Wowza.

I was able to connect AIR Cam to the Wowza server .. However, the flash player does not show the image.


Wowza server is not free, I connected cam to erlyvideo opensource server it's better and more simple. I use Jwplayer with erlyvideo server. You can see at webcamworld.pro
Newbie
lotto
Posts: 6
Registered: ‎10-27-2008
Posts: 6
Registered: 10-27-2008

Re: JPEG snapshot from Aircam

I just read that it erlyvideo. You can in some way help me to configure erlyvideo with this unit?

I installed on my BSD erlyvideo .. and the default config does not start. I'm looking for documentation but is it too much on the internet.
B.r.
Piotr Pilek
LANTECH - Systemy Teleinformatyczne
www.lantech.com.pl
Member
Ranger
Posts: 132
Registered: ‎11-28-2009
Posts: 132
Kudos: 15
Registered: 11-28-2009

Re: JPEG snapshot from Aircam

I just read that it erlyvideo. You can in some way help me to configure erlyvideo with this unit?

I installed on my BSD erlyvideo .. and the default config does not start. I'm looking for documentation but is it too much on the internet.


You must install erlang and make free port 8082, maybe other daemon uses it?
Member
Ranger
Posts: 132
Registered: ‎11-28-2009
Posts: 132
Kudos: 15
Registered: 11-28-2009

Re: JPEG snapshot from Aircam

Sample of snapshots
h.qsa5.ru/canar/201203/
Camera connected to webcamworld.pro

You can download ffmpeg binary for linux from webcamworld.pro/soft/ffmpegfull.zip
Established Member
bp2008
Posts: 827
Registered: ‎11-12-2009
Posts: 827
Kudos: 132
Solutions: 5
Registered: 11-12-2009

Re: JPEG snapshot from Aircam

Sample of snapshots
h.qsa5.ru/canar/201203/


That is a very nice looking location :icon_smile:
Visitor
marsl
Posts: 4
Registered: ‎10-24-2011
Posts: 4
Registered: 10-24-2011

Re: JPEG snapshot from Aircam

You can take it from RTSP stream using ffmpeg

For example:
ffmpeg -i rtsp://89.222.174.5/live/ch00_0 -y -f image2 -ss 8 -sameq -t 0.001 /var/www/mysite/snapshot.jpg

I started script on my webserver hovrino.extip.ru (history)
------------------------------------------------------------
#!/bin/sh
export DATETIME=`date +%Y%m%d%H%M`
export DATE=`date +%Y%m%d`
export MONT=`date +%Y%m`
mkdir /var/www/image1/$MONT
mkdir /var/www/image1/$MONT/$DATE

ffmpeg -i rtsp://89.222.174.5/live/ch00_0 -y -f image2 -ss 8 -sameq -t 0.001 /var/www/image1/$MONT/$DATE/$DATETIME.jpeg
---------------------------------------------------------

Then I added my script to crontab to save image from stream every 5 minutes.
*/5 * * * * root /scripts/cam1.sh

Hi I have a problem:

ffmpeg -i rtsp://10.107.2.108/live/ch00_0 -y -f image2 -ss 8 -sameq -t 0.001 /data/snapshot.jpg
FFmpeg version r11872+debian_0.svn20080206-18+lenny3, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: --enable-gpl --enable-libfaad --enable-pp --enable-swscaler --enable-x11grab --prefix=/usr --enable-libgsm --enable-libtheora --enable-libvorbis --enable-pthreads --disable-strip --enable-libdc1394 --enable-shared --disable-static
libavutil version: 49.6.0
libavcodec version: 51.50.0
libavformat version: 52.7.0
libavdevice version: 52.0.0
built on Feb 9 2011 19:09:55, gcc: 4.3.2
rtsp://10.107.2.108/live/ch00_0: Error while parsing header


:/
Member
Ranger
Posts: 132
Registered: ‎11-28-2009
Posts: 132
Kudos: 15
Registered: 11-28-2009

Re: JPEG snapshot from Aircam

I see that ffmpeg not compiled to work with h.264
try to use
webcamworld.pro/soft/ffmpegfull.zip compiled with all codecs
For example, unzip it to folder /ffmpeg and run
/ffmpeg/ffmpeg -i rtsp://10.107.2.108/live/ch00_0 -y -f image2 -ss 8 -sameq -t 0.001 /data/snapshot.jpg
Visitor
marsl
Posts: 4
Registered: ‎10-24-2011
Posts: 4
Registered: 10-24-2011

Re: JPEG snapshot from Aircam

I see that ffmpeg not compiled to work with h.264
try to use
webcamworld.pro/soft/ffmpegfull.zip compiled with all codecs
For example, unzip it to folder /ffmpeg and run
/ffmpeg/ffmpeg -i rtsp://10.107.2.108/live/ch00_0 -y -f image2 -ss 8 -sameq -t 0.001 /data/snapshot.jpg

Thank you. Works...
New Member
g57
Posts: 15
Registered: ‎10-06-2010
Posts: 15
Registered: 10-06-2010

Re: JPEG snapshot from Aircam

it`s works
Established Member
bp2008
Posts: 827
Registered: ‎11-12-2009
Posts: 827
Kudos: 132
Solutions: 5
Registered: 11-12-2009

Re: JPEG snapshot from Aircam

Hey Ranger, do you know if ffmpeg can run 24/7 and continuously overwrite the same jpeg file in such a way that you could simply run this on a web server and every time you loaded the image in a browser, it would be new? ffmpeg would have to keep the same video stream open, and not be opening a new video stream for each frame. I know you can get it to save images with an increasing number in the file names, but can it overwrite a single image over and over again?
Member
Ranger
Posts: 132
Registered: ‎11-28-2009
Posts: 132
Kudos: 15
Registered: 11-28-2009

Re: JPEG snapshot from Aircam

Of course, for example
ffmpeg -i rtsp://89.222.174.5/live/ch00_0 -y -f image2 -ss 8 -sameq -t 0.001 /var/www/image1/image.jpg
Established Member
bp2008
Posts: 827
Registered: ‎11-12-2009
Posts: 827
Kudos: 132
Solutions: 5
Registered: 11-12-2009

Re: JPEG snapshot from Aircam

That is exactly the same command which saves just one image... I need it to keep refreshing the image without having to run ffmpeg again for each frame.

Also, have you tried using ffmpeg on Windows with AirCam? I tried 3 different versions of ffmpeg from here and 3 different Aircams running firmware 1.0 and 1.1, and this is what I get in all cases:

C:\Users\Brian\Desktop\ffmpeg-git-4082198-win64-static\bin>ffmpeg -i "rtsp://192.168.0.87/live/ch00_
0" -f image2 -vsync 1 -r 1 snapshot.jpg
ffmpeg version N-39267-g4082198 Copyright (c) 2000-2012 the FFmpeg developers
built on Mar 25 2012 20:28:42 with gcc 4.6.2
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-runtime-cpudetect --en
able-avisynth --enable-bzlib --enable-frei0r --enable-libopencore-amrnb --enable-libopencore-amrwb -
-enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enab
le-libschroedinger --enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwben
c --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zli
b
libavutil 51. 44.100 / 51. 44.100
libavcodec 54. 12.100 / 54. 12.100
libavformat 54. 3.100 / 54. 3.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 65.102 / 2. 65.102
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 10.100 / 0. 10.100
libpostproc 52. 0.100 / 52. 0.100
method SETUP failed: 461 Unsupported Transport
Missing reference picture
decode_slice_header error
concealing 330 DC, 330 AC, 330 MV errors
Estimating duration from bitrate, this may be inaccurate
Input #0, rtsp, from 'rtsp://192.168.0.87/live/ch00_0':
Metadata:
title : GM Live
comment : ICL Streaming Media
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: h264 (Baseline), yuvj420p, 1280x720 , 15 fps, 15.33 tbr, 9
0k tbn, 30 tbc
w:1280 h:720 pixfmt:yuvj420p tb:1/1000000 sar:1/1 sws_param:
Output #0, image2, to 'snapshot.jpg':
Metadata:
title : GM Live
comment : ICL Streaming Media
encoder : Lavf54.3.100
Stream #0:0: Video: mjpeg, yuvj420p, 1280x720 , q=2-31, 200 kb/s, 90k tbn, 1 t
bc
Stream mapping:
Stream #0:0 -> #0:0 (h264 -> mjpeg)
Press to stop, for help
Missing reference picture
decode_slice_header error
concealing 330 DC, 330 AC, 330 MV errors
Width/height/bit depth/chroma idc changing with threads is not implemented
. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that
your file has a feature which has not been implemented.
decode_slice_header error
no frame!
Width/height/bit depth/chroma idc changing with threads is not implemented
. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that
your file has a feature which has not been implemented.
decode_slice_header error
no frame!
Established Member
bp2008
Posts: 827
Registered: ‎11-12-2009
Posts: 827
Kudos: 132
Solutions: 5
Registered: 11-12-2009

Re: JPEG snapshot from Aircam

Of course, for example
ffmpeg -i rtsp://89.222.174.5/live/ch00_0 -y -f image2 -ss 8 -sameq -t 0.001 /var/www/image1/image.jpg


From the ffmpeg documentation:

-t duration (output)
Stop writing the output after its duration reaches duration. duration may be a number in seconds, or in hh:mm:ss form.


If I include the -t argument, I get one frame, and if I do not, it complains with this:
 Could not get frame filename number 2 from pattern 'image.jpg'
av_interleaved_write_frame(): Invalid argument


As it is, I have to test with an actual video file as input instead of the rtsp stream because my ffmpeg isn't even willing to work with the AirCam's stream. I can run ubuntu in a VM if necessary, but if I can't get the functionality I need, there isn't much point :icon_wink:
New Member
scottb
Posts: 33
Registered: ‎01-29-2009
Posts: 33
Kudos: 2
Registered: 01-29-2009

Re: JPEG snapshot from Aircam

If you're happy with the output from snapshot.cgi and just need to access it without authentication, get yourself a copy of the curl executable from curl.haxx.se/dlwiz/ and put it in a folder with a batch file that contains the following:

:start
curl.exe -s --cookie cookies.txt --cookie-jar cookies.txt -L http:///login.cgi
curl.exe -s --cookie cookies.txt --cookie-jar cookies.txt -H "Expect:" --form-string username= --form-string password= -L http:///login.cgi?uri=/snapshot.cgi -o \snapshot.jpg
ping 123.45.67.89 -n 1 -w 4000 > nul
goto :start


Change the script as necessary and make sure you (make sure you specifiy the 'start in' folder if running it as a scheduled task). This script just runs constantly for me and downloads an image every 4 seconds to the location that i need it.

Not sure how much strain it puts on the camera. If anyone's got a better way, let me know.
Established Member
bp2008
Posts: 827
Registered: ‎11-12-2009
Posts: 827
Kudos: 132
Solutions: 5
Registered: 11-12-2009

Re: JPEG snapshot from Aircam

If you're happy with the output from snapshot.cgi and just need to access it without authentication, get yourself a copy of the curl executable from curl.haxx.se/dlwiz/ and put it in a folder with a batch file that contains the following:
:start
curl.exe -s --cookie cookies.txt --cookie-jar cookies.txt -L http:///login.cgi
curl.exe -s --cookie cookies.txt --cookie-jar cookies.txt -H "Expect:" --form-string username= --form-string password= -L http:///login.cgi?uri=/snapshot.cgi -o \snapshot.jpg
ping 123.45.67.89 -n 1 -w 4000 > nul
goto :start

Change the script as necessary and make sure you (make sure you specifiy the 'start in' folder if running it as a scheduled task). This script just runs constantly for me and downloads an image every 4 seconds to the location that i need it.
Not sure how much strain it puts on the camera. If anyone's got a better way, let me know.

I actually have been using a similar method (a C# class I wrote) with snapshot.cgi for several months. I've been pulling one image per second 24/7 for months and it does not appear to affect the camera's rtsp performance. The main difference is that it only logs in if it gets redirected to the login page when requesting a snapshot.
Edit: If anyone can get ffmpeg on Windows to work with AirCam, I'd love to know what the trick is.
Newbie
marosh-slovakia
Posts: 8
Registered: ‎12-01-2011
Posts: 8
Registered: 12-01-2011

what i make bad

i installed for my ubuntu ffmpeg with
apt-get install ffmpeg, everything makes properly and when i use command, system don't make jpg file

root@cam:/tmp# ffmpeg -i rtsp://89.222.174.5/live/ch00_0 -y -f image2 -ss 8 -sameq -t 0.001 /tmp/image.jpg
ffmpeg version 0.7.3-4:0.7.3-0ubuntu0.11.10.1, Copyright (c) 2000-2011 the Libav developers
built on Jan 4 2012 16:08:51 with gcc 4.6.1
configuration: --extra-version='4:0.7.3-0ubuntu0.11.10.1' --arch=amd64 --prefix=/usr --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --enable-runtime-cpudetect --enable-vaapi --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
libavutil 51. 7. 0 / 51. 7. 0
libavcodec 53. 6. 0 / 53. 6. 0
libavformat 53. 3. 0 / 53. 3. 0
libavdevice 53. 0. 0 / 53. 0. 0
libavfilter 2. 4. 0 / 2. 4. 0
libswscale 2. 0. 0 / 2. 0. 0
libpostproc 52. 0. 0 / 52. 0. 0
method SETUP failed: 461 Unsupported Transport
Estimating duration from bitrate, this may be inaccurate

Seems stream 0 codec frame rate differs from container frame rate: 30.00 (30/1) -> 15.00 (30/2)
Input #0, rtsp, from 'rtsp://89.222.174.5/live/ch00_0':
Metadata:
title : Ubiquiti Live
comment : UBNT Streaming Media
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0.0: Video: h264 (Baseline), yuvj420p, 1280x720, 15 fps, 15 tbr, 90k tbn, 30 tbc
w:1280 h:720 pixfmt:yuvj420p
removing common factors from framerate
Output #0, image2, to '/var/www//image.jpg':
Metadata:
title : Ubiquiti Live
comment : UBNT Streaming Media
encoder : Lavf53.3.0
Stream #0.0: Video: mjpeg, yuvj420p, 1280x720, q=2-31, 200 kb/s, 90k tbn, 15 tbc
Stream mapping:
Stream #0.0 -> #0.0
Press ctrl-c to stop encoding
Buffering several frames is not supported. Please consume all available frames before adding a new one.
Last message repeated 244 times -0kB time=10000000000.00 bitrate= -0.0kbits/s
frame= 0 fps= 0 q=0.0 Lsize= -0kB time=10000000000.00 bitrate= -0.0kbits/s
video:0kB audio:0kB global headers:0kB muxing overhead -inf%
root@cam:/tmp# ls /tmp
mc-root

could you help me, please?
Newbie
marosh-slovakia
Posts: 8
Registered: ‎12-01-2011
Posts: 8
Registered: 12-01-2011

Re: JPEG snapshot from Aircam

i try to clear some options and when i used
ffmpeg -i rtsp://89.222.174.5/live/ch00_0 -y -f image2 -sameq -t 0.001 /tmp/image.jpg
everything is OK

if this someone help, please use it :-)
Reply