Open Jveshi opened 1 year ago
I just tried 2K (2560x1440) video encoding and it's ok.
3K (3200×1800) video encoding is also possible
Even adjusting the code rate to 10000k will not work
I am the same. Which version are you using?
I am the same. Which version are you using?
v0.11.6 The last time I checked this project was in June. A new version has been released recently. I will check for changes when I am free. And you? Have you tried the new version?
I am the same. Which version are you using?
I tested V0.12.2, it still doesn't work, and no error is reported in the console, the program seems to terminate directly.
With all the information, I think it is not supported at the moemnt, need more research to figure out why not.
With all the information, I think it is not supported at the moemnt, need more research to figure out why not.
Thanks, looking forward to the new version
How large is your input file? The FAQs say that the maximum input file size is a hard 2GB which you may be easily going over by encoding 4k and h265 video. The error message is OOM (out of memory) which suggests this too.
How large is your input file? The FAQs say that the maximum input file size is a hard 2GB which you may be easily going over by encoding 4k and h265 video. The error message is OOM (out of memory) which suggests this too.
I have noticed that the file size is below 2GB. Specifically, this image is the video I used for testing.
I have also tested other videos with different resolutions and bitrates, as shown in the previous messages
Tried with core-mt@0.12.6
encoding a 4k and I got OOM error too, but it's fine when down scaling it under 2k or below.
command:
await ffmpeg.exec([
"-i", tempInputName,
"-c:v", "libx264",
"-vf", "scale='if(gt(iw,2048),2048,-2)':'if(gt(ih,1080),1080,-2)'", // with out this, 4k transcoding will got OOM
"-threads", "4",
"-crf", "23",
"-preset", "veryfast",
"-c:a", "aac",
"-b:a", "128k",
tempOutputName
]);
issue might related: https://github.com/ffmpegwasm/ffmpeg.wasm/issues/359
And for a 4k output, try to change the -preset
to superfast
or ultrafast
may help.
Describe the bug
Question 1
I am trying to do H265 encoding with the following code and it fails.
await ffmpeg.run('-i', 'test.mp4' , '-vcodec' , 'libx265' , '-acodec' , 'aac' , '-b:v' , '3000k' , '-maxrate' , '4000k' , '-minrate' , '3000k' , '-s' , '1920x1080' , '-b:a' , '192k' , 'test_out.mp4');
But it can be successful when using H264 encoding.
await ffmpeg.run('-i', 'test.mp4' , '-vcodec' , 'libx264' , '-acodec' , 'aac' , '-b:v' , '3000k' , '-maxrate' , '4000k' , '-minrate' , '3000k' , '-s' , '1920x1080' , '-b:a' , '192k' , 'test_out.mp4');
Maybe H265 encoding does not support multi-threading yet?
Error screenshot
Question 2
At first I tried to convert 4K video to 1080P video
await ffmpeg.run('-i', 'test.mp4' , '-vcodec' , 'libx264' , '-acodec' , 'aac' , '-b:v' , '3000k' , '-maxrate' , '4000k' , '-minrate' , '3000k' , '-s' , '1920x1080' , '-b:a' , '192k' , 'test_out.mp4');
The program runs fine for a short time, but errors appear soon after (An error occurs when the program executes less than 1%)
Then I remove the width and height constraints, the error occurs immediately
await ffmpeg.run('-i', 'test.mp4' , '-vcodec' , 'libx264' , '-acodec' , 'aac' , '-b:v' , '3000k' , '-maxrate' , '4000k' , '-minrate' , '3000k' , '-b:a' , '192k' , 'test_out.mp4');
Error screenshot
I hid the website domain in the screenshot, it has nothing to do with the question
Desktop: