Skip to content

Conversation

pgilfernandez
Copy link

It's a pretty simple fix but I think it solves the problem as not just kdenlive but HandBrake and ffprobe are reading Friction rendered video with not a rounded and exact/constant FPS as the one set at your scene.

I'm not expert in this field so I used chatGPT to help me so, please, have a look at it if this is a nice solution o not as it works for kdenlive, HandBrake and ffprobe but I don't know if somehow we could be breaking the videos....

ChatGPT says this about the proposed fix:

// Sets the stream’s "actual" framerate. av_inv_q() inverts the timebase fraction
// (e.g., if timebase is 1/60, this gives 60/1, which is 60fps)
ost->fStream->r_frame_rate = av_inv_q(renSettings.fTimeBase);

// Sets the average framerate to be equal to the actual framerate.
// This is important so that the player knows the video has a constant framerate
ost->fStream->avg_frame_rate = ost->fStream->r_frame_rate;
### Why are these lines important?

- `r_frame_rate` represents the actual/desired framerate of the video.
- `avg_frame_rate` represents the average frames per second.
- By setting both to the exact same value, we tell FFmpeg we want a constant framerate.
- Using `av_inv_q()` ensures we get the exact framerate from the timebase.

### Why is this solution better than the previous one?

- It doesn’t modify the encoder’s behavior.
- It uses FFmpeg’s native properties to handle framerates.
- It’s similar to what FFmpeg does internally when using `-r 60` on the command line.
- It doesn’t require additional flags or configurations.

### Notes

That’s why exported videos should now show exactly **60 FPS** instead of **60.20 FPS** or similar values.

@rodlie
Copy link
Member

rodlie commented Mar 29, 2025

Great if it works and don't break anything (else this needs to be an option). Will check later tonight.

@pgilfernandez
Copy link
Author

It doesn't break anything as far as I've seen but the rendered videos have an "extra" length, for instance:

  • if I'm rendering a scene from 0 to 300 frames at 60fps
  • I'm getting a video of 05:01 (or 05:02 with ffprobe) while I would expect to get a final video of 05:00 length

I don't know if we are rendering an extra frame and that was the original problem or what...

@pgilfernandez
Copy link
Author

Now it works perfectly: both FPS, time and total frames count match with the scene settings.

HandBrake, kdenlive and ffprobe validate the expected result of video, please, try other ones if you want and let me know if they reconfirm it. 😊

@rodlie
Copy link
Member

rodlie commented Mar 30, 2025

I tried before your newest commit, and there was no difference between a project rendered in RC1 or this PR.

@rodlie
Copy link
Member

rodlie commented Mar 30, 2025

My project:

  • 1080x1080
  • 600 frames
  • 30 fps

A basic social media video that lasts for 20 sec.

RC

General
Complete name                            : Desktop/demo1.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 22.5 MiB
Duration                                 : 20 s 0 ms
Overall bit rate                         : 9 431 kb/s
Frame rate                               : 30.000 FPS
Writing application                      : Lavf58.29.100

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L3.2
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 20 s 0 ms
Bit rate                                 : 9 000 kb/s
Width                                    : 1 080 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 1.000
Frame rate mode                          : Constant
Frame rate                               : 30.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.257
Stream size                              : 22.5 MiB (100%)
Writing library                          : x264 core 155
Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=12 / keyint_min=1 / scenecut=40 / intra_refresh=0 / rc_lookahead=12 / rc=abr / mbtree=1 / bitrate=9000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Codec configuration box                  : avcC

PR (prior to last commit)

General
Complete name                            : Desktop/demo2.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 22.5 MiB
Duration                                 : 20 s 0 ms
Overall bit rate                         : 9 431 kb/s
Frame rate                               : 30.000 FPS
Writing application                      : Lavf58.29.100

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L3.2
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 20 s 0 ms
Bit rate                                 : 9 000 kb/s
Width                                    : 1 080 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 1.000
Frame rate mode                          : Constant
Frame rate                               : 30.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.257
Stream size                              : 22.5 MiB (100%)
Writing library                          : x264 core 155
Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=12 / keyint_min=1 / scenecut=40 / intra_refresh=0 / rc_lookahead=12 / rc=abr / mbtree=1 / bitrate=9000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Codec configuration box                  : avcC

