[GH-ISSUE #1360] [Bug] It fails to save mp4 file with the preset of High Quality #1002

Closed
opened 2026-02-26 09:33:15 +03:00 by kerem · 2 comments
Owner

Originally created by @HappyCodingCoding on GitHub (Dec 6, 2024).
Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/1360

Originally assigned to: @NickeManarin on GitHub.

Describe the bug
It fails to save mp4 file with the preset of High Quality, High Performance

Screenshots
Snipaste_2024-12-06_14-26-16

Desktop (please complete the following information):

  • OS: Windows 11
  • Version 22H2, OS build: 22621.4317
Originally created by @HappyCodingCoding on GitHub (Dec 6, 2024). Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/1360 Originally assigned to: @NickeManarin on GitHub. **Describe the bug** It fails to save mp4 file with the preset of High Quality, High Performance **Screenshots** ![Snipaste_2024-12-06_14-26-16](https://github.com/user-attachments/assets/bd5f9abb-8a2d-46ed-9435-7fdf2e3b1ca1) **Desktop (please complete the following information):** - OS: Windows 11 - Version 22H2, OS build: 22621.4317
kerem 2026-02-26 09:33:15 +03:00
Author
Owner

@HappyCodingCoding commented on GitHub (Dec 6, 2024):

Here are the logs:

► Title -
Encode
♦ [Version] Date/Hour -
[2.41.1] 12/06/2024 14:31:42
▬ Message -
Error while encoding the Mp4 with FFmpeg.
○ Type -
System.Exception
▲ Source -
ScreenToGif
▼ TargetSite -
Void EncodeWithFfmpeg(ScreenToGif.ViewModel.ExportPresets.ExportPreset, System.Collections.Generic.List`1[ScreenToGif.Domain.Interfaces.IFrame], Int32, System.Threading.CancellationTokenSource, System.String)
◘ Other -
Command:

-hwaccel auto -safe 0 -f concat -i "file:C:\Users\qingyun\AppData\Local\Temp\ScreenToGif\Recording\2024-12-06 14-22-57\Encode 2024-12-06 02-31-41-82\concat.txt" -c:v libx265 -preset hq -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -crf 28 -f mp4 -vsync passthrough -y "C:\Users\qingyun\Desktop\Video.mp4"

Result:

ffmpeg version N-118013-g7b73ea501d-20241205 Copyright (c) 2000-2024 the FFmpeg developers
built with gcc 14.2.0 (crosstool-NG 1.26.0.120_4d36f27)
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-libxml2 --enable-lzma --enable-fontconfig --enable-libharfbuzz --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-chromaprint --enable-libdav1d --enable-libdavs2 --enable-libdvdread --enable-libdvdnav --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libaribcaption --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-libzmq --enable-lv2 --enable-libvpl --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libvvenc --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-libs=-lgomp --extra-ldflags=-pthread --extra-ldexeflags= --cc=x86_64-w64-mingw32-gcc --cxx=x86_64-w64-mingw32-g++ --ar=x86_64-w64-mingw32-gcc-ar --ranlib=x86_64-w64-mingw32-gcc-ranlib --nm=x86_64-w64-mingw32-gcc-nm --extra-version=20241205
libavutil 59. 49.100 / 59. 49.100
libavcodec 61. 26.100 / 61. 26.100
libavformat 61. 9.100 / 61. 9.100
libavdevice 61. 4.100 / 61. 4.100
libavfilter 10. 6.101 / 10. 6.101
libswscale 8. 12.100 / 8. 12.100
libswresample 5. 4.100 / 5. 4.100
libpostproc 58. 4.100 / 58. 4.100
-vsync is deprecated. Use -fps_mode
Input #0, concat, from 'file:C:\Users\qingyun\AppData\Local\Temp\ScreenToGif\Recording\2024-12-06 14-22-57\Encode 2024-12-06 02-31-41-82\concat.txt':
Duration: 00:00:04.64, start: 0.000000, bitrate: 25 kb/s
Stream #0:0: Video: png, rgba(pc, gbr/bt709/iec61966-2-1), 2830x1154 [SAR 7559:7559 DAR 1415:577], 25 fps, 25 tbr, 25 tbn
Stream mapping:
Stream #0:0 -> #0:0 (png (native) -> hevc (libx265))
Press [q] to stop, [?] for help
[libx265 @ 000001a6b3fd94c0] Error setting preset/tune hq/(null).
[libx265 @ 000001a6b3fd94c0] Possible presets: ultrafast superfast veryfast faster fast medium slow slower veryslow placebo
[libx265 @ 000001a6b3fd94c0] Possible tunes: psnr ssim grain zerolatency fastdecode animation
[vost#0:0/libx265 @ 000001a6b3febe80] [enc:libx265 @ 000001a6b3fe6240] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height.
[vf#0:0 @ 000001a6b3f73e40] Error sending frames to consumers: Invalid argument
[vf#0:0 @ 000001a6b3f73e40] Task finished with error code: -22 (Invalid argument)
[vf#0:0 @ 000001a6b3f73e40] Terminating thread with return code -22 (Invalid argument)
[vost#0:0/libx265 @ 000001a6b3febe80] [enc:libx265 @ 000001a6b3fe6240] Could not open encoder before EOF
[vost#0:0/libx265 @ 000001a6b3febe80] Task finished with error code: -22 (Invalid argument)
[vost#0:0/libx265 @ 000001a6b3febe80] Terminating thread with return code -22 (Invalid argument)
[out#0/mp4 @ 000001a6b3f88d80] 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
Conversion failed!
♠ StackTrace -
at ScreenToGif.Util.EncodingManager.EncodeWithFfmpeg(ExportPreset preset, List`1 listFrames, Int32 id, CancellationTokenSource tokenSource, String processing) in R:\Source\ScreenToGif\ScreenToGif\Util\EncodingManager.cs:line 1785
at ScreenToGif.Util.EncodingManager.Encode(ExportProject project, ExportPreset preset, Int32 id, CancellationTokenSource tokenSource) in R:\Source\ScreenToGif\ScreenToGif\Util\EncodingManager.cs:line 1038


<!-- gh-comment-id:2522246185 --> @HappyCodingCoding commented on GitHub (Dec 6, 2024): Here are the logs: ► Title - Encode ♦ [Version] Date/Hour - [2.41.1] 12/06/2024 14:31:42 ▬ Message - Error while encoding the Mp4 with FFmpeg. ○ Type - System.Exception ▲ Source - ScreenToGif ▼ TargetSite - Void EncodeWithFfmpeg(ScreenToGif.ViewModel.ExportPresets.ExportPreset, System.Collections.Generic.List`1[ScreenToGif.Domain.Interfaces.IFrame], Int32, System.Threading.CancellationTokenSource, System.String) ◘ Other - Command: -hwaccel auto -safe 0 -f concat -i "file:C:\Users\qingyun\AppData\Local\Temp\ScreenToGif\Recording\2024-12-06 14-22-57\Encode 2024-12-06 02-31-41-82\concat.txt" -c:v libx265 -preset hq -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -crf 28 -f mp4 -vsync passthrough -y "C:\Users\qingyun\Desktop\Video.mp4" Result: ffmpeg version N-118013-g7b73ea501d-20241205 Copyright (c) 2000-2024 the FFmpeg developers built with gcc 14.2.0 (crosstool-NG 1.26.0.120_4d36f27) configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-libxml2 --enable-lzma --enable-fontconfig --enable-libharfbuzz --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-chromaprint --enable-libdav1d --enable-libdavs2 --enable-libdvdread --enable-libdvdnav --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libaribcaption --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-libzmq --enable-lv2 --enable-libvpl --enable-openal --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --enable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libvvenc --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-libs=-lgomp --extra-ldflags=-pthread --extra-ldexeflags= --cc=x86_64-w64-mingw32-gcc --cxx=x86_64-w64-mingw32-g++ --ar=x86_64-w64-mingw32-gcc-ar --ranlib=x86_64-w64-mingw32-gcc-ranlib --nm=x86_64-w64-mingw32-gcc-nm --extra-version=20241205 libavutil 59. 49.100 / 59. 49.100 libavcodec 61. 26.100 / 61. 26.100 libavformat 61. 9.100 / 61. 9.100 libavdevice 61. 4.100 / 61. 4.100 libavfilter 10. 6.101 / 10. 6.101 libswscale 8. 12.100 / 8. 12.100 libswresample 5. 4.100 / 5. 4.100 libpostproc 58. 4.100 / 58. 4.100 -vsync is deprecated. Use -fps_mode Input #0, concat, from 'file:C:\Users\qingyun\AppData\Local\Temp\ScreenToGif\Recording\2024-12-06 14-22-57\Encode 2024-12-06 02-31-41-82\concat.txt': Duration: 00:00:04.64, start: 0.000000, bitrate: 25 kb/s Stream #0:0: Video: png, rgba(pc, gbr/bt709/iec61966-2-1), 2830x1154 [SAR 7559:7559 DAR 1415:577], 25 fps, 25 tbr, 25 tbn Stream mapping: Stream #0:0 -> #0:0 (png (native) -> hevc (libx265)) Press [q] to stop, [?] for help [libx265 @ 000001a6b3fd94c0] Error setting preset/tune hq/(null). [libx265 @ 000001a6b3fd94c0] Possible presets: ultrafast superfast veryfast faster fast medium slow slower veryslow placebo [libx265 @ 000001a6b3fd94c0] Possible tunes: psnr ssim grain zerolatency fastdecode animation [vost#0:0/libx265 @ 000001a6b3febe80] [enc:libx265 @ 000001a6b3fe6240] Error while opening encoder - maybe incorrect parameters such as bit_rate, rate, width or height. [vf#0:0 @ 000001a6b3f73e40] Error sending frames to consumers: Invalid argument [vf#0:0 @ 000001a6b3f73e40] Task finished with error code: -22 (Invalid argument) [vf#0:0 @ 000001a6b3f73e40] Terminating thread with return code -22 (Invalid argument) [vost#0:0/libx265 @ 000001a6b3febe80] [enc:libx265 @ 000001a6b3fe6240] Could not open encoder before EOF [vost#0:0/libx265 @ 000001a6b3febe80] Task finished with error code: -22 (Invalid argument) [vost#0:0/libx265 @ 000001a6b3febe80] Terminating thread with return code -22 (Invalid argument) [out#0/mp4 @ 000001a6b3f88d80] 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 Conversion failed! ♠ StackTrace - at ScreenToGif.Util.EncodingManager.EncodeWithFfmpeg(ExportPreset preset, List`1 listFrames, Int32 id, CancellationTokenSource tokenSource, String processing) in R:\Source\ScreenToGif\ScreenToGif\Util\EncodingManager.cs:line 1785 at ScreenToGif.Util.EncodingManager.Encode(ExportProject project, ExportPreset preset, Int32 id, CancellationTokenSource tokenSource) in R:\Source\ScreenToGif\ScreenToGif\Util\EncodingManager.cs:line 1038 ----------------------------------
Author
Owner

@NickeManarin commented on GitHub (Dec 14, 2024):

Thanks for the report, I replaced the presets being shown, now you can pick only:
ultrafast superfast veryfast faster fast medium slow slower veryslow placebo

<!-- gh-comment-id:2543376778 --> @NickeManarin commented on GitHub (Dec 14, 2024): Thanks for the report, I replaced the presets being shown, now you can pick only: ultrafast superfast veryfast faster fast medium slow slower veryslow placebo
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ScreenToGif#1002
No description provided.