Вопрос

I'm trying to make an android application that uses the FFMPEG for decoding videos that are not supported by Android ( not on all the devices at least ): MPEG-TS & h264 Main Profile. So, until now, I was able to use FFMPEG from JNI to decode some local video with the above specs, but my goal is to make the FFMPEG decode data from a streaming URL (http://127.0.0.1:1666/) on which I will send buffers from an android service (for certain reasons)

So, basically, I have two questions :

  • how I will be able to do the decoding from a streaming URL as I couldn't find any good example ?

  • when decoding my local MPEG-TS video, I've noticed that the playback speed is quite slow, and it happen that the video freezes for a while, even the Dolphin Player (based on FFMPEG) has the same behavior, and I don't know if is there some solution for this. Any suggestion ?

I appreciate your help.

Это было полезно?

Решение

you can take this as an example you can follow

iobuffer                  = (unsigned char*) av_malloc(bufferSize);               
pFormatCtx                = avformat_alloc_context();   
pFormatCtx->pb            = avio_alloc_context(iobuffer, bufferSize, 0,receiver,    IORead, NULL, );

err = avformat_open_input(&pFormatCtx, "", NULL, NULL);

where pFormatCtx is an AvFormatContext and ioread is a function that fills your buffer from the receiver

For your second question i've also faced the same problems and unfortunately i didn't find a solution hope you find it and share it

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top