PDA

View Full Version : trying to store jpeg frames out of a mjpeg avi


((( atom )))
6th March 2006, 15:48
Hi,

i am looking for a way to generate an image sequence from a motion jpeg avi without transcoding the actual frame but simply storing it with the correct header to make it a jpeg image.

as i understand this should be possible with motion jpeg, since it is an i-frame only jpeg format and actually the avi simply contains a series of jpegs.

i was hoping to find a solution with avisynth but i couldn't.

is there any or does anybody have a better idea?

regards,

Richard Berg
6th March 2006, 21:07
Avisynth won't help, since it uses the same decoders as any other app.

According to this page (https://sourceforge.net/docman/display_doc.php?docid=3456&group_id=5776#ss6.4), MJPEG Tools can do it.

((( atom )))
7th March 2006, 01:46
thx for the reply, richard.
as far as i can see the mentioned page doesn't really say that the images are not transcoded. how did you come to that conclusion?

IanB
7th March 2006, 04:35
Try VirtualDub DirectStreamCopy mode with save as BMP, this should create BMP wrapped MJPEG frames.

((( atom )))
7th March 2006, 11:02
sadly vdub still decodes the frames and makes true bmps :(

hanfrunz
9th March 2006, 13:41
i found a very easy way:
each .jpg-file starts with $FFD8 and the last two bytes are $FFD9. So you just need a little tool that extracts all the files. Maybe i can code it the next days.

hanfrunz

((( atom )))
9th March 2006, 14:06
oh, THAT would be cool! i didn't find anything yet..

hanfrunz
9th March 2006, 18:53
try this first alpha release: mjpeg2jpg.zip (http://www.geocities.com/hanfrunz/mjpeg2jpg.zip)

Its a command line tool. Use it this way:

mjpeg2jpg filename.avi

the fileextension is not important. The output dir is always "c:\". I will make that more user friendly in the future.

hanfrunz

((( atom )))
13th March 2006, 01:38
oh, i missed that one. cool. thx - i'll give it a try right away..

((( atom )))
13th March 2006, 01:42
my dosbox tells tells me:
The system cannot execute the specified program i ran it from inside its own folder on the desktop, fails with or without an avi given on the commandline.

((( atom )))
13th March 2006, 01:43
oh, sorry: i use windows xp pro corporate, service pack2, english version

hanfrunz
13th March 2006, 09:08
oh, sorry: i use windows xp pro corporate, service pack2, english version

mmh. do you have .net installed. I don't know if you need it, but i used the vc express 2005 compiler...

i will recompile at home with vc7.

hanfrunz

((( atom )))
16th March 2006, 23:04
i don't get emails anymore, when u answer, so i am sorry for the delay of my writing..

yes, i do have .net installed..

did you recomple it meanwhile? i'd still be very interested.

regards..

hanfrunz
17th March 2006, 12:17
Hello,

i recompiled it with VC7. Download here (http://www.geocities.com/hanfrunz/mjpeg2jpg01.zip)

hanfrunz

((( atom )))
18th March 2006, 15:48
ok, that works fine now. it is very slow here, though.. is it faster at your pc?

hanfrunz
20th March 2006, 08:19
ok, that works fine now. it is very slow here, though.. is it faster at your pc?

i only testes a very small file :) It was a very quick and dirty hack, so i think it can be optimized a lot :) How slow is it? Can you give some numbers (kb/sec)?

hanfrunz

EDIT:
here's a new version (http://www.geocities.com/hanfrunz/mjpeg2jpg02.zip). It reads 1MB blocks instead of single bytes from the source file. Should be a lot faster now.

EDIT2: i found some strange bugs... please use version 1 until i fixed them

EDIT3: okay here is version 0.3 (http://www.geocities.com/hanfrunz/mjpeg2jpg03.zip) it's fast and has no memory-bugs.