NickeManarin / ScreenToGif

🎬 ScreenToGif allows you to record a selected area of your screen, edit and save it as a gif or video.
http://www.screentogif.com
Microsoft Public License
23.07k stars 2.15k forks source link

[Bug] Error saving in webp format #1137

Open Ehdil opened 1 year ago

Ehdil commented 1 year ago

Hello, I'm using the program, I'm enjoying it, very good, but I have a problem that I can't save the projects in animated webp format. Whenever I try, it gives an error. What can it be?

This happens when I make a project with images and then try to record in animated webp. Thank you.

NickeManarin commented 1 year ago

Hello, what does the error details say?

Ehdil commented 1 year ago

It only gives an error message. error. Here's what appears in notepad:

Ehdil commented 1 year ago

Error while encoding the Webp with FFmpeg.


at ScreenToGif.Util.EncodingManager.EncodeWithFfmpeg(ExportPreset preset, List`1 listFrames, Int32 id, CancellationTokenSource tokenSource, String processing) in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Util\EncodingManager.cs:line 1734 at ScreenToGif.Util.EncodingManager.Encode(ExportProject project, ExportPreset preset, Int32 id, CancellationTokenSource tokenSource) in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Util\EncodingManager.cs:line 1036

Command:

-vsync auto -safe 0 -f concat -i "file:C:\Users\Cliente\AppData\Local\Temp\ScreenToGif\Recording\2022-08-17 00-57-45\Encode 2022-08-20 02-21-23-39\concat.txt" -c:v libwebp_anim -loop -1 -preset picture -lossless 0 -quality 100 -f webp -y "C:\Users\Cliente\Desktop\Animação1.webp"

Result:

ffmpeg version 4.4.1-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers built with gcc 11.2.0 (Rev1, Built by MSYS2 project) configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libswscale 5. 9.100 / 5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100 Expected number for vsync but found: auto

Ehdil commented 1 year ago

ScreenToGif.EncodeWithFfmpeg


[NickeManarin] I'm a Brazilian user. :)

NickeManarin commented 1 year ago

The last line explains the issue that you have:

Expected number for vsync but found: auto

So, for that specific selection, it's expecting a number.


[NickeManarin] I'm a Brazilian user. :)

Olá! :D

Ehdil commented 1 year ago

I'm only able to save in webp when I check the box: X Gif with repetitions. I don't know why, if it's my mistake here in the handling or if it's a bug.

If the box is checked X, even putting 1 repeat works. If I uncheck the box it gives an error message. I made a project with PNG images, with 91 frames, and saved the project, and saved from the project.

What can it be?

But the program is very good, excellent, I would like to congratulate you! And I intend to collaborate with the project in the next few days.

Ehdil commented 1 year ago

NickeManarin Eu gosto de informática como um todo, mas me interesso mais agora com Codecs de vídeo, codecs de áudio. Gosto do assunto. E me interessou os codecs de imagens porque estou trabalhando em um projeto e precisaria criar GIFs.

E vi esse formato Webp bem promissor, ele proporciona arquivos de tamanhos menores, que podem para algumas aplicações serem muito úteis.

riskeez commented 8 months ago

Getting same problem with ScreenToGif v2.39 and the latest ffmpeg build v6.0 by gyan.
The stack trace is a bit different though.

Exception:

at ScreenToGif.Util.EncodingManager.EncodeWithFfmpeg(ExportPreset preset, List`1 listFrames, Int32 id, CancellationTokenSource tokenSource, String processing) in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Util\EncodingManager.cs:line 1774
   at ScreenToGif.Util.EncodingManager.Encode(ExportProject project, ExportPreset preset, Int32 id, CancellationTokenSource tokenSource) in C:\Users\nicke\source\ScreenToGif\ScreenToGif\Util\EncodingManager.cs:line 1038

Command:

-vsync passthrough -safe 0 -f concat -i "file:C:\Users\bipBopBoop\AppData\Local\Temp\ScreenToGif\Recording\2023-11-06 12-49-33\Encode 2023-11-06 12-53-15-88\concat.txt" -c:v libwebp_anim -loop -1 -lossless 1 -quality 75 -f webp -vsync passthrough -y "C:\Users\bipBopBoop\Desktop\slow.webp"

Result:

ffmpeg version 6.0-essentials_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12.2.0 (Rev10, Built by MSYS2 project)
  configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-mediafoundation --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libvpl --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
-vsync is deprecated. Use -fps_mode
    Last message repeated 1 times
Input #0, concat, from 'file:C:\Users\bipBopBoop\AppData\Local\Temp\ScreenToGif\Recording\2023-11-06 12-49-33\Encode 2023-11-06 12-53-15-88\concat.txt':
  Duration: 00:00:02.44, start: 0.000000, bitrate: 16 kb/s
  Stream #0:0: Video: png, rgba(pc), 1108x1041 [SAR 9448:9448 DAR 1108:1041], 25 fps, 25 tbr, 25 tbn
Stream mapping:
  Stream #0:0 -> #0:0 (png (native) -> webp (libwebp_anim))
Press [q] to stop, [?] for help
[WebP muxer @ 0000018d8aab1e80] Value -1.000000 for parameter 'loop' out of range [0 - 65535]
[WebP muxer @ 0000018d8aab1e80] Error setting option loop to value -1.
[out#0/webp @ 0000018d8aaaf740] Could not write header (incorrect codec parameters ?): Result too large
[vost#0:0/libwebp_anim @ 0000018d8aab2800] Error initializing output stream: 
Conversion failed!
NickeManarin commented 8 months ago

Which value are you using in the Loop field?

It's "-loop -1" for some reason.

riskeez commented 8 months ago

Which value are you using in the Loop field?

It's "-loop -1" for some reason.

When I just do File -> Save as I don't have Looped gif. flag set. And that is when it doesn't work image

But if I set the flag, it works! image image