[MPlayer-dev-eng] mencoder variable FPS
Nico Sabbi
nicola_sabbi at fastwebnet.it
Sat Jan 6 11:05:49 CET 2007
Keith Chew wrote:
> Hi
>
> For my security project, I am extending mencoder to receive an input
> from another application to control the force_fps variable. This
> allows me to control the framerate of the video being captured (ie
> from the video camera).
>
> All is working well, but to get mencoder to produce the output frames
> correctly, I needed to add these lines in the loop when each video
> frame is captured:
>
> // get video frame!
> if (!frame_data.already_read) {
> if(force_fps){ <---- CODE ADDED
> sh_video->fps=force_fps; <---- CODE ADDED
> sh_video->frametime=1.0f/sh_video->fps; <---- CODE ADDED
> } <---- CODE ADDED
>
> frame_data.in_size=video_read_frame(sh_video,&frame_data.frame_time,&frame_data.start,force_fps);
>
> sh_video->timer+=frame_data.frame_time;
> }
>
> When the sh_video->fps and sh_video->frametime are updated, the output
> video comes out correctly. Without the udpdate, the output elapsed
> time goes slower/faster when the fps is set lower/faster.
>
> I am writing to ask if there are other implications of this change? I
> had a look at the code and could not see any other impact of setting
> the sh_video->fps & sh_video->frametime during each frame capture.
>
> Regards
> Keith
maybe you didn't read the muxers' code, especially not muxer_avi.c ;)
mencoder is a boatload of crap kept together with band aids (it's
essentially a frontend for an avi muxer hacked to hell in order to
output other file formats); your code is hackish and doesn't fit at
all with the structure of mencoder
--
"Without a frontend, mplayer is useless" - someone in mplayer-users
More information about the MPlayer-dev-eng
mailing list