DIFF:

--- demo1.txt	2025-03-30 14:01:12.000000000 +0200
+++ demo2.txt	2025-03-30 14:13:19.000000000 +0200
@@ -1,5 +1,5 @@
 General
-Complete name                            : Desktop/demo1.mp4
+Complete name                            : Desktop/demo2.mp4
 Format                                   : MPEG-4
 Format profile                           : Base Media
 Codec ID                                 : isom (isom/iso2/avc1/mp41)

PR (last commit)

General
Complete name                            : Desktop/demo3.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 22.2 MiB
Duration                                 : 19 s 967 ms
Overall bit rate                         : 9 320 kb/s
Frame rate                               : 30.000 FPS
Writing application                      : Lavf58.29.100

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L3.2
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 19 s 967 ms
Bit rate                                 : 9 000 kb/s
Width                                    : 1 080 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 1.000
Frame rate mode                          : Constant
Frame rate                               : 30.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.257
Stream size                              : 22.2 MiB (100%)
Writing library                          : x264 core 155
Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=12 / keyint_min=1 / scenecut=40 / intra_refresh=0 / rc_lookahead=12 / rc=abr / mbtree=1 / bitrate=9000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Codec configuration box                  : avcC

DIFF:

--- demo2.txt	2025-03-30 14:13:19.000000000 +0200
+++ demo3.txt	2025-03-30 14:22:45.000000000 +0200
@@ -1,11 +1,11 @@
 General
-Complete name                            : Desktop/demo2.mp4
+Complete name                            : Desktop/demo3.mp4
 Format                                   : MPEG-4
 Format profile                           : Base Media
 Codec ID                                 : isom (isom/iso2/avc1/mp41)
-File size                                : 22.5 MiB
-Duration                                 : 20 s 0 ms
-Overall bit rate                         : 9 431 kb/s
+File size                                : 22.2 MiB
+Duration                                 : 19 s 967 ms
+Overall bit rate                         : 9 320 kb/s
 Frame rate                               : 30.000 FPS
 Writing application                      : Lavf58.29.100
 
@@ -19,7 +19,7 @@
 Format settings, Reference frames        : 4 frames
 Codec ID                                 : avc1
 Codec ID/Info                            : Advanced Video Coding
-Duration                                 : 20 s 0 ms
+Duration                                 : 19 s 967 ms
 Bit rate                                 : 9 000 kb/s
 Width                                    : 1 080 pixels
 Height                                   : 1 080 pixels
@@ -31,7 +31,7 @@
 Bit depth                                : 8 bits
 Scan type                                : Progressive
 Bits/(Pixel*Frame)                       : 0.257
-Stream size                              : 22.5 MiB (100%)
+Stream size                              : 22.2 MiB (100%)
 Writing library                          : x264 core 155
 Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=12 / keyint_min=1 / scenecut=40 / intra_refresh=0 / rc_lookahead=12 / rc=abr / mbtree=1 / bitrate=9000 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
 Codec configuration box                  : avcC

@rodlie
Copy link
Member

rodlie commented Mar 30, 2025

btw, none of the files I rendered are accepted by kdenlive 24.12.

@pgilfernandez
Copy link
Author

Ok, let me test it again later, I'm away from computer now... could you try a simple example that could share so that I test it here as well?

I did 2 different tests at different settings and they both worked...

@pgilfernandez
Copy link
Author

I'm back here, I did a simple test file with your settings and they both are different, the one using this PR works perfectly in kdenlive 24.12.0, the one compiled with RC1 doesn't...

My tests were done with "MP4 Video" profile, no audio rendered. Did you rendered audio in yours?

@pgilfernandez
Copy link
Author

I tried myself the "MP4 Video + Audio" profile and it also works.
What profile did you use?

@pgilfernandez
Copy link
Author

Another question, what video info checker are you using?

@rodlie
Copy link
Member

rodlie commented Mar 30, 2025

I tried myself the "MP4 Video + Audio" profile and it also works. What profile did you use?

The "MP4 Video" profile. I'm using ffmpeg 4.2.10 (I use the same SDK used to build releases).

Another question, what video info checker are you using?

I used mediainfo.


This was done on my macbook (macOS12). I can test on Linux later today.

@pgilfernandez
Copy link
Author

OK, I don't know what ffmpeg I'm using but I guess is the one embed with Friction...

I'll test now using mediainfo but it's strange your videos have no effect with the new changes...

@pgilfernandez
Copy link
Author

I tried using mediainfo and it doesn't expose the right information, I mean, it's not as strict as ffprobe or HandBrake, I guess it is because they both relay directly on FFMPEG.

Being that said, could you try my sample video (one of some, I don't think it's necessary to send you all of them):

  1. download 2 videos (and project just in case) here test.zip
  2. in a terminal, move to the folder where you unzipped the videos
  3. use ffprobe to test my video info:
clear;
ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 rectangle_rc1.mp4;
ffprobe -i rectangle_rc1.mp4 -hide_banner;
ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames -of default=nokey=1:noprint_wrappers=1 rectangle_pr.mp4;
ffprobe -i rectangle_pr.mp4 -hide_banner

This is my output as an example:

600
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'rectangle_rc1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.29.100
  Duration: 00:00:20.00, start: 0.000000, bitrate: 100 kb/s
  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 97 kb/s, 30.05 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
600
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'rectangle_pr.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.76.100
  Duration: 00:00:20.00, start: 0.000000, bitrate: 104 kb/s
  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 101 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]

The important information is the first 600 which is the total number of frames (perfect), Duration with 00:00:20.00 (perfect) and in stream the part where it tells you the fps 30.05 fps, 30 tbr (wrong).

The video exported with this PR has 600 frames (perfect), Duration with 00:00:20.00 (perfect) and now the stream says 30 fps, 30 tbr (perfect).

If you use this PR with just the first commit you will see that the Duration time is wrong, so just have a look at the PR with all the commits.

If you load the videos in HandBrake you will also see more or less the same information.

