View Full Version : Transcode from Motion JPEG AVI to I-frame-only MPEG-1
blah789
18th December 2008, 21:31
Is it doable? Is a motion-jpeg frame identical to an MPEG-1 i-frame? If so, is there any utility that will losslessly rip each jpeg frame and place it in MPEG?
The best I could find was here
http://forums.maxconsole.net/showthread.php?t=6089
which referred to code here
http://www.codeproject.com/KB/graphics/MPEGFunction.aspx
Unfortunately the code and the demo program are gone. Also I don't even know if the demo program could do what the thread title says (convert Motion JPEG AVI to I-frame-only MPEG-1) or if was only meant to convert one frame.
Also is this doable with MPEG-2? or MP4?
mgh
20th December 2008, 17:33
doable with TMPGEnc. MPEG Settings-GOP structure- Iframes only. With mp4 codecs, max keyframe interval=1. You will need to set quality based encoding at close to 100% quality.
blah789
21st December 2008, 03:21
Before I made the post I had already tried with TMPGEnc, I-frame only. My intuition told me it would recompress, not losslessly transcode, and I was right. So I don't think that works. Here's how I know: the output differs wildly in size. It shouldn't if it were a lossless transcode (just difference in overhead for container change which tends to be minimal).
Dark Shikari
21st December 2008, 06:38
It's theoretically possible with any 8x8DCT-based format, i.e. MPEG-1/2/4 (but not H.264).
mpucoder
21st December 2008, 16:46
I've been holding back while trying to locate a program I found years ago and tucked away to look at later, but can't locate it in my files or online. Someone did write a program to do this, although I believe it was to mpeg-2 not mpeg-1.
As Dark Shikari noted jpeg and mpeg both use 8x8 DCT compression. Both also allow for custom quantization.
However there are two areas which present problems.
1) Jpeg allows 4 types of chroma subsampling but mpeg allows only 3:
no subsampling (4:4:4)
horizontal subsampling (4:2:2)
both horizontal and vertical subsampoling (4:2:0)
So for all except vertical only subsampling the image data can be left intact. For vertical only subsampling you would have to either upsample to 4:4:4 or downsample to 4:2:0
2) jpeg allows interlacing which is not supported at all in mpeg-1, and not equivalent to mpeg-2 field interlacing. These images would have to be fully decoded and re-encoded.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.