[Libav-user] Transcoding example(transcoding.c) doesn't work for me

Mihai Banu mihai.banu at hotmail.com
Tue Aug 11 11:05:25 CEST 2015

I've been trying to use transcoding.c as a starting place for my project and I can't seem to get it to work properly.
I have an .mp4 file that I want to transcode to .avi...all good until now.  
When transcoding it fails saying that I should use the aac_adtstoasc filter.
I looked around the internet for quite some time and I added the following code near line 367, before the ret = av_interleaved_write_frame(ofmt_ctx, &enc_pkt):
if (ifmt_ctx->streams[stream_index]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
   AVBitStreamFilterContext* aacbsfc = av_bitstream_filter_init("aac_adtstoasc");
   av_bitstream_filter_filter(aacbsfc, ifmt_ctx->streams[stream_index]->codec, NULL, &enc_pkt.data, &enc_pkt.size, enc_pkt.data, enc_pkt.size, 0);
 Now it passes, generates the file but I can't open the file in anything other than VLC. BSplayer even crashes with a seg fault. Looks like ffmpeg doesn't write the headers properly
What am I doing wrong? (I'm using the latest version of FFMPEG) 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20150811/6ebe04eb/attachment.html>

More information about the Libav-user mailing list