Get image (jpg) from a Java live feed.
I have a web site that I capture an image every minute and put it on my site and then at midnight turn it into a movie.
Since the ISS is now streaming a live feed I thought it would be good to get am image from there and put it on my site and the next day could see a timelapse of the day. This is where the live feed is http://www.ustream.tv/channel/live-iss-stream/theater Just a thought if anyone knows of a way that would be great. The server I have is Debian 6 64 bit and the scripts I use are either Bash or PHP. |
I'm sure this is the long way around but
cron that runs capture from command line and increments file names. gnome-screenshot Or imagemagick using import I'd bet there are better ways. |
Looks like a Flash stream to me. I'm thinking maybe something using rtmpdump to capture say 1 second of video then shoving that through ffmpeg to extract an image. Maybe. The stream just shows a solid blue right now so not the best to experiment with.
|
This does one image per second. Don't have patience to try one per minute. ;)
Code:
ffmpeg -i "http://sjc-uhls-vip04.ustream.tv/watch/playlist.m3u8?cid=9408562&appType=11&appVersion=2&locks=97d170e1550eee4afc0af065b78cda302a97674c" -f image2 -vf fps=fps=1 img%06d.jpg Code:
ffmpeg -i "http://sjc-uhls-vip02.ustream.tv/watch/playlist.m3u8?cid=17074538&appType=11&appVersion=2&locks=97d170e1550eee4afc0af065b78cda302a97674c" -f image2 -vf fps=fps=1 img%06d.jpg How? 1] Get Firefox to pretend it's an iPad. 2] Look at http headers. See also https://addons.mozilla.org/en-US/fir...gent-switcher/ https://addons.mozilla.org/en-US/fir...-http-headers/ https://trac.ffmpeg.org/wiki/Create%...%20the%20video |
It occurs to me that a problem with that method is that you have to stream the video all day to get the images. That'll suck bandwidth, which may or may not be an issue for you, and there's the risk ffmpeg will crap out at some point.
Better is something you can call from cron once a minute. I'm thinking this Code:
ffmpeg -i "http://sjc-uhls-vip04.ustream.tv/watch/playlist.m3u8?cid=9408562&appType=11&appVersion=2&locks=97d170e1550eee4afc0af065b78cda302a97674c" -ss 00:00:05 -f image2 -vframes 1 $(date +%s).jpg |
Quote:
[buffer @ 0x25cfd80] Buffering several frames is not supported. Please consume all available frames before adding a new one. Will have to try and find a way to make the image higher quality ?? The image I am using now is about 138325 May 19 18:12 img-1096.jpg and these ones are a lot smaller 4036 May 19 18:04 1400547844.jpg I added -s 640x480 to the output to make it a bit bigger. This is the result http://dingo-den.com/index.php?nav=cam1 |
I also make a video at midnight and would like to try and get a better quality. Do you know if I can change this to make the video quality better ?
/usr/bin/ffmpeg -y -i img-%d.jpg -an -qscale 1 -vcodec msmpeg4v2 webcam2-video-hi.avi I also produce a mp4 from the avi later to upload to youtube and it would be good to make that a better quality as well ? ffmpeg -i webcam2-video-hi.avi -acodec libfaac -ab 128k -vcodec libx264 webcam2-video-hi.mp4 I have tried a lot of things but can;t get a nice crisp image |
Quote:
Quote:
Quote:
Quote:
|
OK thanks for your help it is appreciated.
|
One more thing you might help me with. I just looked at the first video of the ISS that I made and it goes really really quick. I use this command to make the video, what can I add to make it play slower.
/usr/bin/ffmpeg -y -i img-%d.jpg -an -qscale 1 -vcodec msmpeg4v2 webcam2-video-hi.avi Found the answer should have googled more than I did. /usr/bin/ffmpeg -r 2 -y -i img-%d.jpg -an -qscale 1 -vcodec msmpeg4v2 -r 35 webcam2-video-hi.avi |
All times are GMT -5. The time now is 11:39 AM. |