Read and write in the memory with ffmpeg