This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Force constant frame rate with x264

Tags: None
(comma "," separated)
schwarzkopf
Registered Member
Posts
7
Karma
0

Force constant frame rate with x264

Tue Jun 16, 2015 10:15 am
Hi,

does anybody know how i can set in Kdenlive the frame rate to constant? I have an input file with constant frame rate and after the encoding with the following parameters „f=matroska hq=1 vcodec=libx264 preset=veryfast crf=%quality acodec=libfdk_aac ab=%audiobitrate+'k' ar=48000„, mediainfo tells me, the new file has a variable frame rate.

I tried „force-cfr=1“ but it doesn't work. I use Kdenlive 15.04.2 and ArchLinux.

Thanks!
vpinon
KDE Developer
Posts
708
Karma
6
OS
Are you sure you are speaking about frame rate and not bit rate?
With constant quality coding (crf=...) you are in VBR, but variable frame rate is very uncommon (never met)!
Normally to change the frame rate it is r=25 or r=60...
schwarzkopf
Registered Member
Posts
7
Karma
0
Thanks for your answer!

Yes, I'm speaking about the frame rate. My input clip has a constant frame rate but mediainfo tells me that the new encoded file has a variable framerate:

Frame rate mode : Variable

Is it possible to force a constant frame rate without setting the fps in the rendering profile of Kdenlive? Something like this in Handbrake on the attached screenshot.

Image
capslock
Registered Member
Posts
699
Karma
4
OS
Just tried a small project (1080p, 25fps) with following settings:
1. Add color clip to project tree and to timeline (5s)
2. Render with: f=matroska hq=1 vcodec=libx264 preset=veryfast crf=%quality acodec=aac ab=%audiobitrate+'k' ar=48000
(had to change your acodec)
3. Checked result with ffprobe <file>
Got result: [...]Stream #0:0: Video: h264 (High), yuv420p(tv, bt709/unknown/bt709), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1k tbn, 50 tbc (default)

Could you just create a similar project with one color clip and post your output? If the results are the same, we could check what happens with other video data...
schwarzkopf
Registered Member
Posts
7
Karma
0
Hello,

I tried it and got the following similar result:

Stream #0:0: Video: h264 (High), yuv420p(tv, bt709/unknown/bt709), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 1k tbn, 50 tbc (default)
capslock
Registered Member
Posts
699
Karma
4
OS
Alright. Good that we have identical result so far... Now let's cross check:
a) What does Handbrake tell you when you open the last short test from above?
b) And what tells ffprobe when giving it the render result where Handbrake states variable framerate?
schwarzkopf
Registered Member
Posts
7
Karma
0
I don't know exactly what you mean with a). I can open the file, but I don't know what Handbreak should tell me. Can I see there some information about my source file?

b) With a variable framerate and 25fps in Handbrake, I got the following result from ffprobe:

Stream #0:0: Video: h264 (High), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 24 fps, 24 tbr, 1k tbn, 180k tbc (default)
capslock
Registered Member
Posts
699
Karma
4
OS
Maybe I mixed up something. I thought it was Handbrake that told you about variable framerate. But I reread your first post.

From first post:
>mediainfo tells me, the new file has a variable frame rate.
What does the same mediainfo tell you if you check the small testfile with the colorclip? And what is mediainfo, btw?

If mediainfo tells variable bitrate on the color clip, we're in trouble. Because either ffmpeg or mediainfo must be wrong as they state different framerates and only one can be right.
schwarzkopf
Registered Member
Posts
7
Karma
0
Sorry, I thought MediaInfo is very common. Here is a link for you: http://mediaarea.net/en/MediaInfo

Mediainfo tells me, that the short color clip has a constant framerate. After rendering the clip with Kdenlive and the parameters above, mediainfo tells me the new clip has a variable framerate. If I render the same short color clip with handbrake and the constant framerate state, mediainfo tells me the rendered clip has a constant framerate. If i change the state in Handbrake to variable, mediainfo detect the framerate as variable.
capslock
Registered Member
Posts
699
Karma
4
OS
>If I render the same short color clip with handbrake and the constant framerate state,...
OK, any "rendering" you do with Handbrake (transcoding) and is not related to rendering with kdenlive.

>Mediainfo tells me, that the short color clip has a constant framerate.
So, kdenlive renders the color clip to cfr (constant frame rate).

We do not need the color clip anymore... Now the questions will be referring your footage from the first post. We have found out that your and mine kdenlive behave identically on the color clip.

The question now is: Why does your footage result in a variable frame rate? What is the result if you render your footage with the default MP4 render profile "H.264/AAC High Profile" (properties=x264-medium g=120 crf=%quality ab=%audiobitrate+'k')? It should be constant frame rate... If not you should try other video and audio codecs.

I'm on the road for two days, maybe I can read the results on the way, maybe not. But I'll be back. ;-)
schwarzkopf
Registered Member
Posts
7
Karma
0
Okay, I tried the default MP4 render. The result is a constant frame rate. Additionally, I tried my settings from the first post but changed the container to mp4 (f=matroska to f=mp4) and I also got a constant frame rate.

Have fun on your trip. There is no hurry. ;)
capslock
Registered Member
Posts
699
Karma
4
OS
Hehe... Just grabbed two minutes before leaving...
That's good news. Would you say the issue is solved then? I doubt I can help you further than this point if it comes down to fixing a rendering problem to matroska container...
schwarzkopf
Registered Member
Posts
7
Karma
0
For me it is no problem anymore. Now I use the MP4 container and it works very well.

In addition, it seems to be no Kdenlive bug. I know, that it worked with Kdenlive 0.9.10 on my system. Hence, I downgraded to this version and I also got a variable framerate with the matroska container. Maybe it is FFmpeg but I can't downgrade without trouble with the dependencies.

But as I said, it is no problem for me anymore since I can use the MP4 container. ;)

Thank you very much for your support!


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient