KDEnlive trouble with 8k Samsung phone video, ffmpeg cannot handle 8K?

KDEnlive 24.12.0 (reinstalled latest version to see if it helped). Running c:\program files\kdenlive\bin\ffmpeg.exe reports ffmpeg version 7.1 built with gcc 13.2.0. This all seems very up to date. I have an NVidia 4070 Ti SUPER with an AMD Ryzen 5 5600X CPU and the mp4 source file is on a recent SSD, it’s all pretty high power stuff.

I’m in Windows trying to use KDEnlive to work on a 60Gb 8K resolution video file I recorded using my Samsung S23. It looks like ffmpeg is incapable of handling 8K video, and so kdenlive is incapable, am I right with this line of reasoning?

If I create a New Project and choose “HD1080 30 fps” I get a new project, then drag the large mp4 file into the Project Bin panel. I get a popup saying “The following clips are not usable for editing. This will transcode them in an edit friendly format and replace the original ones in your project.” … with the reason “File 20241220_100052.mp4 has a variable frame rate.” So I click OK to transcode it.

However the above transcode attempt fails when I select one of the GPU options (for example “Lossy x264 I frame only (NVidia GPU Video only)”, with an ffmpeg error log as follows:

“”"
[h264_nvenc @ 0000014968badd00] No capable devices found
[vost#0:0/h264_nvenc @ 0000014968baecc0] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
[vf#0:0 @ 0000014967066500] Error sending frames to consumers: Generic error in an external library
[vf#0:0 @ 0000014967066500] Task finished with error code: -542398533 (Generic error in an external library)
[vf#0:0 @ 0000014967066500] Terminating thread with return code -542398533 (Generic error in an external library)
[vost#0:0/h264_nvenc @ 0000014968baecc0] Could not open encoder before EOF
[vost#0:0/h264_nvenc @ 0000014968baecc0] Task finished with error code: -22 (Invalid argument)
[vost#0:0/h264_nvenc @ 0000014968baecc0] Terminating thread with return code -22 (Invalid argument)
[out#0/mp4 @ 0000014967095100] Nothing was written into output file, because at least one of its streams received no packets.
frame= 0 fps=0.0 q=0.0 Lsize= 0KiB time=N/A bitrate=N/A speed=N/A
“”"

After a lot of messing around I tried a command line attempt, and this time got a more useful error message. I don’t know how to get the command line kdenlive is using for the above transcode attempt, but I can see the Proxy Clips encoding profiles so I tried one of them:

“”“”
G:>“c:\Program Files\kdenlive\bin\ffmpeg.exe” -i 20241220_100052.mp4 -vcodec h264_nvenc -vb 30000k -rc cbr -acodec aac -ab 192k out.mp4
[h264_nvenc @ 00000256eae4d040] Width 7680 exceeds 4096
[h264_nvenc @ 00000256eae4d040] No capable devices found
[vost#0:0/h264_nvenc @ 00000256e9272400] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
[vf#0:0 @ 00000256e9236e80] Error sending frames to consumers: Generic error in an external library
[vf#0:0 @ 00000256e9236e80] Task finished with error code: -542398533 (Generic error in an external library)
[vf#0:0 @ 00000256e9236e80] Terminating thread with return code -542398533 (Generic error in an external library)
[vost#0:0/h264_nvenc @ 00000256e9272400] Could not open encoder before EOF
[vost#0:0/h264_nvenc @ 00000256e9272400] Task finished with error code: -22 (Invalid argument)
[vost#0:0/h264_nvenc @ 00000256e9272400] Terminating thread with return code -22 (Invalid argument)
[out#0/mp4 @ 00000256e9266dc0] Nothing was written into output file, because at least one of its streams received no packets.
“”“”

I found the NVidia “Video Encode and Decode GPU Support Matrix” which seems to confirm that NVEnc on my 4070 GPU is capable of encoding 8k video.

If ffmpeg cannot process a file with width over 4096 pixels, then is any 8K video editing impossible? My aim would be to generate a Proxy Clip for the massive 8K source video, do all my editing in kdenlive, and finally Render the project back to either 8K or 4K, but if kdenlive is dependent on ffmpeg and it cannot do the job then I’m stuck.

I have transcoded the file to 4K using Handbrake and may have a go with that, or I might fall back to a totally different tool like Davinci Resolve to see if it can do the job.

Advice would be gratefully received :slight_smile:
Nick

I think you’re conflating a whole pile of different things here …

Long story short, I can import 8k footage from my camera, edit it, and render it (as 4k or 8k) with kdenlive just fine.

I didn’t have an 8k project profile by default, but the custom one it created ‘automatically’ worked just fine, as did importing 8k footage into a 4k project (modulo all the usual issues with mixed size media that gets discussed here regularly).


Doesn’t seem like you are, it works just fine for me…

I’m not sure why you’re worried about or shooting 8k footage if you want a 1080p project?

Which has nothing to do with your footage resolution or support for 8k - you just can’t edit variable frame rate footage in a fixed frame rate timeline at any resolution. square peg, round hole, and all that.

so … don’t select a GPU option if those don’t work on your system?

ffmpeg handles them just fine, as does kdenlive.

@Ron Very happy for you that it works for you, and I don’t doubt you, but I did state some very specific ways it was failing for me, none of which you’ve touched on. I can’t figure out how to do the multi-quote response you did, so please bear with this poorly formatted response.

When kdenlive tries to transcode my file to an “edit friendly format” it fails. The log it presents just seems to complain about “No capable devices found”, which I find hard to believe on my rig with a 4070.

When I try what I think is a similar command line using the kdelive shipped ffmpeg, it says it cannot process the source file because it’s more than 4096 in width. I was using the command line switches I saw in the Proxy Clips config, which I know is not necessarily the same as the ones used in the transcode operation, but to actually edit the file I’m probably going to want to use proxy clips to speed the editing process up (what I’ve got working has been extremely choppy when trying to edit using the raw 8k original) so I think it’s important that the proxy clip generation command line should work.

I understand your comment about “shooting 8k if you want 1080p” … I chose 1080p because it’s low res enough to be easily handled as a test. What I’m actually doing is using the zoom & pan tools in kdenlive to produce a 4k video by zooming into my 8k source video to focus on some detail. I hope that answers why one would use a lower res target format than the source one.

“don’t select a GPU option if those don’t work on your system” is a bit of a cop-out. I did try this, and my 1h 50m source video was going to take 7 hours to process on my CPU. I felt it ought to be supported by GPU processing which should be way faster. I don’t think suggesting someone with a compatible rig like mine should be advised “just don’t use the GPU, then”.

“ffmpeg handles them just fine, as does kdenlive.”
No, it doesn’t, as I gave examples of in my post. If I’m doing something wrong I’d like some advice about what it is and how to fix it, not just be told that it works.

Again, I’m very happy that it works for you, I wish it did for me, and I’m asking for help with the situation I found myself in.

I have since ditched kdenlive and used Davinci Resolve, which worked first time out of the box on the same rig, but I do wish I hadn’t had to waste all those hours trying to get kdenlive to work.

Kdenlive uses MELT as the engine to apply effects and do all the compositing. Undortunately, MELT cannot use the GPU to render the video for playback during editing. The CPU does all the heavy lifting, and working with 8k source files is a a lot of work even for your rig.

For testing purposed I would first use Handbrake of ffmpeg CLI to reduce the 8k sources to something much more palatable for Kdenlive to work with easily and smoothly.

For a 4k video target resolution you need to use (or create) a 4k project profile. Otherwise, Kdenlive will assume your target resolution is 1080.

EDIT: And I strongly advise against the Position and Zoom effect as it has under-the-hood issues with artifacts. Use the Transform effect instead, or simply the new built-in (Transform) effect.

Which is a lot quicker than it not working at all with your GPU …
and evidently means kdenlive and ffmpeg do handle 8k video for you too.

How long does it take with DR?

Which part of h264_nvenc not working for this on you system makes you think you have a “compatible rig”?

That’s what I gave you - you just don’t seem to like the answer.

In a sense yes, because Kdenlive uses MELT as the engine for all the effects and compositing, basically producing the final video; and ffmpeg is used by MELT to bring it all together and encode the video using the codec specified and the target container.

So, my suggestion is to download the standalone version, have it self-extract into a folder of your choice (but not C:\Program Files) and try that one (the executable can be found in C:\your\path\to\kdenlive\bin).

EDIT: The ffmpeg installed on your system may be out of whack. The standalone Kdenlive brings with it it’s own ffmpeg executables.

If you want to manipulate 8k frames with transforms and not lose detail in intermediate downsampling, I believe you’re really going to need an 8k project (which you can then render scaled to 4k or whatever).

And that seems to work just fine - it’s just GPU pixie dust that’s troublesome (again), in both the practical sense and the unrealistic expectations some people have of what it can do.

Agreed. It comes down to your use case and what compromises you are willing to make. Almost a philosophical discussion …

@Ron when I said that ffmpeg does not work, I was referring to the nv_enc encoding attempt. I said my rig was ‘compatible’ because it appears on the official NVIDIA NVEnc comaptibility matrix (which I could not link to because of forum rules but you can google the name I did give).

If you mean “DR” as in “direct rendering” then the initial transcode attempt was going to take 7 hours, which I said in my last reply. I don’t think a 7 hour transcode is reasonable when a GPU accelerated one ought to work and would take a few minutes, which is why I switched tools to Davinci Resolve and got the job done almost immediately.

It’s not that I didn’t like your answer, it just didn’t address the specific problems I ran into.

Thanks @berndmj, I didn’t get as far as effects and compositing because as soon as I added the source .mp4 file kdenlive told me it needed to transcode it to an edit friendly format and this step failed. I don’t know anything about MELT but as far as I can see I’m not getting as far as using it because of the initial transcode error.

I appreciate your point about ffmpeg installations on my system but I did give an example of using the one shipping in kdenlive which failed:

@berndmj

The CPU does all the heavy lifting, and working with 8k source files is a a lot of work even for your rig.

Yes, which is why I said I would use the Proxy Clips feature of kdenlive, which seems to be excellent and worked fine on a small test file. It makes editing with a large source video very smooth and workable, I had not used this feature before and it was really nice to use.

For testing purposed I would first use Handbrake of ffmpeg CLI to reduce the 8k sources to something much more palatable for Kdenlive to work with easily and smoothly.

I did try transcoding the 8k source video down to 4k with Handbrake and ffmpeg could import it (I guess because its width is under that 4096 limit reported by ffmpeg) but because my plan is to zoom in on parts of the video and retain 4k final resolution (it’s a kids’ stage show, they were all over the place) I really want to keep the original 8k vid as my source.

For a 4k video target resolution you need to use (or create) a 4k project profile. Otherwise, Kdenlive will assume your target resolution is 1080.

I agree, I used 1080 as a test to remove potential problems people reading my post might come up with. My final plan was to upload 4k video to youtube so I’d use a 4k profile if I could get over this ffmpeg hurdle.

EDIT: And I strongly advise against the Position and Zoom effect as it has under-the-hood issues with artifacts. Use the Transform effect instead,

Yes, I want to use Transform, in which you can set the position and zoom values.

(as I said though, I’ve got the job done in Davinci Resolve instead)

The only “specific problem” you ran into is that h264_nvenc doesn’t support what you are trying to do with it. There is no other way to “address” that which has a happy ending than “Don’t keep trying to use it to do that then”.

You then extrapolated that into (among other things):

Neither of which is true.


All the rest of your problems (most of which are implicit in what you are saying, not questions you’re actually thinking about and asking) are a mishmash of wanting all of fast, small, high detail/quality, and not realising, or understanding enough of the basics to know, that you only get to pick two, or what things to pick to actually get them.

8k is going to be ‘expensive’ to work with, and there’s no voodoo shortcuts that get around that and keep quality - so honestly, you need to do a bit of homework on how all of what you’re wanting to use actually works - because you’re saying a lot of things like “and I did X to achieve Y …” where Y isn’t actually a consequence, or in some cases even a step in the direction you were hoping for, of doing X at all.

That makes it hard to do much more than answer the problem you’re actually having, and leave it to you to join the dots between what you’re imagining and what is actually real.

@Ron have a great day.