leandromoreira / ffmpeg-libav-tutorial

FFmpeg libav tutorial - learn how media works from basic to transmuxing, transcoding and more. Translations: πŸ‡ΊπŸ‡Έ πŸ‡¨πŸ‡³ πŸ‡°πŸ‡· πŸ‡ͺπŸ‡Έ πŸ‡»πŸ‡³ πŸ‡§πŸ‡·
https://github.com/leandromoreira/ffmpeg-libav-tutorial
BSD 3-Clause "New" or "Revised" License
9.82k stars 941 forks source link

Emtpy audio packets #67

Closed joshprewer closed 4 years ago

joshprewer commented 4 years ago

Hi there!

Thanks for putting this tutorial together. This help is extremely valuable!

I've adapted transcode.c to take a video and audio input using avfoundation (specifically from a webcam and inbuilt microphone). Instead of an output file I also want to stream to a rtmp server with the audio converted from PCM to AAC.

The video packets are successfully received and transcoded. However, the audio packets appear empty? AVPacket->side_data is null and AVPacket->buf->data is an empty pointer. Think this is causing avcodec_send_frame to crash with an empty AVFrame in encode_audio?

Any tips/help will be much appreciated!

leandromoreira commented 4 years ago

Hi @joshprewer what settings are you using for AAC? maybe you can try to isolate the problem trying to convert PCM to AAC files and see if the issue remains.