[FFmpeg-devel] Strategy to optimally playback audio & video
Matthieu Beghin
matthieu.beghin at garagecube.com
Tue Sep 13 11:03:27 EEST 2016
Ok. Thanks for your replies. Keeping the audio in separate files is an idea, but I’d like to be able to work directly with a movie, without recompression.
I found a solution to my problem: when the audio thread needs data, I read all packets but I only decompress audio packets, video packets are pushed in a queue and decompressed later from the graphic engine thread.
Thanks and sorry for posting at the wrong place !
Matt
> On 13 Sep 2016, at 00:10, Sven C. Dack <sven.c.dack at sky.com> wrote:
>
> On 11/09/16 20:37, Matthieu Beghin wrote:
>> I see various solutions:
>>
>> 1- I could put in cache more than one second of audio and video and I should be ok, but with 4k movies, keeping 30 frames could imply using a huge amount of memory and I would like to avoid that.
>> 2- I could open the file twice, one for video and one for audio, but I would use even more RAM and it would decrease performances because parsing the file twice
>> 3- I could avoid decoding video frames if I’m missing audio data but that would imply seeking back after to get a clean video frame (so decoding again from previous keyframe), so I think that’s not a option at all.
>> 4- Any better option ?
>>
>
> Keep audio and video in separate files. YouTube seems to be doing this for their 4K videos.
>
> If you cannot cache the video for long then cache the audio so it can cause less of a problem.
>
> Divide and conquer...
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
More information about the ffmpeg-devel
mailing list