[Libav-user] 转发: ask for help
Alex Cohn
alexcohn at netvision.net.il
Thu Jul 7 09:42:52 CEST 2011
On Wed, Jul 6, 2011 at 03:58, 勃 王 <wb4701 at yahoo.com.cn> wrote:
> The file created only
> had video iformation without audio information. I think
> there must be some problem here.
>
> AVOutputFormat *fmt=guess_format ("h264", NULL, NULL);
> fmt->audio_codec=CODEC_ID_MP3;
> AVFormatContext pFormatCtx=av_alloc_format_contex();
> pFormatCtx-> oformat = fmt;
To mix video with audio you need one of the container formats, like
"mp4". "h264" extension belongs to a raw video stream, which is not
designed to keep audio.
Alex
More information about the Libav-user
mailing list