Curl a JPG from a MJPG stream


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Curl a JPG from a MJPG stream
# 1  
Old 02-16-2012
Curl a JPG from a MJPG stream

Lets say I want to curl a JPG file from this MJPG stream, how can this be done?

I tried using curl but it just keeps capturing the entire stream.

curl -o ~/Desktop/sample.jpg http://204.248.124.202/mjpg/video.mjpg

Link to sample web cam http://204.248.124.202/mjpg/video.mjpg
# 2  
Old 02-16-2012
curl retrieves webpages, it doesn't decode videos. You'll have to use something like transcode perhaps to extract individual frames.
# 3  
Old 02-16-2012
do you know of any other way I can do this or how to get started with transcoding?
# 4  
Old 02-16-2012
mjpegtools can probably do what you want. Installing now to test.

---------- Post updated at 10:55 AM ---------- Previous update was at 10:29 AM ----------

It only supports its own crazy formats, not normal mjpeg. Had better results with mplayer so far:

Code:
mplayer -vo jpeg video.mjpg

But I don't know how to autostop it after x frames.

---------- Post updated at 10:57 AM ---------- Previous update was at 10:55 AM ----------

This works perfectly, saving 00000001.jpg in the current directory:

Code:
mplayer -frames 1 -vo jpeg http://204.248.124.202/mjpg/video.mjpg

# 5  
Old 02-16-2012
Thanks, trying to find mplayer for osx binary now. Will try and report back.

---------- Post updated at 06:01 PM ---------- Previous update was at 10:35 AM ----------

I can't find command line mplayer for OSX. Could this be done any other way?
# 6  
Old 02-16-2012
Did you check Fink or Macports? They both have mplayer packages/ports.

Regards,
Alister
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Wget JPG not working

Hi, I am new to Unix. Actually, I am using Terminal from MAC OSX Snow Leopard. I have installed XCode and wget 1.14 today. I just want to download all of the jpg files from a specific blog (from blogspot). But its not working. Here is the command I use: wget -r -nd -A jpg come-se All... (3 Replies)
Discussion started by: bruleke
3 Replies

2. Shell Programming and Scripting

Grab all jpg's from flickr

Hi everyone, i'm trying to download all the jpg's that my school put on flickr and im trying to do this with wget via a bash script. The pictures that im trying to pull are on this site : and below is my script that doesn't appear to be working (1 Reply)
Discussion started by: binary-ninja
1 Replies

3. Shell Programming and Scripting

print metadata to jpg

Hi all, I would like to write a scipt that gets gps informatoin from a jpg and print 's it on the lower left corner, In order to get the gps data I have found a tool called jhead. In know that with the help of the imagemagick command convert it is possible to print text on the pictures. ... (11 Replies)
Discussion started by: flash80
11 Replies

4. UNIX for Dummies Questions & Answers

Deleting all but JPG files

I would like to delete all files but keep all the .JPG files. How can this be accomplished? Thanks in advance (8 Replies)
Discussion started by: Xterra
8 Replies

5. Shell Programming and Scripting

Rename all ".JPG" files to ".jpg" under all subfolders...

Hi, Dear all: One question ! ^_^ I'm using bash under Ubuntu 9.10. My question is not to rename all ".JPG" files to ".jpg" in a single folder, but to rename all ".JPG" files to ".jpg" in all subfolders. To rename all ".JPG" to ".jpg" in a single folder, for x in *.JPG; do mv "$x"... (7 Replies)
Discussion started by: jiapei100
7 Replies

6. Shell Programming and Scripting

[Video stream] network stream recording with mplayer

Hi I used this command: mplayer http://host/axis-cgi/mjpg/video.cgi -user root -passwd root \ -cache 1024 -fps 25.0 -nosound -vc ffh264 \ -demuxer 3 -dumpstream -dumpfile output.avi It's ok but... Video Playing is very fast! Why? Is it a synch problem? What parameter I have to use for... (1 Reply)
Discussion started by: takeo.kikuta
1 Replies

7. Shell Programming and Scripting

how to send jpg as body

Hi, I ftp the .jpg file from windows to unix machine, now i need to send the jpg file as body to (not as attachment) outlook, can anyone send the sample code for this? (1 Reply)
Discussion started by: vasu.g
1 Replies

8. AIX

jpg image

Hello I would like to see an jpeg image with aix. It is possible ? how can i do ? thank you (4 Replies)
Discussion started by: pascalbout
4 Replies
Login or Register to Ask a Question