[FFmpeg-user] Are there any examples, using ffmpeg libs, of encoding a file where the data comes from memory

JULIAN GARDNER joolzg at btinternet.com
Mon Aug 17 12:10:58 CEST 2015


What i am trying to do is to take a full TS, and have a thread read in this stream and pass off X number of programs to different encoding threads.
My current code base uses this
        avio_open2( &inputSource->fmt_ctx->pb, inputSource->src_filename, AVIO_FLAG_READ, &inputSource->fmt_ctx->interrupt_callback, &d);

        /* open input file, and allocate format context */
        if (avformat_open_input(&inputSource->fmt_ctx, inputSource->src_filename, NULL, NULL) < 0) {
            fprintf(stderr, "%s:Could not open source file %s\n", inputSource->name, inputSource->src_filename);
            ret = 1;
            goto end;
        }

But I have to make sure there is only one program in the stream
I would like to be able to pick 3 or 4 programs from the TS and encode each seperately using my encode thread.
So the question is how do I push in data which is already in the pc and is not a UDP stream or a FILE
JoolzPS. Also anyone around who can help with the BUG in the examples where you CANNOT change the output audio rate, it has to be the same as the internally generated one or the example crashes.


More information about the ffmpeg-user mailing list