GNOME Bugzilla – Bug 625479
Pitivi does not set framerate when rendering
Last modified: 2010-07-30 12:23:50 UTC
Pitivi always uses the framerate of the first clip it renders (I think), rather than the framerate set in the project settings or rendering settings. To reproduce: * Create a project * Add a clip with a 30 fps framerate * Change the project settings to 25 fps * Render Expected result * When playing the rendered video, the framerate should be 25 fps Actual result * The framerate is 30 fps
I have played around with two implementations. The first implementation modified the framerate of every source clip in the timeline, by adding a capsfilter to the streambin in SourceFactory. However, watching the video in the preview was a bit strange at very slow frame rates (1 fps). I think it is better to set the framerate during rendering, by adding the capsfilter the bin in VideoModifierFactory. The idea is to add a capsfilter to the bin immedately after the videorate element, and to set the caps to the value same value as the output stream. It seems as though the capsfilter at the end of the bin does not actually change the framerate, even though it specifies it. However, the capsfilter immediately after the videorate element does set the framerate.
Created attachment 166695 [details] [review] Patch to set framerate when rendering This patch adds a capsfilter immediately after the videorate element in VideoModifierFactory. The caps is set to the same as the output stream. You probably do need to keep the capsfilter after the vscale element as this sets the size and aspect ratio of the rendered video. The pipeline in VideoModifierFactory looks something like: (in)-->idt-->csp-->vrate-->vratecaps-->vscale-->capsfilter-->(out)
That first patch fails with certain video files. The problem is that the capsfilter is too restrictive. The next patch uses a far less restrictive capsfilter: it only filters the framerate. Note that you need to apply both patches in sequence (I think).
Created attachment 166740 [details] [review] Less restrictive capsfilter setting. This patch uses a less restrictive filter setting on the framerate capsfilter. It only chooses the framerate, not all of the other video parameters.
Fixed in http://git.pitivi.org/?p=pitivi.git;a=commit;h=fff4c2e9fb4256db2157202f73f57dda28d5867c (See bug #613416 at the bottom for discussion.)