[Ffmpeg-devel] Audio video player in a fixed fps loop.

Silvano Galliani kysucix kysucix
Fri Sep 22 19:36:20 CEST 2006


Hi.
I would like to implement an audio video player based on ffmpeg and the 
architecture that better suits my needs is a main loop running at fixed 
frame rate catching a frame and the correct amount of audio chunk and 
the ouput them on video and sound card.

while (true)
{
	get_video_frame();
	while (audio_buffer_size < sample_rate * channels / fps / sampleformat)
	{
		get_audio_chunk();
	}
	output_video_frame();
	output_audio();
	sleep_until_next_fps();
}

A part from variable fps codecs and duplicated frames or such things, is 
it a correct approach? How much should I put on the audio buffer ?
I hope it isn't too OT :)
Best regards.
kysucix




More information about the ffmpeg-devel mailing list