View Full Version : MP4 to AVI conversion incompatible (playback problem with camera)
cedico
20th February 2025, 12:34
Hi,
I bought a child camera for my daughter, and it can shoot videos in AVI format.
It has an SD card on it, so you can easily add videos manually (provided you keep the right numbering), and play them with the camera.
I have a problem: I recovered a small 3-minute cartoon in MP4 and when I try to convert it to the same AVI format (Motion Jpeg) as a Video generated by the device, the generated video is unreadable, although support told me that normally there was no problem doing this kind of thing.
I've tried hundreds of may to convert with tools like ffmpeg, AviDemux and VLC, but nothing works, although the GSpot software tells me that the generated video has the right Video and Audio Codecs.
Could you tell me how you would do it, and with which tools please?
Video MP4 source:
https://limewire.com/d/27c70af9-32d7-426d-9fc2-8f17585743a7#SB5-ljGMYaDYtR-uY0cuFUYE0VtLsVGfq7KfhHHDEGg
AVI video generated by the camera:
https://limewire.com/d/086063bc-6e58-4efe-8196-e0dac58c365c#KEmJGwwcXkEAm5T9AI5T_oqMBtbdaoFVthyi_7qjos8
Format genereted by the camera:
Motion JPEG (MJPG) - 70 Frms - 25244 kbps - 30 Pics/s - 30 Frames/s
1920 x 1080
PCM Audio - 16000 Hz - 32000 Bps / 256 kb/s (1 chnl - mono)YUV 4:2:0, 8 bits
Hexa editor says that video is packed with: Generalplug AviPackerV3
I have already discussed about this with 2 english and french forums, but they advised me to try to ask at Doom9:
https://forum.videohelp.com/threads/417343-MP4-to-AVI-conversion-incompatible-(playback-problem-with-camera)
https://forum.hardware.fr/hfr/VideoSon/Traitement-Video/conversion-incompatible-appareil-sujet_157538_2.htm#t2367640
PS : I tried to copy/paste an existing video located on the device + renumbering, and it works perfectly, so the problem is not there.
SeeMoreDigital
20th February 2025, 14:31
Your Dropbox links want people to "sign up" for their service, which I don't want to do!
cedico
20th February 2025, 14:40
Oh sorry, I thought Dropbox allowed you to download anonymously...
Anyway, I've changed the links. Is it ok now ?
Emulgator
21st February 2025, 23:43
The same: Big G requires personal login credentials here. What about wetransfer.com ?
Inbetween you may add mediaInfo of camera file and your encoding attempt file(s) and which encoder and which settings were used.
BTW. MJPEG in FHD is not everyday's choice, the bitrate should be rather high (more than BD-Bitrate ?),
unexpected high for a children's cam, and then on SD. Just curious.
P.S. Well, Generalplug AviPackerV3.
If some bright mind decided to compress further additionally applying non-video data reduction algos, then you are out of luck.
Proprietary solution to bind you to that cam forever.
cedico
22nd February 2025, 11:55
Ok, I've uploaded and shared the 2 movie files using another website (WeTransfer keeps files only during 7 days apparently). The links below has been updated in the initial post.
Is it ok now ?
Here the main command line i've used to encode the file :
ffmpeg -i "D:\Les petites princesses du monde.mp4" -s 1920x1080 -c:v mjpeg -q:v 5 -ac 1 -c:a pcm_s16le -ar 16000 "D:\Les petites princesses du monde 1080p.avi"
Concerning the Generalplug AviPackerV3, I've found something very interesting here :
https://github.com/wythe-lin/ZTKVR/blob/master/application/avi_packer_src/src/AviPackerV3.c
Even if this pack encoder is more than 10 years old, maybe it contains interesting data that could help me to re-encode my video?
Emulgator
22nd February 2025, 15:20
Yes, downloaded fine. MOVI0075.avi is straight decodable here,
mediainfo shows MJPEG FHD 30p 8-bit 4:2:0@ 25,5Mbps + PCM 1.0 16 bit @fs 16kHz, nothing odd.
Your encode has completely different parameters and is not comparable. Or is it not your encode ?
"Les petites princesses du monde.mp4" has wrong codecs/parameters.
399kbps AV1 1280x720x30p 8-bit 4:2:0 + 128kbps LC-AAC 2.0 @ 44,1kHz
AV1+AAC can definitely not be decoded by a children's cam, at least not from the past.
P.S. I see. Not the encode, it is the source.
Please post your encode as well, otherwise we have no comparison.
Solution would be a full transcode with audio resampling, should be well possible in ffmpeg in one go,
but I would rather decode/encode streams separately...
cedico
22nd February 2025, 18:00
Your encode has completely different parameters and is not comparable. Or is it not your encode ?
I've tested thousand ways of encode such movies to obtain the same than "MOVI0075.avi", but no has worked (VLC, Avidemux, ffmpeg).
"Les petites princesses du monde.mp4" has wrong codecs/parameters.
399kbps AV1 1280x720x30p 8-bit 4:2:0 + 128kbps LC-AAC 2.0 @ 44,1kHz
AV1+AAC can definitely not be decoded by a children's cam, at least not from the past.
Yes, you're right, it is the point. My need is just to know how to encode this "Princess...mp4" video to MFPEG video, to finally obtain the "MOVI0075.avi" format that will be readable by the camera.
P.S. I see. Not the encode, it is the source.
Please post your encode as well, otherwise we have no comparison.
I'm sorry, I don't understand what you want me to give you. You want me to look something in the camera ?
The MOVI0075.avi file, is a file generated by the camera but I really don't know how the engineers did or how the camera hardware has encoded it.
I've just suspected that the camera was using Generalplug AviPackerV3, but it is a supposition because I've read this information in the HEXA movie file.
Solution would be a full transcode with audio resampling, should be well possible in ffmpeg in one go,
but I would rather decode/encode streams separately...
If you succeed in encoding the MP4 to generate a new file which will have the same format as "MOVI0075.avi", you are a genius! :)
Emulgator
23rd February 2025, 14:09
I've just suspected that the camera was using Generalplug AviPackerV3, but it is a supposition because I've read this information in the HEXA movie file.
yes, and if that deviates from what ffmpeg muxes if asked to pack the ES in.avi
AND the camera objects because it finds differences, or is just used to that subset,
then after any outside encode the mux would have to be done by the very same tool, Generalplug AviPackerV3.
"Your encode" would be the result of your ffmpeg commandline, if you could upload that attempt it might be useful to compare against, and if not..well, then not.
https://github.com/wythe-lin/ZTKVR/tree/master
is a good find and it could well be that the firmware of that children's cam has been compiled from that source, or a branch.
[feature]
( 1) GP6813 + ZT3120
( 2) AD key without over battery
( 3) screen saving
( 4) power off latency (5 sec)
( 5) gp_cardvr_upgrade.bin change to ztkvr_upgrade.bin
( 6)
[mapping list]
resource |
================+===============================
Better | K12 (spanish)
CarScam | DVR516
DIYLogo | DVR516 (sample)
E_Magic | DVR516
GRAWELCHRI | DVR516
KYMCO | DVR516 (sample)
LOUIS | DVR516
LZX | DVR516
MIET | K12
MTD | DVR516
ORDOR | DVR516
PatrolLine | K12 (Italian)
ProtectorEyes | K12
SKY_EYE | DVR516
X_Magic | DVR516K6 (DVR516 + K6000's lcd panel)
ZealTek | DVR516/DVR517
Entries look bogus somehow, DVR516 shows up as many different devices...
Care to name the children's cam Maker/Model ?
Z2697
23rd February 2025, 14:50
A simple guess is the optimized huffman table default in FFmpeg.
Use -huffman 0 to disable it.
(The bitrate will be even more bloated, of course)
cedico
23rd February 2025, 14:53
Your encode" would be the result of your ffmpeg commandline, if you could upload that attempt it might be useful to compare against, and if not..well, then not.
Here is one of my file encoding attempts with ffmpeg (using command in the above post):
https://limewire.com/d/40175e51-fb1a-409c-b2c5-f9f6ff0e71fe#Y1xhLinxykRSqzhGP8RrbHUa3V_ktw8Bcxqo7PnlPW0
Could you send one of your encoding method (command line with all params), for me to test please ?
Entries look bogus somehow, DVR516 shows up as many different devices...
Care to name the children's cam Maker/Model ?
But I've no idea how to use it..
cedico
23rd February 2025, 15:03
A simple guess is the optimized huffman table default in FFmpeg.
Use -huffman 0 to disable it.
Thank you Z2697 for your suggestion. I've tested but unfortunately, it does not work (I was optimist because the encoded file is 100 Mo bigger ;) )
Z2697
23rd February 2025, 16:01
Can you remux the recorded file with FFmpeg and see if it works? That way we can probably isolate the issue being muxer related or not.
SeeMoreDigital
23rd February 2025, 16:12
@ cedico,
What is the make and model or the camera. It would be very odd if it only supported just M-JPG video with PCM audio (within the .avi container) as the resulting file sizes are huge!
cedico
23rd February 2025, 16:14
Can you remux the recorded file with FFmpeg and see if it works? That way we can probably isolate the issue being muxer related or not.
when you talking about "recorded file", you mean the original file encoded by the camera? ("MOVI0075.avi" )
Sorry for my ignorance, but what do you mean by remux the movie?
Which tool and wich command line do you want me to use, to process the remuxing please?
cedico
23rd February 2025, 16:15
@ cedico,
What is the make and model or the camera. It would be very odd if it only supported just M-JPG video with PCM audio (within the .avi container) as the resulting file sizes are huge!
It is a very lite camera for children : HiMont Kids Camera Instant - KC01
(with thermal printing)
Z2697
23rd February 2025, 17:44
when you talking about "recorded file", you mean the original file encoded by the camera? ("MOVI0075.avi" )
Sorry for my ignorance, but what do you mean by remux the movie?
Which tool and wich command line do you want me to use, to process the remuxing please?
ffmpeg -i MOVI0075.avi -c copy MOVI0075_remux.avi
cedico
23rd February 2025, 17:56
ffmpeg -i MOVI0075.avi -c copy MOVI0075_remux.avi
That's a good test. But after having remuxed the file, and renamed it (with the good renumbering), the camera fails to read that movie.
As my previous tests, the camera detects there is a new file, but nothing more. :(
Emulgator
24th February 2025, 03:51
Using abcAVI to export properties and diffing both .txt files using WinMerge I find some mismatches, maybe junk entries from the cam.
number of planes, audio stream scale, audio stream rate...
MOVI0075.txt:
[RIFF AVI 12189688]: Audio/Video Interleaved File
[LIST hdrl 4064]: Format Definition Chunk
[avih 56]: Main AVI Header
[dwMicroSecPerFrame]: Microseconds Per Frame: 33333
[dwMaxBytesPerSec]: Maximum Bytes Per Second: 0
[dwPaddingGranularity]: Padding Granularity (bytes): 0
[dwFlags]: Flags 0x00000110
[AVIF_HASINDEX]: AVI file has 'idx1' chunk
[AVIF_ISINTERLEAVED]: AVI file is interleaved
[dwTotalFrames]: Number Of Frames: 130
[dwInitialFrames]: Numer Of Initial Frames: 0
[dwStreams]: Number Of Streams: 2
[dwSuggestedBufferSize]: Suggested Buffer Size (bytes): 0
[dwWidth]: Image Width (pixels): 1920
[dwHeight]: Image Height (pixels): 1080
[LIST strl 116]: Stream Format Definition Chunk
[strh 56]: Stream Header
[fccType]: Type: vids (Video Data)
[fccHandler]: Handler: mjpg (Motion JPEG including Huffman Tables 'mjpg' <0x67706A6D>)
[dwFlags]: Flags 0x00000000
[wPriority]: Stream Priority: 0
[wLanguage]: Language: 0 (Undefined)
[dwInitialFrames]: Numer Of Initial Frames: 0
[dwScale]: Stream Scale: 1
[dwRate]: Stream Rate: 30
[dwStart]: Stream Start: 0
[dwLength]: Stream Duration: 130
[dwSuggestedBufferSize]: Suggested Buffer Size (bytes): 119026
[dwQuality]: Stream Quality (1-10000): 0
[dwSampleSize]: Sample Size: 0
[rcFrame]: Frame Size Of Stream
[wX1]: Top: 0
[wY1]: Bottom: 0
[wX2]: Left: 1920
[wY2]: Right: 1080
[strf 40]: Video Stream Format
[biSize]: Header Size (bytes): 40
[biWidth]: Image Width (pixels): 1920
[biHeight]: Image Height (pixels): 1080
[biPlanes]: Number Of Planes: 0
[biBitCount]: Number Of Bits Per Pixel: 24
[biCompression]: Compression Algorithm: MJPG (Motion JPEG including Huffman Tables 'MJPG' <0x47504A4D>)
[biSizeImage]: Image Size (bytes, 0 = uncompressed): 6220800
[biXPelsPerMeter]: Horizontal resolution of target device: 0
[biYPelsPerMeter]: Vertical resolution of target device: 0
[biClrUsed]: Number of colors used (0 = maximum): 0
[biClrImportant]: Number of important colors (0 = all): 0
[LIST strl 92]: Stream Format Definition Chunk
[strh 56]: Stream Header
[fccType]: Type: auds (Audio Data)
[fccHandler]: Handler: 0x00000001 (Run length encoded 8bpp RGB image <0x00000001>)
[dwFlags]: Flags 0x00000000
[wPriority]: Stream Priority: 0
[wLanguage]: Language: 0 (Undefined)
[dwInitialFrames]: Numer Of Initial Frames: 0
[dwScale]: Stream Scale: 2
[dwRate]: Stream Rate: 32000
[dwStart]: Stream Start: 0
[dwLength]: Stream Duration: 64000
[dwSuggestedBufferSize]: Suggested Buffer Size (bytes): 0
[dwQuality]: Stream Quality (1-10000): 0
[dwSampleSize]: Sample Size: 2
[rcFrame]: Frame Size Of Stream
[wX1]: Top: 0
[wY1]: Bottom: 0
[wX2]: Left: 0
[wY2]: Right: 0
[strf 16]: Audio Stream Format
[wFormatTag]: Audio Format: 0x0001 (Microsoft PCM Format <0x0001>)
[nChannels]: Number of channels: 1
[nSamplesPerSec]: Frequency of the sample rate (Hz): 16000
[nAvgBytesPerSec]: Average data rate (byte/s): 32000
[nBlockAlign]: Block alignment of the data (bytes): 2
[wBitsPerSample]: Number of bits per sample (0 = undefined): 16
[cbSize]: Size of extra information (bytes): 0
[JUNK 3764]: Padding
[LIST movi 12071940]: Audio/Video Data
Skipped
[JUNK 48112]: Padding
[idx1 2144]: AVI Index Chunk
[LIST INFO 4]: RIFF Textual Informative Details
[JUNK 63372]: Padding
###################
Les petites princesses du monde 1080p.txt :
[RIFF AVI 573288810]: Audio/Video Interleaved File
[LIST hdrl 8892]: Format Definition Chunk
[avih 56]: Main AVI Header
[dwMicroSecPerFrame]: Microseconds Per Frame: 33333
[dwMaxBytesPerSec]: Maximum Bytes Per Second: 57000
[dwPaddingGranularity]: Padding Granularity (bytes): 0
[dwFlags]: Flags 0x00000910
[AVIF_HASINDEX]: AVI file has 'idx1' chunk
[AVIF_ISINTERLEAVED]: AVI file is interleaved
[AVIF_TRUSTCKTYPE]: use chunk type to find key frames
[dwTotalFrames]: Number Of Frames: 6196
[dwInitialFrames]: Numer Of Initial Frames: 0
[dwStreams]: Number Of Streams: 2
[dwSuggestedBufferSize]: Suggested Buffer Size (bytes): 1048576
[dwWidth]: Image Width (pixels): 1920
[dwHeight]: Image Height (pixels): 1080
[LIST strl 4320]: Stream Format Definition Chunk
[strh 56]: Stream Header
[fccType]: Type: vids (Video Data)
[fccHandler]: Handler: MJPG (Motion JPEG including Huffman Tables 'MJPG' <0x47504A4D>)
[dwFlags]: Flags 0x00000000
[wPriority]: Stream Priority: 0
[wLanguage]: Language: 0 (Undefined)
[dwInitialFrames]: Numer Of Initial Frames: 0
[dwScale]: Stream Scale: 1
[dwRate]: Stream Rate: 30
[dwStart]: Stream Start: 0
[dwLength]: Stream Duration: 6196
[dwSuggestedBufferSize]: Suggested Buffer Size (bytes): 130138
[dwQuality]: Stream Quality (1-10000): -1
[dwSampleSize]: Sample Size: 0
[rcFrame]: Frame Size Of Stream
[wX1]: Top: 0
[wY1]: Bottom: 0
[wX2]: Left: 1920
[wY2]: Right: 1080
[strf 40]: Video Stream Format
[biSize]: Header Size (bytes): 40
[biWidth]: Image Width (pixels): 1920
[biHeight]: Image Height (pixels): 1080
[biPlanes]: Number Of Planes: 1
[biBitCount]: Number Of Bits Per Pixel: 24
[biCompression]: Compression Algorithm: MJPG (Motion JPEG including Huffman Tables 'MJPG' <0x47504A4D>)
[biSizeImage]: Image Size (bytes, 0 = uncompressed): 6220800
[biXPelsPerMeter]: Horizontal resolution of target device: 0
[biYPelsPerMeter]: Vertical resolution of target device: 0
[biClrUsed]: Number of colors used (0 = maximum): 0
[biClrImportant]: Number of important colors (0 = all): 0
[JUNK 4120]: Padding
[vprp 68]: AVI2 (OpenDML) Video Header
[LIST strl 4220]: Stream Format Definition Chunk
[strh 56]: Stream Header
[fccType]: Type: auds (Audio Data)
[fccHandler]: Handler: 0x00000001 (Run length encoded 8bpp RGB image <0x00000001>)
[dwFlags]: Flags 0x00000000
[wPriority]: Stream Priority: 0
[wLanguage]: Language: 0 (Undefined)
[dwInitialFrames]: Numer Of Initial Frames: 0
[dwScale]: Stream Scale: 1
[dwRate]: Stream Rate: 16000
[dwStart]: Stream Start: 0
[dwLength]: Stream Duration: 3305407
[dwSuggestedBufferSize]: Suggested Buffer Size (bytes): 744
[dwQuality]: Stream Quality (1-10000): -1
[dwSampleSize]: Sample Size: 2
[rcFrame]: Frame Size Of Stream
[wX1]: Top: 0
[wY1]: Bottom: 0
[wX2]: Left: 0
[wY2]: Right: 0
[strf 16]: Audio Stream Format
[wFormatTag]: Audio Format: 0x0001 (Microsoft PCM Format <0x0001>)
[nChannels]: Number of channels: 1
[nSamplesPerSec]: Frequency of the sample rate (Hz): 16000
[nAvgBytesPerSec]: Average data rate (byte/s): 32000
[nBlockAlign]: Block alignment of the data (bytes): 2
[wBitsPerSample]: Number of bits per sample (0 = undefined): 16
[cbSize]: Size of extra information (bytes): 0
[JUNK 4120]: Padding
[JUNK 260]: Padding
[LIST INFO 26]: RIFF Textual Informative Details
[ISFT 14]: Software Used: Lavf61.9.101
[JUNK 1016]: Padding
[LIST movi 573037328]: Audio/Video Data
Skipped
[idx1 241504]: AVI Index Chunk
Is it worth the hacking ? You decide.
cedico
24th February 2025, 10:00
Is it worth the hacking ? You decide.
Yes, of course. I always need to learn.
Yes, for the Junk/metadata differences between files, I actually observed this, using GSpot (please see the 2 forums urls I've posted above).
But I never succeed in playing/hacking with these junks.
Could you show me what you would try to change ? and how you would do please ?
I've already tested such a command line with (-map_metadata 0 -movflags +faststart) but without success :
ffmpeg -i "MOVI0075.avi" -i "a.avi" -map 1 -c copy -map_metadata 0 -movflags +faststart "b.avi"
Emulgator
24th February 2025, 14:29
You would hexedit your way through until the file is accepted by your babycam.
I gave 3 hints, you have the babycam to check your results, not me.
cedico
24th February 2025, 14:50
You would hexedit your way through until the file is accepted by your babycam.
I gave 3 hints, you have the babycam to check your results, not me.
I'm not sure to understand, which hint ?
I need to know how to do please. Are you advising me to edit directly the hexa file ? I would need more details please.
Which movie tool may replace efficiently these data ? (doing this with Notepadd++ is complicated)
Which data to edit and replace ?
As you can imagine, the final goal is to be abble to get any mp4 files, and convert these one to be fully compatible with the camera.
Blue_MiSfit
27th February 2025, 03:17
My kid has a similar little toy camera / phone thing :) I've found that it can actually decode xvid + mp3 just fine, so long as I keep the resolution low. I think I basically do like 360p at 500 Kbps which is totally fine on a tiny little screen.
cedico
27th February 2025, 10:43
My kid has a similar little toy camera / phone thing :) I've found that it can actually decode xvid + mp3 just fine, so long as I keep the resolution low. I think I basically do like 360p at 500 Kbps which is totally fine on a tiny little screen.
That a great new ! :)
Would you accept to share me a little XVID file you've encoded by yourself, so that I can test if it works on my camera ?
Losko
27th February 2025, 11:38
HiMont Kids Camera Instant - KC01
(with thermal printing)
My silly question:
have you checked for firmware updates for that camera?
cedico
27th February 2025, 12:13
My silly question:
have you checked for firmware updates for that camera?
Yes, but it a is child camera there is no Support or firmware available on the site.
Moreover, I don't have any problem to Record or play a video from the camera. I'm just looking for a way to put some full compatible new videos in the SD card.
Here it is the website:
https://www.himont.us/products/himont-kids-camera-instant-print-digital-camera-for-kids-with-zero-ink-print-paper-32g-tf-card-selfie-video-camera-with-color-pens-photo-clips-for-diy-gift-for-girls-boys-3-12-years-old-pink
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.