Let me a be a bit more precise about that.
The atomcontainer that I'm passing into
MovieExportSetSettingsFromAtomContainer before calling
MovieExportDoUserDialog looks like this:
AtomContainer: 5 children
'vide' Children: 6 (6 children)
'sptl'
...
'hegt'
'envi' <01> (0 children)
'enso' <01> (0 children)
'save' Children: 1 (1 children)
'fast'
'soun' <> (0 children)
====
If I check the sound checkbox in the export settings, I get the
settings shown below afterwards. If I don't check the checkbox,
then I get an identical structure, except that the 'enso' atom is
absent after the dialog (I misspoke when I mentioned
kQTSettingsSound in my previous post).
If I don't run the settings dialog at all, and just export using
the setting above directly, everything seems ok, except that I
get no sound.
=====
AtomContainer: 6 children
'vide' Children: 17 (17 children)
'sptl'
...
'hegt'
'isiz' Children: 7 (7 children)
'iwdt'
...
'uenf'
'soun' Children: 5 (5 children)
'ssct'
'ssrt'
'ssss'
'sscc'
'vers'
'envi' <01> (0 children)
'enso' <01> (0 children) <<<< This one is absent if the sound
checkbox is unchecked
'save' Children: 2 (2 children)
'fast'
'ssty'
On 30 Jun 2007, at 02:22, Martin Redington wrote:
I've run into exactly the same problem as Ivan below. I can't
get the Audio checkbox in the Export settings dialog to be
initially checked.
Jan E. Schotsman suggested in a follow-up inspecting the atoms
before and after the settings dialog to see what's changed. I
tried that.
The only difference I could spot was that the kQTSettingsSound
atom was populated when the export sound checkbox was ticked in
the dialog.
Does this mean I need to pre-populate kQTSettingsSound before
opening the settings dialog? That seems a little bit extreme
when all I want to do is get the checkbox ticked.
kQTSettingsMovieExportEnableSound just seems to control the
enablement of the checkbox, not whether its checked or not.
Subject: Sound disabled when trying to export
From: Ivan Huterer <email@hidden>
Date: Fri, 23 Feb 2007 23:28:49 +0000
Delivered-to: email@hidden
Delivered-to: email@hidden
Importance: Normal
I've been banging my head on this problem for days and searched
all over for an answer but I'm stumped. I'm hoping someone can
help me out.
I'm trying to write a simple program to automate a daily
conversion of a WMV (with the Flip4Mac codecs installed) file
into an M4V file that can be played on my iPod. As a reference
I've been using the ThreadsExport sample code and modifying it
for my use, and largely it has been working fine. However, the
problem that I'm having is that when I initially load the WMV
both video and audio work fine, but when I try to export
(without using the export dialog) the video comes through fine
but no sound.
In trying to troubleshoot, I reenabled the export dialog to see
what settings are being made and sure enough, whenever I try to
export the video checkbox is enabled but the Sound is disabled
(although it can be enabled if I click on it by hand, so it is
at least possible). I've tried everything that I can think of
but no matter what I do programmatically the Sound checkbox is
disabled by default. I'm inserting an atom for
kQTSettingsMovieExportEnableSound, but it doesn't seem to do
anything.
I should note that if I use the QuickTime player to load and
export the movie, it (both video and audio) exports fine, so
there doesn't seem to be any technical reason why this
shouldn't work.
Here's the (what I believe to be the most relevant) chunk of
code - if someone can tell me what I'm doing wrong I'd be
grateful.
Ivan
if (gExportSettings != NULL) {
UInt32 aLong = 0;
UInt8 aChar;
QTAtom videAtom = 0;
QTAtom sndAtom = 0;
QTAtom saveAtom = 0;
aChar = true;
err = QTInsertChild( gExportSettings,
kParentAtomIsContainer, kQTSettingsMovieExportEnableVideo, 1,
0, sizeof(aChar), &aChar, nil );
aChar = true;
err = QTInsertChild( gExportSettings,
kParentAtomIsContainer, kQTSettingsMovieExportEnableSound, 1,
0, sizeof(aChar), &aChar, nil );
// video options
videAtom = QTFindChildByID( gExportSettings,
kParentAtomIsContainer, kQTSettingsVideo, 1, nil );
if (videAtom == 0)
err = QTInsertChild( gExportSettings,
kParentAtomIsContainer, kQTSettingsVideo, 1, 0, 0, nil,
&videAtom );
sndAtom = QTFindChildByID( gExportSettings,
kParentAtomIsContainer, kQTSettingsSound, 1, nil );
if (sndAtom == 0)
err = QTInsertChild( gExportSettings,
kParentAtomIsContainer, kQTSettingsSound, 2, 0, 0, nil,
&sndAtom );
aLong = FixRatio(44000,1);
aLong = EndianU32_NtoB(aLong);
err = QTInsertChild( gExportSettings, sndAtom,
scSoundSampleRateType, 10, 0, sizeof(aLong), &aLong, nil );
short channels = 1;
err = QTInsertChild( gExportSettings, sndAtom,
scSoundChannelCountType, 11, 0, sizeof(short), &channels, nil );
aLong = FixRatio(320,1);
aLong = EndianU32_NtoB(aLong);
err = QTInsertChild( gExportSettings, videAtom,
movieExportWidth, 1, 0, sizeof(aLong), &aLong, nil );
aLong = FixRatio(240,1);
aLong = EndianU32_NtoB(aLong);
err = QTInsertChild( gExportSettings, videAtom,
movieExportHeight, 1, 0, sizeof(aLong), &aLong, nil );
}
_______________________________________________
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:
40ucl.ac.uk
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:
40apple.com
This email sent to email@hidden