[FFmpeg-user] With mxg/MxPEG, keyframes only are seen?
Jesse Gordon
tojesseg at gmail.com
Thu Nov 1 17:19:46 CET 2012
Good Day,
I'm trying to use ffmpeg to convert an mxg file to a series of jpeg
images, but ffmpeg seems to be seeing only the key frames and skipping
the incremental/partial frames.
(mxg AKA MxPEG is a "video" format designed by Mobotix. They use it with
their IP cameras. It uses JPEG compression, and in general functionality
it is like mjpeg, except MxPEG also supports partial frames -- so if
only part of the scene changes, just those jpeg blocks are updated.)
From what I can tell, mxg is supported by ffmpeg, and when I use it, I
do get a bunch of jpeg images, but not nearly enough. my source video
file has a time stamp in the right top corner and with ffmpeg I get
about 2 frames per second. However with the native mobotix camera
software, I get about 7 frames a second.
It looks like ffmpeg is grabbing the key frames but skipping the
"incremental" frames or whatever you want to call them. (They are not
delta frames like real video codecs - they are just "sparse jpegs" which
have only the needed jpeg blocks or something like that.)
The test file I'm using as a .mxg source is:
http://bookcracker.com/M00001.jpg
(Note that my test file has almost no motion in it, so the
"delta"(sparse) frames would pretty much just contain updates for the
timestamp in right top corner, which has mS resolution. Anyway, thus it
makes sense that the "delta" frames would be very small, and most of the
file size would be a result of the key frames.)
The command I'm using is:
ffmpeg -f mxg -i M00001.jpg foo-%03d.jpeg
I get 21 jpeg files, and when looking at them, the time stamp in the
right top corner indicates that each frame is about half a second's worth.
But when playing in the Mobotix software, there are around 7 frames in
each second.
I wish I had a way to demonstrate to you that the source file indeed has
more than 21 frames, but I can't think of a way other than downloading
and installing Mobotix's windows only "MxControlCenter"
(http://www.mobotix.com/eng_US/Products/Software/MxControlCenter) but I
wouldn't ask anyone to install a windows program anyway. But
MxControlCenter does show all the frames; one can do "Next Frame" and
"Prev Frame" and see each frame and there are about 7 or so frames in a
second.
I just grabbed the latest ffmpeg and compiled yesterday:
ffmpeg -v
ffmpeg version N-46251-g54a48d2 Copyright (c) 2000-2012 the FFmpeg
developers
built on Oct 31 2012 15:33:44 with gcc 4.5.2 (GCC)
configuration: --prefix=/usr
libavutil 52. 1.100 / 52. 1.100
libavcodec 54. 70.100 / 54. 70.100
libavformat 54. 35.100 / 54. 35.100
libavdevice 54. 3.100 / 54. 3.100
libavfilter 3. 21.106 / 3. 21.106
libswscale 2. 1.101 / 2. 1.101
libswresample 0. 16.100 / 0. 16.100
uname -a
Linux darkstar 2.6.37.6-smp #2 SMP Sat Apr 9 23:39:07 CDT 2011 i686
Intel(R) Pentium(R) 4 CPU 2.80GHz GenuineIntel GNU/Linux
Here's the ffmpeg output:
ffmpeg -f mxg -i M00001.jpg foo-%03d.jpeg
ffmpeg version N-46251-g54a48d2 Copyright (c) 2000-2012 the FFmpeg
developers
built on Oct 31 2012 15:33:44 with gcc 4.5.2 (GCC)
configuration: --prefix=/usr
libavutil 52. 1.100 / 52. 1.100
libavcodec 54. 70.100 / 54. 70.100
libavformat 54. 35.100 / 54. 35.100
libavdevice 54. 3.100 / 54. 3.100
libavfilter 3. 21.106 / 3. 21.106
libswscale 2. 1.101 / 2. 1.101
libswresample 0. 16.100 / 0. 16.100
[mxg @ 0x8ec7520] Estimating duration from bitrate, this may be inaccurate
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, mxg, from 'M00001.jpg':
Duration: 00:02:56.85, start: 1351625054.845054, bitrate: 63 kb/s
Stream #0:0: Video: mxpeg, yuvj420p, 1280x960, 1.83 tbr, 1000k tbn,
1000k tbc
Stream #0:1: Audio: pcm_alaw, 8000 Hz, mono, s16, 64 kb/s
Output #0, image2, to 'foo-%03d.jpeg':
Metadata:
encoder : Lavf54.35.100
Stream #0:0: Video: mjpeg, yuvj420p, 1280x960, q=2-31, 200 kb/s,
90k tbn, 1.83 tbc
Stream mapping:
Stream #0:0 -> #0:0 (mxpeg -> mjpeg)
Press [q] to stop, [?] for help
frame= 21 fps=0.0 q=0.0 Lsize= 0kB time=00:00:11.45 bitrate=
0.0kbits/s dup=0 drop=35
video:2127kB audio:0kB subtitle:0 global headers:0kB muxing overhead
-100.000000%
ls -la
-rwx------ 1 root root 1414839 Oct 30 12:24 M00001.jpg
-rwx------ 1 root root 96185 Nov 1 09:01 foo-001.jpeg
-rwx------ 1 root root 96202 Nov 1 09:01 foo-002.jpeg
-rwx------ 1 root root 119517 Nov 1 09:01 foo-003.jpeg
-rwx------ 1 root root 160964 Nov 1 09:01 foo-004.jpeg
-rwx------ 1 root root 119524 Nov 1 09:01 foo-005.jpeg
-rwx------ 1 root root 160929 Nov 1 09:01 foo-006.jpeg
-rwx------ 1 root root 184793 Nov 1 09:01 foo-007.jpeg
-rwx------ 1 root root 138074 Nov 1 09:01 foo-008.jpeg
-rwx------ 1 root root 184932 Nov 1 09:01 foo-009.jpeg
-rwx------ 1 root root 109554 Nov 1 09:01 foo-010.jpeg
-rwx------ 1 root root 138167 Nov 1 09:01 foo-011.jpeg
-rwx------ 1 root root 79951 Nov 1 09:01 foo-012.jpeg
-rwx------ 1 root root 106693 Nov 1 09:01 foo-013.jpeg
-rwx------ 1 root root 64415 Nov 1 09:01 foo-014.jpeg
-rwx------ 1 root root 79704 Nov 1 09:01 foo-015.jpeg
-rwx------ 1 root root 58068 Nov 1 09:01 foo-016.jpeg
-rwx------ 1 root root 65891 Nov 1 09:01 foo-017.jpeg
-rwx------ 1 root root 53422 Nov 1 09:01 foo-018.jpeg
-rwx------ 1 root root 58003 Nov 1 09:01 foo-019.jpeg
-rwx------ 1 root root 49175 Nov 1 09:01 foo-020.jpeg
-rwx------ 1 root root 53480 Nov 1 09:01 foo-021.jpeg
bash-4.1# ls foo-0*|wc -l
21
Am I doing it right, or what might be the problem?
Thank you very much,
Jesse Gordon
More information about the ffmpeg-user
mailing list