[Mjpeg-users] lav* tools have to be in an avi container?

2007-12-18 Thread er0ck
i have what is supposedly a short mjpeg that i downloaded from one of my IP
cameras.

i want to split up the frames into individual jpgs.   lavtrans gives:
$> lavtrans -o image%05d.jpg -f i 20071203_205830.mjpeg
Unable to identify file (not a supported format - avi, quicktime).
**ERROR: [lavtrans] Error opening 20071203_205830.mjpeg

lavplay does the same.

i just want to split up the frames so i can digi-zoom/crop and "enhance"
each frame (it's only about 120 frames)
i need this to be automated as it's going to happen every 60 mins or so

do i have to cram that into an avi container?
mplayer seems to think it's in one already:

here is the output from mplayer which plays the file fine:
Playing 20071203_205830.mjpeg.
libavformat file format detected.
[lavf] Video stream found, -vid 0
VIDEO:  [MJPG]  1280x1024  0bpp  25.000 fps0.0 kbps ( 0.0 kbyte/s)
==
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffmjpeg] vfm: ffmpeg (FFmpeg MJPEG decoder)
==
Audio: no sound
Starting playback...
VDec: vo config request - 1280 x 1024 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 3)
Movie-Aspect is 1.25:1 - prescaling to correct movie aspect.
VO: [x11] 1280x1024 => 1280x1024 Planar YV12  [zoom]
[swscaler @ 0x8813d48]SwScaler: using unscaled yuv420p -> rgb32 special
converter
V:   0.4  12/ 12 ??% ??% ??,?% 0 0

thanks!


-- 
"The mechanical man, brazen-lunged creature of dreadful portent is among
us!" --unknown
-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


Re: [Mjpeg-users] lav* tools have to be in an avi container?

2007-12-19 Thread er0ck
aha!   right you are!

$> hexdump -C 20071203_205830.mjpeg | head
  2d 2d 6d 79 62 6f 75 6e  64 61 72 79 0d 0a 43 6f
|--myboundary..Co|
0010  6e 74 65 6e 74 2d 54 79  70 65 3a 20 69 6d 61 67  |ntent-Type:
imag|
0020  65 2f 6a 70 65 67 0d 0a  43 6f 6e 74 65 6e 74 2d
|e/jpeg..Content-|
0030  4c 65 6e 67 74 68 3a 20  32 35 38 38 30 31 0d 0a  |Length:
258801..|
0040  0d 0a ff d8 ff e0 00 10  4a 46 49 46 00 01 01 00
|JFIF|
0050  00 01 00 01 00 00 ff db  00 43 00 05 03 04 04 04
|.C..|

$>hexdump -C 20071203_205830.mjpeg | grep jpeg
0020  65 2f 6a 70 65 67 0d 0a  43 6f 6e 74 65 6e 74 2d
|e/jpeg..Content-|
0003f350  20 69 6d 61 67 65 2f 6a  70 65 67 0d 0a 43 6f 6e  |
image/jpeg..Con|
0007e0a0  70 65 3a 20 69 6d 61 67  65 2f 6a 70 65 67 0d 0a  |pe:
image/jpeg..|
000bce50  67 65 2f 6a 70 65 67 0d  0a 43 6f 6e 74 65 6e 74
|ge/jpeg..Content|
000fbd30  65 2f 6a 70 65 67 0d 0a  43 6f 6e 74 65 6e 74 2d
|e/jpeg..Content-|
0013aa30  70 65 3a 20 69 6d 61 67  65 2f 6a 70 65 67 0d 0a  |pe:
image/jpeg..|
001b8550  54 79 70 65 3a 20 69 6d  61 67 65 2f 6a 70 65 67  |Type:
image/jpeg|
001f7180  67 65 2f 6a 70 65 67 0d  0a 43 6f 6e 74 65 6e 74
|ge/jpeg..Content|
002360a0  65 3a 20 69 6d 61 67 65  2f 6a 70 65 67 0d 0a 43  |e:
image/jpeg..C|
00274f40  3a 20 69 6d 61 67 65 2f  6a 70 65 67 0d 0a 43 6f  |:
image/jpeg..Co|
002b3fd0  2f 6a 70 65 67 0d 0a 43  6f 6e 74 65 6e 74 2d 4c
|/jpeg..Content-L|

so it's about 12 frames of jpegs  (one of the "jpeg" must have wrapped over)
so maybe i don't need mjpeg tools?  i just need to split up the individual
jpegs.
if i use "strings" i can grep out 12 jpegs with what looks like
"--myboundary" between them

