0

I am trying to write audio encoded packets into a MP4 container.I have followed this sample code and instead of creating dummy frame, I am feeding real G.711 PCMU encoded frame into ffmpeg. The writing seems working and file size is increasing, but the mp4 is not playing using ffplay or in VLC player.

Thanks in advance!

Kaidul
  • 15,409
  • 15
  • 81
  • 150
  • 2
    I doubt PCM mu-law / G.711 mu-law is supported by MP4 container. Either change to a different container and/or use a different audio format. – llogan Aug 05 '15 at 16:56
  • Many thanks for your answer! yes, I found it sometime ago - MP4 doesn't support PCM stream, either I have to use `avi` or `mov` or transcode the audio into another codec format like `aac`. Now my question is - only setting `m_pOutputFmt->audio_codec != AV_CODEC_ID_AAC` should work with my remote PCM encoded data? Or I have to change container extension or transcode audio into AAC too? – Kaidul Aug 05 '15 at 17:03
  • @LordNeckbeard Sir, Can you please take a look at http://stackoverflow.com/questions/31846650/avformat-write-header-return-error-code-when-trying-to-write-pcmu-encoded-frame ? – Kaidul Aug 06 '15 at 04:09

1 Answers1

0

G.711 PCM encoded data is not supported by mp4 container. So I used mov multimedia container instead. And for mp4, I transcoded PCM into AAC which is supported by mp4. See this for details.

Kaidul
  • 15,409
  • 15
  • 81
  • 150