would love to see better support for reading video information on MOV files containing:
Apple MPEG4 within a MOV container.
H.264 within a MOV container.
Is there a generic 'module' template that we can use as developer as a guideline for building a module. I've looked at a couple of the already developed modules, but it's be great if there was a highly documented one that spelled out the steps necessary for building a module.
Parsing MP4 variants within Quicktime MOV containers
-
- User
- Posts:22
- Joined:Fri Dec 08, 2006 7:16 pm
- Location:Los Angeles
-
- getID3() v2 developer
- Posts:445
- Joined:Sun May 04, 2003 2:22 pm
- Location:Holmegaard, Denmark
-
- getID3() v1 developer
- Posts:1477
- Joined:Fri May 04, 2001 4:00 pm
- Are you a spambot?:no
- Location:Northern Ontario, Canada
- Contact:
-
- User
- Posts:22
- Joined:Fri Dec 08, 2006 7:16 pm
- Location:Los Angeles
I'll post some small samples soon
I'll create some 240x180 quicktime files with H.264 and Apple MPEG4 contained within each separate file. Probably about 30 seconds long each in order to keep the size down.
If they're small enough, I can email them to you otherwise I can post to our server and provide you with a download link.
If they're small enough, I can email them to you otherwise I can post to our server and provide you with a download link.
-
- getID3() v1 developer
- Posts:1477
- Joined:Fri May 04, 2001 4:00 pm
- Are you a spambot?:no
- Location:Northern Ontario, Canada
- Contact:
-
- User
- Posts:22
- Joined:Fri Dec 08, 2006 7:16 pm
- Location:Los Angeles
Links to Quicktime and MP4 video clips.
Hi here's a set of links:
Raw MP4 files:
http://www.ridiculousprods.com/gas/320x ... G4_AAC.mp4
Encoded using Apple MPEG 4, AAC for audio (stereo 44.1khz), 320x240 (letterboxed), 12 fps
http://www.ridiculousprods.com/gas/320x240_H264_AAC.mp4
Encoded using H.264, AAC for audio (stereo 44.1khz), 320x240 (letterboxed), 29.97 fps
Here are the Quicktime Container Versions:
http://www.ridiculousprods.com/gas/320x ... G4_AAC.mov
Encoded using Apple MPEG 4, AAC for audio (stereo 44.1khz), 320x180 (16:9), 12 fps
http://www.ridiculousprods.com/gas/320x180_H264_AAC.mov
Encoded using H.264, AAC for audio (stereo 44.1khz), 320x180 (16:9), 12 fps
iPod Video
http://www.ridiculousprods.com/gas/ipod.m4v
Encoded using H.264, AAC for audio (stereo 44.1khz), 640x360 (16:9). It plays at 30 fps, but Quicktime 'read' the fps at 1.35 when opened in Quicktime 7.3.1
My grok that helped somewhat in the current module.audio-video.quicktime.php was to add this change in several places. It seems like some Quicktime files contain an almost infinite loop of subatoms, particularly if they're large. This code helped to avoid 'out-of-memory' conditions and slow performance. I don't fully understand the subatoms, so it's certainly just a hack.
Using these 4 files, the module.audio-video.quicktime.php correctly reports the length, audio sample rate, and bit rate for the MOV files.
For the MP4 files however I get inconsistent results. The Apple MPEG 4 file doesn't provide useful results at all. The H.264 one gives the correct file length, but fails to identify the frequency rate of the audio.
I suspect processing for ".mp4" files is handled by module.audio-video.mpeg.php instead of the quicktime module. I've not made any changes to this one.
Perhaps the sample rates, lengths, and audio frequencies are stored in a separate location in Quicktime Containers versus a raw MP4 file, but I don't know.
I've not tried getID3 on the iPod video but that seems to be a popular format as well, so I've included it.
Raw MP4 files:
http://www.ridiculousprods.com/gas/320x ... G4_AAC.mp4
Encoded using Apple MPEG 4, AAC for audio (stereo 44.1khz), 320x240 (letterboxed), 12 fps
http://www.ridiculousprods.com/gas/320x240_H264_AAC.mp4
Encoded using H.264, AAC for audio (stereo 44.1khz), 320x240 (letterboxed), 29.97 fps
Here are the Quicktime Container Versions:
http://www.ridiculousprods.com/gas/320x ... G4_AAC.mov
Encoded using Apple MPEG 4, AAC for audio (stereo 44.1khz), 320x180 (16:9), 12 fps
http://www.ridiculousprods.com/gas/320x180_H264_AAC.mov
Encoded using H.264, AAC for audio (stereo 44.1khz), 320x180 (16:9), 12 fps
iPod Video
http://www.ridiculousprods.com/gas/ipod.m4v
Encoded using H.264, AAC for audio (stereo 44.1khz), 640x360 (16:9). It plays at 30 fps, but Quicktime 'read' the fps at 1.35 when opened in Quicktime 7.3.1
My grok that helped somewhat in the current module.audio-video.quicktime.php was to add this change in several places. It seems like some Quicktime files contain an almost infinite loop of subatoms, particularly if they're large. This code helped to avoid 'out-of-memory' conditions and slow performance. I don't fully understand the subatoms, so it's certainly just a hack.
Code: Select all
case 'stsd': // Sample Table Sample Description atom
$atomstructure['version'] = getid3_lib::BigEndian2Int(substr($atomdata, 0, 1));
$atomstructure['flags_raw'] = getid3_lib::BigEndian2Int(substr($atomdata, 1, 3)); // hardcoded: 0x0000
$atomstructure['number_entries'] = getid3_lib::BigEndian2Int(substr($atomdata, 4, 4));
// limit recurrsion into subatoms - phil glau
if ($atomstructure['number_entries'] > 10) {
$atomstructure['number_entries'] = 10;
}
// end of modification by phil glau
$stsdEntriesDataOffset = 8;
For the MP4 files however I get inconsistent results. The Apple MPEG 4 file doesn't provide useful results at all. The H.264 one gives the correct file length, but fails to identify the frequency rate of the audio.
I suspect processing for ".mp4" files is handled by module.audio-video.mpeg.php instead of the quicktime module. I've not made any changes to this one.
Perhaps the sample rates, lengths, and audio frequencies are stored in a separate location in Quicktime Containers versus a raw MP4 file, but I don't know.
I've not tried getID3 on the iPod video but that seems to be a popular format as well, so I've included it.