0

(I'm not really good in English but I'll do my best.)

I'm working on a Android app that saves received h.264 streaming video/audio frames into a clip. And I ran into a problem that mentioned here, "Missing codec specific data."

I tried some method to solve this.

  1. Assign pre-defined codec specific data.
    Which I borrow from this post, It worked surprisedly perfect - but only on my personal phone (Sony Xperia Z3, Android 5.1.1). Most test devices just crush.(Android 4.3/4.4).
  2. Parsing codec specific data from video stream itself.
    On my phone it crushed. But somehow works on some devices. I use this code as an example.
  3. Create a encoder to encode received video frames then pass them to MediaMuxer.
    Yes it's a stupid idea, it doesn't work.
  4. Create a decoder to decode received video frames, pass them to an encoder, and then pass encoded frames to MediaMuxer, save it.
    App isn't able to get any free buffer from the encoder. DEADLOCK.

Now I'm running out of ideas.

The last hope I got is using ffmpeg.
But the resources I found are encode/decode videos from video files, not from stream.
Any suggestions?

Thanks in advance. :)

Community
  • 1
  • 1
Owen Hsieh
  • 139
  • 8

1 Answers1

1

After been trying out a week including weekend studying h.264 spec and more.

I found out the problem isn't about video.

It's the AUDIO that is causing app to crush.


Case close, thanks for viewing. :\

Owen Hsieh
  • 139
  • 8