Finally in kdenlive 24.12.0, if you open a project, set the project FPS to 30 (go to Project > Project settings... and set HD 1080p 30 fps profile, when you load the videos into the Project bin it will prompt you to transcode just rectangle_rc1.mp4.

I'm going to test this on another computer and OS just in case, please, let me know your results if you are able to test them as I told you.

@rodlie
Copy link
Member

rodlie commented Mar 31, 2025

Just tested on Windows (d6a9ff66) (https://github.com/friction2d/friction/actions/runs/14155877500) and my video rendered from Friction is not accepted by kdenlive, still complains about VFR.

I also don't like that Handbrake says source is 30.1 fps.

Untitled

The video (from Friction) is now missing 1 sec:

untitled.mp4

@pgilfernandez
Copy link
Author

Umm, and what about the videos I shared with you?

@rodlie
Copy link
Member

rodlie commented Mar 31, 2025

Umm, and what about the videos I shared with you?

rectangle_pr.mp4 from your zip file works in kdenlive, but if I use rectangle.friction to render out a copy it is not accepted by kdenlive.

Handbrake says everything (even the file that works in kdenlive) is peak or variable framerate, I don't trust it.

This is a mess 😄

@pgilfernandez
Copy link
Author

So, do you agree the videos rendered by Friction have something weird?

I've tried too on a Windows computer and I confirm your results, it doesn't behave the same as on my macbook Pro were I coded and built the PR...

My guess now would be that "the problem" could be an external component that is built in Friction but not compiled and that is behaving differently on macOS, Windows/Linux, do you agree? could it be FFMPEG? different versions or something like that?

BTW, what I tried with this PR was to force the rendered video to include the real information from the video that was rendered:

  • forcing the video header to include the exact FPS of the scene
  • ensuring the number of rendered frames saved into the video to be exactly the ones rendered in the scene

I started all these strategy by checking that if I remuxed a video coming out from Friction RC1, I used ffmpeg to do it:

ffmpeg -i input.mp4 -c copy -r 60 output.mp4

Then the output.mp4 video was perfect (FPS, duration and frames). You could very easily remux any video and check how it works in kdenlive, HandBrake, ffprobe, etc...

So maybe the next logical step is find out why the videos rendered with this PR are not behaving the same (probably because this "forced remux" is not working or not even being performed...)

Any idea?

@rodlie
Copy link
Member

rodlie commented Mar 31, 2025

I've tried too on a Windows computer and I confirm your results, it doesn't behave the same as on my macbook Pro were I coded and built the PR...

That's because your are using a different build/version of ffmpeg on your Mac.

On my macbook it works as on Windows. I use the same components on all platforms.

I'm all for fixing this, but I need some kind of documentation that say how things should be. Not random apps that says random things 😄 (and builds of ffmpeg that behave differently)

@pgilfernandez
Copy link
Author

That's because your are using a different build/version of ffmpeg on your Mac.

OK

On my macbook it works as on Windows. I use the same components on all platforms.

How could I sync them all?

I'm all for fixing this, but I need some kind of documentation that say how things should be. Not random apps that says random things 😄 (and builds of ffmpeg that behave differently)

We will then have to dive into FFMPEG, video codecs, etc... but I agree that what I did was experiment and somehow guess what was happening, not really checking that it was wrong and how it should be.
I'll continue digging on the subject

@rodlie
Copy link
Member

rodlie commented Mar 31, 2025

So, the issue seems to be ffmpeg version, if I upgrade ffmpeg to 4.4.5 then your PR actually does something. ffprobe is ok and kdenlive accepts the file.

Only avg_frame_rate is needed, r_frame_rate is already correct.

This is on my macbook.

@pgilfernandez
Copy link
Author

So, the issue seems to be ffmpeg version, if I upgrade ffmpeg to 4.4.5 then your PR actually does something. ffprobe is ok and kdenlive accepts the file.

Well, that's great, a step forward... I checked my ffmpeg version and is 4.4.4

Only avg_frame_rate is needed, r_frame_rate is already correct.

Funny, I checked if only one was needed and end up thinking both were needed, but there is a chance I didn't test all options and I was wrong.

This is on my macbook.

And what version are we running on Friction packages? as you said it would make sense to sync to the version used on the packages so that this kind of errors doesn't happen. Knowing this version number would help us finding the problem and maybe proposing a solution that works no matter what ffmpeg version we are using, right?

Another option would be to upgrade the packages to ffmpeg 4.4.5 but I don't know if that would break something more...

@pgilfernandez
Copy link
Author

It seems there is a big leap from ffmpeg 4.2 to >4.4 regarding the subject (copied from ChatGPT):

FPS-Related Changes Between FFmpeg 4.2 and 4.4

Between FFmpeg 4.2 and 4.4, there were significant improvements regarding the handling of framerate (FPS) information, both when reading and writing video headers. This mainly affects how FFmpeg detects, preserves, and reports CFR (Constant Frame Rate) vs VFR (Variable Frame Rate) content.


Notable FPS & Header Related Improvements in FFmpeg 4.4

1. Better CFR vs VFR Detection

  • Starting from FFmpeg 4.3 and fully stabilized in 4.4, FFmpeg greatly improved how it detects whether a video stream is CFR or VFR during demuxing (input).
  • This directly affects the reported avg_frame_rate and r_frame_rate values you see with ffprobe or when remuxing.
  • In FFmpeg 4.2, formats like Matroska (MKV) and MP4 would sometimes assume CFR even if the stream was slightly variable.

2. Header Preservation when Remuxing

  • FFmpeg 4.4 preserves the actual frame timing better when remuxing a VFR video, preventing incorrect headers from being written that falsely indicate a constant FPS.
  • Timebase (time_base) and duration_ts were improved to reflect the real timing accurately in the output.

3. New Warning Messages

  • Starting from FFmpeg 4.4, FFmpeg became more explicit in logging when it's remuxing a VFR stream into a container that would cause CFR assumptions.
  • It warns if the timestamps are non-monotonic or if a VFR source is about to be "flattened" to CFR improperly.

4. Improved ffprobe FPS Reporting

  • In 4.4, ffprobe more clearly distinguishes:
    • r_frame_rate = nominal framerate from codec metadata
    • avg_frame_rate = actual average framerate based on real timestamps
  • In 4.2, ffprobe would often report something like 25/1 or 30/1 as r_frame_rate even when the file was clearly VFR, leading to confusion.

5. MP4/MOV Specific Improvements

  • FFmpeg 4.4 improved reading and writing of mvhd and stts atoms inside MP4/MOV, which are directly related to framerate and timebase signaling.
  • It fixed issues where remuxing could incorrectly rewrite the timescale or force a CFR interpretation when it wasn't accurate.

Summary Table

Feature FFmpeg 4.2 FFmpeg 4.4
CFR vs VFR detection Basic and sometimes inaccurate More accurate and robust
FPS in headers Often forced to CFR Better preservation of actual FPS (CFR or VFR)
Remuxing behavior Could flatten VFR into CFR accidentally Keeps true timestamps much better
ffprobe output Could give misleading r_frame_rate Clear separation of r_frame_rate vs avg_frame_rate

@rodlie
Copy link
Member

rodlie commented Apr 1, 2025

And what version are we running on Friction packages? as you said it would make sense to sync to the version used on the packages so that this kind of errors doesn't happen. Knowing this version number would help us finding the problem and maybe proposing a solution that works no matter what ffmpeg version we are using, right?

Another option would be to upgrade the packages to ffmpeg 4.4.5 but I don't know if that would break something more...

We use ffmpeg 4.2. There is a reason for this, 4.4 randomly stalls during end of render, so I decided to downgrade (don't remember when, think it was in 0.9.6 or 0.9.5).

I also checked the commits in 4.4 vs 4.2 and I didn't find anything related to this issue in the encoder/muxer.


Moving from ffmpeg 4.2 to 4.4 this late in the release process is a no-go from me. Only option would be to patch ffmpeg, but I don't know where the problem is (we only need to "fix" movenc, the rest is not important).

@rodlie
Copy link
Member

rodlie commented Apr 1, 2025

FFmpeg 4.4 improved reading and writing of mvhd and stts atoms inside MP4/MOV, which are directly related to framerate and timebase signaling.
It fixed issues where remuxing could incorrectly rewrite the timescale or force a CFR interpretation when it wasn't accurate.

Will check the commits in ffmpeg, at least I have something to look for 😄

@pgilfernandez
Copy link
Author

We use ffmpeg 4.2. There is a reason for this, 4.4 randomly stalls during end of render, so I decided to downgrade (don't remember when, think it was in 0.9.6 or 0.9.5).

I guessed it, if not you would have updated it... Have you ever tried with even more modern versions? they are in 7.x now.

Moving from ffmpeg 4.2 to 4.4 this late in the release process is a no-go from me. Only option would be to patch ffmpeg, but I don't know where the problem is (we only need to "fix" movenc, the rest is not important).

Indeed! this is not an important bug, I mean, we can live without this, it can be studied and tested for v1.1..

Will check the commits in ffmpeg, at least I have something to look for 😄

If it's something easy/fast for you then go ahead, if not, let it go for v1.1, doesn't it?

@rodlie
Copy link
Member

rodlie commented Apr 1, 2025

Have you ever tried with even more modern versions? they are in 7.x now.

7.x removed deprecated functions, Friction will not build.

For now I think it would be best to find the fix for mp4/mov in ffmpeg 4.4 and backport it, then focus on moving to ffmpeg 4.4 in Friction v1.1.

After that we could look into fixing the deprecated stuff and move on to a newer version of ffmpeg if needed.

Also note that ffmpeg supports their releases for a long time, so going beyond 4.4 is not a big priority unless it fixes something in Friction.

@pgilfernandez
Copy link
Author

In the meanwhile, I'm going to try to find a fix for Friction rendered videos that is compatible with ffmpeg 4.2...

@rodlie rodlie added this to the 1.1.0 milestone Apr 14, 2025
@pgilfernandez
Copy link
Author

Proposed a new PR that looks to work fine: #598

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants