Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Shortcut converting MOV to MP4/M4V
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shortcut converting MOV to MP4/M4V



Dear Michael,
I am not expert on QT SDK, but I saw complete functionality in mp4lib. It is part of mpeg4ip project. Just download the complete package from http://mpeg4ip.sourceforge.net/ and find mp4lib there. I found it useful for managing 'mp4' files. I hope it help you too.

Regards,
* Roozbeh

----- Original Message ----
From: Michael Luongo <email@hidden>
To: Henry Mason <email@hidden>
Cc: email@hidden
Sent: Saturday, November 17, 2007 1:45:19 AM
Subject: Re: Shortcut converting MOV to MP4/M4V


Thanks for your response. I have tried what you recommended and I can't
 get
it to work. I take a mov file with h-264 and AAC mono (we only paid for
 mono
license) and use the exporter and it is converted to mpeg 4, stereo
 AAC. I
tried both setting the two attoms as "past" or a boolean value of 1. Do
 you
see anything wrong with the code? Thanks again. -Mike


// Open the MPG4 export component.
   err = OpenADefaultComponent( MovieExportType, kQTFileTypeMP4,
&movieExporter );
   if (err || !movieExporter) goto bail;

   err = MovieExportGetSettingsAsAtomContainer( movieExporter,
&atomContainerSettings );

   QTAtom atom = QTFindChildByID(atomContainerSettings,
kParentAtomIsContainer, kQTSettingsMovieExportEnableVideo, 1, NULL);

   err = QTRemoveAtom( atomContainerSettings, atom );

   atom = QTFindChildByID(atomContainerSettings,
 kParentAtomIsContainer,
kQTSettingsMovieExportEnableSound, 1, NULL);

   QTRemoveAtom( atomContainerSettings, atom );

   FOURCC fccPast = 'past';
   Boolean b_true = true;

   err = QTInsertChild( atomContainerSettings, kParentAtomIsContainer,
kQTSettingsMovieExportEnableVideo,
      1, 0, sizeof(fccPast), &fccPast, NULL);

   err = QTInsertChild( atomContainerSettings, kParentAtomIsContainer,
kQTSettingsMovieExportEnableSound,
      1, 0, sizeof(fccPast), &fccPast, NULL);

   err = MovieExportSetSettingsFromAtomContainer( movieExporter,
atomContainerSettings );

   AliasHandle alias;
   err = QTNewAlias(&MovFileSpec, &alias, true);

   MovieExportToDataRef( movieExporter, (Handle)alias, rAliasType,
 theMovie,
0, 0, GetMovieDuration(theMovie) );

   if (alias)
      DisposeHandle((Handle) alias);

   err = QTDisposeAtomContainer( atomContainerSettings );

   CloseMovieFile(nFileRefNum);

   // Export the file.
   //err = ConvertMovieToFile( theMovie, NULL, &MovFileSpec, 0, 0,
fileScript, NULL, 0, movieExporter );

bail:
   if ( movieExporter )
      CloseComponent( movieExporter );





----- Original Message -----
From: "Henry Mason" <email@hidden>
To: "Michael Luongo" <email@hidden>
Cc: <email@hidden>
Sent: Friday, November 16, 2007 2:46 PM
Subject: Re: Shortcut converting MOV to MP4/M4V


> Use the the MP4 exporter with the "Pass through" option set for both
  the
> video and audio formats.
>
> To do this programmatically:
>
> 1) Open the MPEG-4 export component using OpenDefaultComponent with
> MovieExportType/kQTFileTypeMP4
> 2) Get the settings as an atom container using
> MovieExportGetSettingsAsAtomContainer
> 3) Set the child atoms of the settings container of types
> kQTSettingsMovieExportEnableVideo and
  kQTSettingsMovieExportEnableSound
> to be of value 'past' (use  QTInsertChild)
> 4) Use MovieExportSetSettingsFromAtomContainer to add the settings
  back
> to the component
> 5) Export it all using MovieExportToDataRef
>
> Note that step 3 is a bit of an undocumented hack, but it seems to
  work
> for now.
>
> -Henry
>
> On Nov 16, 2007, at 10:54 AM, Michael Luongo wrote:
>
>> I have encoded a MOV with H264 and AAC. I need to convert it to mp4/
 m4v
>> format. I can do this using the exporter component but it will
  reencode
>> everything and takes a long time. Is there any shortcut  from MOV to

>> MP4/M4V that will basically take the contents of the  MOV and change
 the
>> file format wrapper to MP4/M4V file? Or is it  possible to encode
>> directly to m4v/mp4? I would really like to go  straight to an
 mp4/m4v
>> using the ICMCompress functions, but this  does not appear to be an
>> option. So I am writing an MOV and then  doing a conversion with the

>> exporter. Thanks -Mike
>>  _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> QuickTime-API mailing list      (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>>
>> This email sent to email@hidden
>
>
>

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden





      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page.
http://www.yahoo.com/r/hs
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
QuickTime-API mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.