i had tried putting the mjpeg from the camera into an avi container thusly:
$>mencoder 20071203_205830.mjpeg -o 20071203_205830.avi -ovc copy -of avi

Video stream: 51535.333 kbit/s  (6441916 B/s)  size: 3092120 bytes
0.480secs  12 frames


and that worked as far as mplayer was concerned (obviously)
but what is strange is that file (or i guess the avi container) still
thinks  there is an mjpeg encoded file inside:
$> file 20071203_205830.avi
20071203_205830.avi: RIFF (little-endian) data, AVI, 1280 x 1024, 25.00 fps,
video: Motion JPEG

although i don't know what the mjpeg header should look like.

thanks for the reply!
any other help from the list would be appreciated if anyone has ever done
anything like this or if i can do this easily with mjpegtools.
-eric

On Dec 19, 2007 5:00 AM, Burkhard Plaum <[EMAIL PROTECTED]> wrote:

> Hi,
>
> er0ck schrieb:
> > i have what is supposedly a short mjpeg that i downloaded from one of my
> > IP cameras.
> >
> > i want to split up the frames into individual jpgs.   lavtrans gives:
> > $> lavtrans -o image%05d.jpg -f i 20071203_205830.mjpeg
> > Unable to identify file (not a supported format - avi, quicktime).
> > **ERROR: [lavtrans] Error opening 20071203_205830.mjpeg
>
> mjpeg has to be either in AVI or Quicktime.
> Don't know, what yor camera produces, maybe it's just concatenated
> jpeg images. What does
>
> hexdump -C 20071203_205830.mjpeg | head
>
> say?
>
> > Playing 20071203_205830.mjpeg.
> > libavformat file format detected.
>
> Not really helpful message
>
> Burkhard
>
> -
> SF.Net email is sponsored by:
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services
> for just about anything Open Source.
>
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> ___
> Mjpeg-users mailing list
> Mjpeg-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mjpeg-users
>



-- 
"The mechanical man, brazen-lunged creature of dreadful portent is among
us!" --unknown
-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


Re: [Mjpeg-users] lav* tools have to be in an avi container?

2007-12-19 Thread er0ck
yeah.  i figured out how to parse out the images.  pretty simple.

i guess i'm still confused on what mjpegtools is targeted at if there is no
standard "header" nor format?

the lav tools expect an avi or quicktime, but what has to be inside the avi
container?

anyway, thanks for the kickstart and good luck with your projects!

-eric

On Dec 19, 2007 9:54 AM, Burkhard Plaum <[EMAIL PROTECTED]> wrote:

> Hi,
>
> er0ck schrieb:
> > aha!   right you are!
> >
> [...]
> > so it's about 12 frames of jpegs  (one of the "jpeg" must have wrapped
> over)
> > so maybe i don't need mjpeg tools?  i just need to split up the
> > individual jpegs.
>
> Yes. It's one of those "multipart jpeg" files. It should be trivial to
> extract the individual images. Just parse the "Content-length:" fields.
>
> [...]
> > i had tried putting the mjpeg from the camera into an avi container
> thusly:
> > $>mencoder 20071203_205830.mjpeg -o 20071203_205830.avi -ovc copy -of
> avi
> > 
> > Video stream: 51535.333 kbit/s  (6441916 B/s)  size: 3092120 bytes
> > 0.480 secs  12 frames
> >
> > and that worked as far as mplayer was concerned (obviously)
> > but what is strange is that file (or i guess the avi container) still
> > thinks  there is an mjpeg encoded file inside:
> > $> file 20071203_205830.avi
> > 20071203_205830.avi: RIFF (little-endian) data, AVI, 1280 x 1024, 25.00
> > fps, video: Motion JPEG
>
> No, it's not strange it's exactly what it ought to be. Your mencoder
> command
> just extracts the JPEGs and puts them into an AVI
> container. The container is now AVI, but the video is still (M)JPEG.
>
> The distinction between JPEG and MJPEG is somewhat blurred at least as far
> as AVI is concerned. So simply packing JPEG files into an AVI makes the
> decoder think it's MJPEG.
>
> > although i don't know what the mjpeg header should look like.
>
> There is no standard MJPEG fileformat. There are some formats, which
> carry MJPEG data like SMJPEG or the multipart JPEG you have (and some
> others
> mainly used for Computer games). And AVI and Quicktime of course.
>
> Burkhard
>
> -
> SF.Net email is sponsored by:
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services
> for just about anything Open Source.
>
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> ___
> Mjpeg-users mailing list
> Mjpeg-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mjpeg-users
>



-- 
"The mechanical man, brazen-lunged creature of dreadful portent is among
us!" --unknown
-
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users