[GH-ISSUE #1238] [Bug] ScreenToGif.2.39 X64 Portable Build - ScreenToGif.EncodeWithFfmpeg Path Error #913

Open
opened 2026-02-26 09:33:00 +03:00 by kerem · 11 comments
Owner

Originally created by @MaverickLoneshark on GitHub (Oct 1, 2023).
Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/1238

Originally assigned to: @NickeManarin on GitHub.

Description
Saving project as Mp4 with default encoder fails due to intermediary 'no such file or directory' issues (missing correct path to temp).

To Reproduce
Steps to reproduce the behavior:

  1. Download the latest X64 portable build of ScreenToGif
  2. Open Recorder
  3. Record a screen capture
  4. Close Recorder
  5. Open Editor
  6. Attempt to save as MP4
  7. Select the ffmpeg.exe location if prompted to locate
  8. Use default settings for MP4 and attempt to save
  9. Encoding will fail

Expected behavior
ScreenToGif should produce a valid MP4 video.

Screenshots
image

image

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

Command:

-hwaccel auto -safe 0 -f concat -i "file:temp\ScreenToGif\Recording\2023-09-30 23-48-03\Encode 2023-10-01 07-06-00-89\concat.txt" -c:v libx264 -preset fast -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -f mp4 -vsync passthrough -y "gifs\you_died.mp4"


Result:


ffmpeg version N-112250-g6f7bf64dbc-20231001 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 13.2.0 (crosstool-NG 1.25.0.232_c175b21)
  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-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --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 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --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-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20231001
  libavutil      58. 27.100 / 58. 27.100
  libavcodec     60. 27.100 / 60. 27.100
  libavformat    60. 13.100 / 60. 13.100
  libavdevice    60.  2.101 / 60.  2.101
  libavfilter     9. 11.100 /  9. 11.100
  libswscale      7.  4.100 /  7.  4.100
  libswresample   4. 11.100 /  4. 11.100
  libpostproc    57.  2.100 / 57.  2.100
-vsync is deprecated. Use -fps_mode
[concat @ 00000228ddb53840] Impossible to open 'file:temp\ScreenToGif\Recording\2023-09-30 23-48-03\Encode 2023-10-01 07-06-00-89\temp\ScreenToGif\Recording\2023-09-30 23-48-03\Encode 2023-10-01 07-06-00-89\0.png'
[in#0 @ 00000228ddb532c0] Error opening input: No such file or directory
Error opening input file file:temp\ScreenToGif\Recording\2023-09-30 23-48-03\Encode 2023-10-01 07-06-00-89\concat.txt.
Error opening input files: No such file or directory

Desktop:

  • OS: Windows 10
  • Version 22H2

Additional context
Can successfully encode other formats without any known problems, so this issue seems specific to feeding ffmpeg correct path parameters

Originally created by @MaverickLoneshark on GitHub (Oct 1, 2023). Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/1238 Originally assigned to: @NickeManarin on GitHub. **Description** Saving project as Mp4 with default encoder fails due to intermediary 'no such file or directory' issues (missing correct path to `temp`). **To Reproduce** Steps to reproduce the behavior: 1. Download the latest X64 portable build of ScreenToGif 2. Open Recorder 3. Record a screen capture 4. Close Recorder 5. Open Editor 6. Attempt to save as MP4 7. Select the `ffmpeg.exe` location if prompted to locate 8. Use default settings for MP4 and attempt to save 9. Encoding will fail **Expected behavior** ScreenToGif should produce a valid MP4 video. **Screenshots** ![image](https://github.com/NickeManarin/ScreenToGif/assets/5481209/4aad1090-8ac6-4174-b8aa-dd58df03da5c) ![image](https://github.com/NickeManarin/ScreenToGif/assets/5481209/52357eef-32f6-4647-9a9b-432f41c9a195) ``` at ScreenToGif.Util.EncodingManager.EncodeWithFfmpeg(ExportPreset preset, List`1 listFrames, Int32 id, CancellationTokenSource tokenSource, String processing) in C:\Users\[redacted]\source\ScreenToGif\ScreenToGif\Util\EncodingManager.cs:line 1774 at ScreenToGif.Util.EncodingManager.Encode(ExportProject project, ExportPreset preset, Int32 id, CancellationTokenSource tokenSource) in C:\Users\[redacted]\source\ScreenToGif\ScreenToGif\Util\EncodingManager.cs:line 1038 Command: -hwaccel auto -safe 0 -f concat -i "file:temp\ScreenToGif\Recording\2023-09-30 23-48-03\Encode 2023-10-01 07-06-00-89\concat.txt" -c:v libx264 -preset fast -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -f mp4 -vsync passthrough -y "gifs\you_died.mp4" Result: ffmpeg version N-112250-g6f7bf64dbc-20231001 Copyright (c) 2000-2023 the FFmpeg developers built with gcc 13.2.0 (crosstool-NG 1.25.0.232_c175b21) 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-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --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 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --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-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20231001 libavutil 58. 27.100 / 58. 27.100 libavcodec 60. 27.100 / 60. 27.100 libavformat 60. 13.100 / 60. 13.100 libavdevice 60. 2.101 / 60. 2.101 libavfilter 9. 11.100 / 9. 11.100 libswscale 7. 4.100 / 7. 4.100 libswresample 4. 11.100 / 4. 11.100 libpostproc 57. 2.100 / 57. 2.100 -vsync is deprecated. Use -fps_mode [concat @ 00000228ddb53840] Impossible to open 'file:temp\ScreenToGif\Recording\2023-09-30 23-48-03\Encode 2023-10-01 07-06-00-89\temp\ScreenToGif\Recording\2023-09-30 23-48-03\Encode 2023-10-01 07-06-00-89\0.png' [in#0 @ 00000228ddb532c0] Error opening input: No such file or directory Error opening input file file:temp\ScreenToGif\Recording\2023-09-30 23-48-03\Encode 2023-10-01 07-06-00-89\concat.txt. Error opening input files: No such file or directory ``` **Desktop:** - OS: Windows 10 - Version 22H2 **Additional context** Can successfully encode other formats without any known problems, so this issue seems specific to feeding ffmpeg correct path parameters
Author
Owner

@pawlos commented on GitHub (Oct 6, 2023):

I could not repro this on my version (latest release 2.39 and build from source), but this line of ffmpeg output looks interesting

[concat @ 00000228ddb53840] Impossible to open 'file:temp\ScreenToGif\Recording\2023-09-30 23-48-03\Encode 2023-10-01 07-06-00-89\temp\ScreenToGif\Recording\2023-09-30 23-48-03\Encode 2023-10-01 07-06-00-89\0.png'

For some reason it looks like the path is duplicated. Also, when I test this, I have a full path to a file and here it's only a relative one.

<!-- gh-comment-id:1750227914 --> @pawlos commented on GitHub (Oct 6, 2023): I could not repro this on my version (latest release 2.39 and build from source), but this line of `ffmpeg` output looks interesting `[concat @ 00000228ddb53840] Impossible to open 'file:temp\ScreenToGif\Recording\2023-09-30 23-48-03\Encode 2023-10-01 07-06-00-89\temp\ScreenToGif\Recording\2023-09-30 23-48-03\Encode 2023-10-01 07-06-00-89\0.png'` For some reason it looks like the path is duplicated. Also, when I test this, I have a full path to a file and here it's only a relative one.
Author
Owner

@MaverickLoneshark commented on GitHub (Oct 7, 2023):

Neither full path nor relative path seem to work for me.

I could not repro this on my version (latest release 2.39 and build from source)

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

So I'm pretty sure I shouldn't have those first lines in my error messages (after all, my username isn't [redacted])...
Have you tried installing on a different machine?

<!-- gh-comment-id:1751633645 --> @MaverickLoneshark commented on GitHub (Oct 7, 2023): Neither full path nor relative path seem to work for me. > I could not repro this on my version (latest release 2.39 and build from source) ``` at ScreenToGif.Util.EncodingManager.EncodeWithFfmpeg(ExportPreset preset, List`1 listFrames, Int32 id, CancellationTokenSource tokenSource, String processing) in C:\Users\[redacted]\source\ScreenToGif\ScreenToGif\Util\EncodingManager.cs:line 1774 at ScreenToGif.Util.EncodingManager.Encode(ExportProject project, ExportPreset preset, Int32 id, CancellationTokenSource tokenSource) in C:\Users\[redacted]\source\ScreenToGif\ScreenToGif\Util\EncodingManager.cs:line 1038 ``` So I'm pretty sure I shouldn't have those first lines in *my* error messages (after all, my username isn't `[redacted]`)... Have you tried installing on a different machine?
Author
Owner

@NickeManarin commented on GitHub (Oct 7, 2023):

So I'm pretty sure I shouldn't have those first lines in my error messages (after all, my username isn't nicke)... Have you tried installing on a different machine?

That's just the path saved along with debug symbols. It's from my setup.

<!-- gh-comment-id:1751778762 --> @NickeManarin commented on GitHub (Oct 7, 2023): > So I'm pretty sure I shouldn't have those first lines in _my_ error messages (after all, my username isn't `nicke`)... Have you tried installing on a different machine? That's just the path saved along with debug symbols. It's from my setup.
Author
Owner

@NickeManarin commented on GitHub (Oct 8, 2023):

What's in your cache path? The default should be %temp% or to be safe %UserProfile%\AppData\Local\Temp.

If your environment variable %temp% is set to anything other than the default value, it may result what you are experiencing now.

<!-- gh-comment-id:1752035795 --> @NickeManarin commented on GitHub (Oct 8, 2023): What's in your cache path? The default should be `%temp%` or to be safe `%UserProfile%\AppData\Local\Temp`. If your environment variable %temp% is set to anything other than the default value, it may result what you are experiencing now.
Author
Owner

@MaverickLoneshark commented on GitHub (Oct 9, 2023):

image

Interesting, it was using a relative temp folder.
I was able to properly encode a mpeg-4 after switching to %temp%.

Problem solved!
(though it would probably be best to hide your personal build configuration paths from the error output for security reasons...)

<!-- gh-comment-id:1752205180 --> @MaverickLoneshark commented on GitHub (Oct 9, 2023): ![image](https://github.com/NickeManarin/ScreenToGif/assets/5481209/ab4354ee-58be-4bdd-b8a2-5f703f6fdf11) Interesting, it was using a relative `temp` folder. I was able to properly encode a mpeg-4 after switching to `%temp%`. Problem solved! (though it would probably be best to hide your personal build configuration paths from the error output for security reasons...)
Author
Owner

@MaverickLoneshark commented on GitHub (Oct 9, 2023):

Accidentally closed instead of just commented, my bad.
Up to you to decide, after all.

By the way, is there any chance of working in a feature request for a dark mode skin for ScreenToGif?
The bright white contrast is kind of hard on my primarily dark theme accustomed eyes.

Thank you for your swift response!
(I was expecting to hear back from you after another two weeks or something)

<!-- gh-comment-id:1752205480 --> @MaverickLoneshark commented on GitHub (Oct 9, 2023): Accidentally closed instead of just commented, my bad. Up to you to decide, after all. By the way, is there any chance of working in a feature request for a dark mode skin for ScreenToGif? The bright white contrast is kind of hard on my primarily dark theme accustomed eyes. Thank you for your swift response! (I was expecting to hear back from you after another two weeks or something)
Author
Owner

@pawlos commented on GitHub (Oct 9, 2023):

Relative path does the trick of producing an error. Maybe the fix could be that if the relative path is entered, it could be resolved to a full one on Save? I can see some code that might does do that (AdjustPath calls) so maybe it's not covering all cases in this scenario (manually entered path)?

<!-- gh-comment-id:1752345655 --> @pawlos commented on GitHub (Oct 9, 2023): Relative path does the trick of producing an error. Maybe the fix could be that if the relative path is entered, it could be resolved to a full one on `Save`? I can see some code that might does do that (`AdjustPath` calls) so maybe it's not covering all cases in this scenario (manually entered path)?
Author
Owner

@MaverickLoneshark commented on GitHub (Oct 9, 2023):

Well, that's certainly an idea, but couldn't the relative paths work by invoking the encoder from the ScreenToGif directory as the working directory or something?

Actually this might be a bit more convoluted than I first thought...
https://superuser.com/a/943258

<!-- gh-comment-id:1753149130 --> @MaverickLoneshark commented on GitHub (Oct 9, 2023): Well, that's certainly an idea, but couldn't the relative paths work by invoking the encoder from the ScreenToGif directory as the working directory or something? Actually this might be a bit more convoluted than I first thought... https://superuser.com/a/943258
Author
Owner

@pawlos commented on GitHub (Oct 9, 2023):

Well, that's certainly an idea, but couldn't the relative paths work by invoking the encoder from the ScreenToGif directory as the working directory or something?

Actually this might be a bit more convoluted than I first thought... https://superuser.com/a/943258

I'll check that one. Thanks for the link.

<!-- gh-comment-id:1753283815 --> @pawlos commented on GitHub (Oct 9, 2023): > Well, that's certainly an idea, but couldn't the relative paths work by invoking the encoder from the ScreenToGif directory as the working directory or something? > > Actually this might be a bit more convoluted than I first thought... https://superuser.com/a/943258 I'll check that one. Thanks for the link.
Author
Owner

@pawlos commented on GitHub (Oct 15, 2023):

yeah, setting the relative paths, even with the working directory is set doesn't seems to be helping ffmpeg :(

<!-- gh-comment-id:1763496390 --> @pawlos commented on GitHub (Oct 15, 2023): yeah, setting the relative paths, even with the working directory is set doesn't seems to be helping `ffmpeg` :(
Author
Owner

@shiqianwei0508 commented on GitHub (May 16, 2024):

image

Interesting, it was using a relative temp folder. I was able to properly encode a mpeg-4 after switching to %temp%.

Problem solved! (though it would probably be best to hide your personal build configuration paths from the error output for security reasons...)

thanks! You are genius !

<!-- gh-comment-id:2114531521 --> @shiqianwei0508 commented on GitHub (May 16, 2024): > ![image](https://private-user-images.githubusercontent.com/5481209/273481149-ab4354ee-58be-4bdd-b8a2-5f703f6fdf11.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTU4NDkzNzQsIm5iZiI6MTcxNTg0OTA3NCwicGF0aCI6Ii81NDgxMjA5LzI3MzQ4MTE0OS1hYjQzNTRlZS01OGJlLTRiZGQtYjhhMi01ZjcwM2Y2ZmRmMTEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDUxNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA1MTZUMDg0NDM0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZjM1YTNlMjFiZGJkNjAxMTcwNWUxMTU0YmRlZmQxMjQxMzI2YWUwZjA2NjAxNzUzM2E4OWQ2Yzc5Mzk1YzEwZSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.xVVNuDytaRN-HuxjUHI94xNj1KKdM2BmFXIF_gmjZSo) > > Interesting, it was using a relative `temp` folder. I was able to properly encode a mpeg-4 after switching to `%temp%`. > > Problem solved! (though it would probably be best to hide your personal build configuration paths from the error output for security reasons...) thanks! You are genius !
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#913
No description provided.