[FFmpeg-user] How to compress .MOV file compatible to Canon camera

Ted Park kumowoon1025 at gmail.com
Mon Mar 16 10:10:57 EET 2020


Hi,

>> There’s a huge user data box in the moov, upon a quick glance it has the camera model, firmware version, etc. I have to imagine it is used somehow.
> 
> Same question:
> Is the (original) file still playable if you edit this atom?

I’m not sure if you were asking about playback on the camera, but if you zero out the udta atom and change its type to “free” then it plays with no problem in standard players, it’s supposed to be non-specific metadata.


>> I now inserted the following:
>> 1. "CEAP" to ftyp (0x18 instead 0x14 bytes)
>> 2. moov atom with qt-faststart
>> 2. udta atom from original at the start of moov atom (increases it from 0x1340E to 0x1344A)
>> Result:
>> Instead of a big "?" I now see a the preview picture on the camera. Unfortunately I still can't play the video because of "Not identified Picture".
>> So we are a little step closer to the solution.
>> Any additional ideas?
I took another look, and saw EXIF, TIFF, thumbnail images. I don’t know if the camera would not play files without this data, you could test it out by doing what I described to a working movie, replace the udta box with null bytes and change its tag to free.

The file that works was very simple, it had a moov with some proprietary data, then the header with codec setup, etc. and free space until the media, which extends all the way to the end of the file.

If there was no wide marker/atom in the file that plays, I would try to make sure it’s not in the file you're producing. It might not be there because the camera might not handle it (maybe some limitation in its specs precludes 64bit size fields).

I took a look at the DCIM hierarchy on a canon point and shoot I found, and there seems to be some sort of index type metadata stored separately in a folder named (in my case) CANONMSC. 
I don’t know what it is, or if it’s used, but see if deleting those files makes everything break.

>> Yes, it would be a great help of a good tool to show and edit other atoms.
>> Which tool could be this?
>> Which ffmpeg loglevel command would show the atoms, even with less nice format?
> As I see from the qt-faststart output, I see, that there are some other atoms patched:
> $ qt-faststart MVI_1324_copy_git.mov MVI_1324_copy_git.MOV
> ftyp          0 20
> wide         20 8
> mdat         28 84830220
> moov   84830248 13326
>  patching stco atom...
>  patching stco atom...
>  writing ftyp atom...
>  writing moov atom...
>  copying rest of file...
> 
> So maybe I have to patch them again after inserting the udta atom, but how?

For ISO/MP4 type formats, if you want really fine grained control you most likely need to use one of the tools that are specific for that format, gpac or l-smash probably. But while this lets you control more specific attributes, it also means you need to know what to change to get the result you want. Off the top of my head mp4box and atomicparsley are some programs that do this. If you have a PPC Mac there’s an ancient version of “Atom Inspector” for quicktime that Apple provides.

Just curious, but what are you trying to do? Are you looking to play footage from other cameras? Or watch completely unrelated sources, like maybe saving a movie to watch it on your camera??

Regards,
Ted Park



More information about the ffmpeg-user mailing list