Page 1 of 1

simplest ffmpeg audio encoder

Posted: Fri May 09, 2014 4:24 pm
by leixiaohua1020
I make a simplest audio encoder .It only uses about 100 lines of code.
And I want to share it to help new developer of FFmpeg to learn FFmpeg's API.
It is based on VC 2010, and use the latest ffmpeg's lib.
Everything is done and you only need to do is to run the project.
It encode PCM data to AAC streams:
https://sourceforge.net/projects/simple ... ioencoder/

Re: simplest ffmpeg audio encoder

Posted: Fri May 16, 2014 10:44 am
by ragdog86
thanks for the posts leixiaohua1020 these help alot,
I try make ip multiviewer based your code , every things ok but i'm confusing volume meter,
I can not get value of volume that synchonize with video display
can you help me walk through this,
Anyway thanks alot and love your posts :)

Re: simplest ffmpeg audio encoder

Posted: Fri Jun 06, 2014 4:50 am
by leixiaohua1020
Hello, I'm not sure if volume is one of ffmpeg's parameter. Maybe it's belong to operating system but not belong to ffmpeg? I'm not sure about it.

Re: simplest ffmpeg audio encoder

Posted: Mon Jun 09, 2014 8:50 am
by ragdog86
Hi thanks for reply, in your previous post , you retrieve audio data from packet by
avcodec_decode_audio4(is->audio_st->codec, pFrame, &frameFinished,packet)
and you write pFrame->data[0] array to ppm file so
i think i can take my volume bar by using some value of pFrame->data[0] array
is that right ??

Re: simplest ffmpeg audio encoder

Posted: Sun Oct 19, 2014 6:41 am
by leixiaohua1020
ragdog86 wrote:Hi thanks for reply, in your previous post , you retrieve audio data from packet by
avcodec_decode_audio4(is->audio_st->codec, pFrame, &frameFinished,packet)
and you write pFrame->data[0] array to ppm file so
i think i can take my volume bar by using some value of pFrame->data[0] array
is that right ??
Oh, sorry these days I haven't visit this forum. :)
Maybe you have already solved your problem~

Re: simplest ffmpeg audio encoder

Posted: Thu Mar 31, 2016 11:57 am
by Taha
Hello Sir,
Thanks for this wonderful code, but this sample code is not running with Latest FFMpeg 3.0.
Kindly guide me how to make it works with latest FFMpeg.

Thank you

Re: simplest ffmpeg audio encoder

Posted: Thu Apr 14, 2016 12:48 am
by YJJ
hi, leixiaohua1020

thanks for your wonderful code.

but there is one thing I want to ask you.

I actually downloaded your code and try to convert jpg files to a video file(MJPEG type).

how can I change to make it work based on your code.

I need your advice for it. would you help me please _?