Parsing MP4 variants within Quicktime MOV containers

What features would you like to see in future versions of getID3() ?

Parsing MP4 variants within Quicktime MOV containers

Postby filmo » Sun Jan 13, 2008 2:41 pm

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.
filmo
User
 
Posts: 11
Joined: Fri Dec 08, 2006 2:16 pm
Location: Los Angeles

Postby Allan Hansen » Sun Jan 13, 2008 4:20 pm

Take a look at the audio.mpc module. The mpc module is very simple and the module is the closest thing to a template.
Allan Hansen
getID3() v2 developer
 
Posts: 447
Joined: Sun May 04, 2003 9:22 am
Location: Holmegaard, Denmark

Postby James Heinrich » Sun Jan 13, 2008 5:38 pm

If you have them available, I'd be interested in some small sample files as you describe (mpeg4/h264 in mov).
James Heinrich
getID3() v1 developer
 
Posts: 702
Joined: Fri May 04, 2001 11:00 am
Location: Kingston, ON, Canada

I'll post some small samples soon

Postby filmo » Mon Jan 14, 2008 12:40 pm

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.
filmo
User
 
Posts: 11
Joined: Fri Dec 08, 2006 2:16 pm
Location: Los Angeles

Postby James Heinrich » Mon Jan 14, 2008 8:51 pm

That would be perfect. If it's not too much trouble, I prefer a download link from your server. But if they're <= 1MB then emailing them is OK too. Thanks.
James Heinrich
getID3() v1 developer
 
Posts: 702
Joined: Fri May 04, 2001 11:00 am
Location: Kingston, ON, Canada

Links to Quicktime and MP4 video clips.

Postby filmo » Tue Jan 15, 2008 2:11 pm

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.

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;



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.
filmo
User
 
Posts: 11
Joined: Fri Dec 08, 2006 2:16 pm
Location: Los Angeles

Re: Parsing MP4 variants within Quicktime MOV containers

Postby amujolly » Mon May 17, 2010 5:06 am

Is there a way to upload files from itunes onto my mp4 player? I just got an mp4 player and i keep all of my songs on itunes. I want to put the songs and videos from itunes onto my mp4. Is there a way?
amujolly
User
 
Posts: 1
Joined: Mon May 10, 2010 2:32 am


Return to Wishlist

Who is online

Users browsing this forum: No registered users and 1 guest

cron