5

I want to decode an internet-audiostream, but I don't want to write the data to disk, so the data is located in the memory only.

But when I want to decode data to raw-data, I must initialise the format-context and so I need to use avformat_open_input. But these function needs a detailed location of the file.

Have anyone a solution, how I can get my memory located data into the format-context to decode this data to a raw data?

user2492388
  • 151
  • 6
  • 15

2 Answers2

4

You must create custom AVIOContext.

For details, see my answer to Play a Video from MemoryStream, Using FFMpeg

Community
  • 1
  • 1
pogorskiy
  • 4,705
  • 1
  • 22
  • 21
-1

You don't need a file, just use your internet-audiostream url to open. like this:

AVFormatContext *ic = avformat_alloc_context();
err = avformat_open_input(&ic, "rtmp://www.something.com/a.mp4", NULL, NULL);
Maojia
  • 37
  • 3