Issue 86 in mp4v2: Mp4 writing a mulaw audio as mp4audio

已查看 84 次
跳至第一个未读帖子

mp...@googlecode.com

未读,
2011年3月11日 21:30:242011/3/11
收件人 mp...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 86 by aswin.pa...@gmail.com: Mp4 writing a mulaw audio as mp4audio
http://code.google.com/p/mp4v2/issues/detail?id=86

Hi,

i'm trying to write the audio sample to the mp4 container by setting the
audio type as MULAW with 8000hz as sample and mono channel.

when i try to play using vlc or any other player, i dont hear a thing and
vlc shows the audio format as mp4a.

can anybody let me know what i have done wrong.

here is the code snippet.

MP4FileHandle mp4_file = MP4Create("out.mp4", 0);//

MP4TrackId mp4_video_track = MP4AddH264VideoTrack (mp4_file, 50000, 2500,
704, 576,
0x64, //sps[1] AVCProfileIndication
0x00, //sps[2] profile_compat
0x1f, //sps[3] AVCLevelIndication
3 ); // 4 bytes length before each NAL unit
MP4SetVideoProfileLevel(mp4_file, 1);// 0x7F);


MP4TrackId mp4_audio_track = MP4AddAudioTrack( mp4_file, 44100,
MP4_INVALID_DURATION,
MP4_ULAW_AUDIO_TYPE);
if( mp4_audio_track == MP4_INVALID_TRACK_ID ) {
cout << "MP4AddAudioTrack error" << endl;
return false;
}
//MP4SetAudioProfileLevel( mp4_file, 0x0f ); //??

bool a = MP4SetTrackIntegerProperty( mp4_file, mp4_audio_track,
"mdia.minf.stbl.stsd.mp4a.channels", 1); //Set a single audio
channel


int ac = MP4GetTrackAudioChannels(mp4_file, mp4_audio_track); // only
check
u_int8_t tes= MP4GetTrackAudioMpeg4Type(mp4_file,mp4_audio_track);

.
.
.
.
if( !MP4WriteSample( mp4_file, mp4_audio_track, audio, alen,
5000, 0, false ) ) {
cout << "WARNING: MP4WriteSample failed" << endl;
break;
}

Thanks Aswin

mp...@googlecode.com

未读,
2011年3月12日 15:23:542011/3/12
收件人 mp...@googlegroups.com
Updates:
Status: Duplicate
Mergedinto: 87

Comment #1 on issue 86 by kidjan: Mp4 writing a mulaw audio as mp4audio
http://code.google.com/p/mp4v2/issues/detail?id=86

(No comment was entered for this change.)

mp...@googlecode.com

未读,
2015年7月6日 22:23:442015/7/6
收件人 mp...@googlegroups.com

Comment #2 on issue 86 by rub...@gmail.com: Mp4 writing a mulaw audio as
mp4audio
https://code.google.com/p/mp4v2/issues/detail?id=86

You should use API "MP4AddULawAudioTrack" because "MP4AddAudioTrack" set
audio format "mp4a" in mp4v2 source code.
Also, I'm trying this and encountering some problem
about "MP4SetTrackIntegerProperty" fail.
If you have good result, maybe we can discuss it, thx!!

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
回复全部
回复作者
转发
0 个新帖子