[Libav-user] Audio buffer to AVFrame

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Libav-user] Audio buffer to AVFrame

Denis Gottardello

 

 

Hi, I'm studying the encode_audio.c example.

I have a buffer

const uchar* data, int Length

that represent a stereo audio source in 44100, can someone suggest me how to fill an AVFrame or AVPacket?

 


--

+39.347.4070897

http://www.labcsp.com

http://www.denisgottardello.it

GMT+1

Skype: mrdebug


_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Audio buffer to AVFrame

Attila Krüpl
Hi Denis,

When encoding you want to fill your AVFrame with the raw audio data. 
You need to initialize AVFrame and set a buffer size. 
Then you need to fill it's buffer with that size of data.
You can split your own input buffer manually to fill AVFrame's buffer and then encode it (avcodec_send_frame) frame by frame.

Best Regards,

Attila


On Wed, 6 May 2020 at 15:56, Denis Gottardello <[hidden email]> wrote:

 

 

Hi, I'm studying the encode_audio.c example.

I have a buffer

const uchar* data, int Length

that represent a stereo audio source in 44100, can someone suggest me how to fill an AVFrame or AVPacket?

 


--

+39.347.4070897

http://www.labcsp.com

http://www.denisgottardello.it

GMT+1

Skype: mrdebug

_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Audio buffer to AVFrame

Denis Gottardello


Perfect, have you got an example for me or do you know where I can find an example on how to fill the buffer of the frame?

In data mercoledì 6 maggio 2020 16:18:29 CEST, Attila Krüpl ha scritto:

Hi Denis,


When encoding you want to fill your AVFrame with the raw audio data. 

You need to initialize AVFrame and set a buffer size. 

Then you need to fill it's buffer with that size of data.

You can split your own input buffer manually to fill AVFrame's buffer and then encode it (avcodec_send_frame) frame by frame.


Best Regards,


Attila



On Wed, 6 May 2020 at 15:56, Denis Gottardello <[hidden email]> wrote:

 

 

Hi, I'm studying the encode_audio.c example.

I have a buffer

const uchar* data, int Length

that represent a stereo audio source in 44100, can someone suggest me how to fill an AVFrame or AVPacket?

 


--

+39.347.4070897

http://www.labcsp.com

http://www.denisgottardello.it

GMT+1

Skype: mrdebug

_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".



--

+39.347.4070897

http://www.labcsp.com

http://www.denisgottardello.it

GMT+1

Skype: mrdebug


_______________________________________________
Libav-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/libav-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".