[GH-ISSUE #1251] [Feature Request] Add customizable import settings for FFMPEG #924

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

Originally created by @Dephrilibrium on GitHub (Nov 14, 2023).
Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/1251

Originally assigned to: @NickeManarin on GitHub.

Is your feature request related to a problem? Please describe.
I have a raspberry pi cam which I use to stream a fabrication process to my network. For presentations I want to convert the long videos (up to a few hours) into a short <1min timelapse video.

The network-stream I've captured via VLC into an avi-file. When the avi-file is opened afterwards, VLC tells me the avi has a broken index. That's why I converted it to mp4 using xMediaRecode. This fixes the broken index message and I tried to import the new MP4 to screen2gif.

When starting the import using FFMPEG, I noticed, that FFMPEG stop importing after a few seconds. I observed this by checking the CPU load of the ffmpeg-process in the task-manager. It starts with 80-100% and drops back to idle (1-5%) after a few seconds. I tried to wait for more than 30 minutes, but the progress bar of screen2gif was not doing any progress anymore.

Since screen2gif didn't showed me any output what's going on, I tried to use it directly via powershell. Using:

./ffmpeg -i "<Path>\<to>\<video>\Saphir Segmented Cut.mp4" -vf fps=1/3 "<Path>/<to>/<extracted>/img_%06d.png"

With this command FFMPEG extracted without any problems and, in addition, I just got the wanted timelapseframes, instead of importing all frames, which most of them are deleted afterwards directly.

Describe the solution you'd like
Therefore, options or a textbox to customize the import process with FFMPEG would be great. Especially the fps-option of FFMPEG which allows the extraction of one frame each Nth second, e.g.: fps=1/4 extracts one frame all 4 seconds.

  • Preview on/off
  • FFMPEG options or a textbox to specifiy the options as arguments
    • Especially the fps option would be great to speed up the import significantly (e.g.: fps=1/4 imports one frame each 4 seconds)
  • An output windows for FFMPEG to see what FFMPEG is doing.

Describe alternatives you've considered
I used FFMPEG via powershell and was able to extract just the frames I need for my timelapse. These I imported than as a image sequence into screen2gif to fine-tune the frame duration and create a timelapse-MP4

Additional context

Originally created by @Dephrilibrium on GitHub (Nov 14, 2023). Original GitHub issue: https://github.com/NickeManarin/ScreenToGif/issues/1251 Originally assigned to: @NickeManarin on GitHub. **Is your feature request related to a problem? Please describe.** I have a raspberry pi cam which I use to stream a fabrication process to my network. For presentations I want to convert the long videos (up to a few hours) into a short <1min timelapse video. The network-stream I've captured via VLC into an avi-file. When the avi-file is opened afterwards, VLC tells me the avi has a broken index. That's why I converted it to mp4 using xMediaRecode. This fixes the broken index message and I tried to import the new MP4 to screen2gif. When starting the import using FFMPEG, I noticed, that FFMPEG stop importing after a few seconds. I observed this by checking the CPU load of the ffmpeg-process in the task-manager. It starts with 80-100% and drops back to idle (1-5%) after a few seconds. I tried to wait for more than 30 minutes, but the progress bar of screen2gif was not doing any progress anymore. Since screen2gif didn't showed me any output what's going on, I tried to use it directly via powershell. Using: `./ffmpeg -i "<Path>\<to>\<video>\Saphir Segmented Cut.mp4" -vf fps=1/3 "<Path>/<to>/<extracted>/img_%06d.png"` With this command FFMPEG extracted without any problems and, in addition, I just got the wanted timelapseframes, instead of importing all frames, which most of them are deleted afterwards directly. **Describe the solution you'd like** Therefore, options or a textbox to customize the import process with FFMPEG would be great. Especially the fps-option of FFMPEG which allows the extraction of one frame each Nth second, e.g.: fps=1/4 extracts one frame all 4 seconds. - Preview on/off - FFMPEG options or a textbox to specifiy the options as arguments - Especially the `fps` option would be great to speed up the import **significantly** (e.g.: fps=1/4 imports one frame each 4 seconds) - An output windows for FFMPEG to see what FFMPEG is doing. **Describe alternatives you've considered** I used FFMPEG via powershell and was able to extract just the frames I need for my timelapse. These I imported than as a image sequence into screen2gif to fine-tune the frame duration and create a timelapse-MP4 **Additional context**
Author
Owner

@NickeManarin commented on GitHub (Dec 5, 2023):

Nice feature request!

I could also use the improved framerate controls for the normal import process as well.
Maybe I can add something like what's used for the recorder, a field for numeraical values and a selector with perSecond/perMinute/perHour.

<!-- gh-comment-id:1840560356 --> @NickeManarin commented on GitHub (Dec 5, 2023): Nice feature request! I could also use the improved framerate controls for the normal import process as well. Maybe I can add something like what's used for the recorder, a field for numeraical values and a selector with perSecond/perMinute/perHour.
Author
Owner

@Dephrilibrium commented on GitHub (Dec 5, 2023):

Heyho ,

thanks for the feedback. That would be great!

Just for completeness, for the moment I wrote myself a small workaround powershell script which asks for the

  • Path of the input file,
  • how much images should be extracted per second (given in FPS) and
  • Folderpath where to store the extracted images

for the codeline of my initial issue comment:
./ffmpeg -i "<Path>\<to>\<video>\Saphir Segmented Cut.mp4" -vf fps=1/3 "<Path>/<to>/<extracted>/img_%06d.png"

Content of my FFMPEG_Extractor.ps1:

$vidPath = Read-Host -Prompt "Insert video path"
echo "Extracting images from: $vidPath"

$fps = Read-Host -Prompt "How much images (in FPS)"
echo "Extracting images every $fps FPS"

$imgPath = Read-Host -Prompt "Define a storepath for the images"
echo "Extracting to $imgPath"


echo "Running FFMPEG:"
echo "C:\ProgramData\ScreenToGif\ffmpeg.exe -i $vidPath -vf fps=$fps $imgPath\img_%06d.png"

C:\ProgramData\ScreenToGif\ffmpeg.exe -i "$vidPath" -vf fps=$fps "$imgPath\img_%06d.png"
Read-Host -Prompt "EOS. Hit enter to close..."

Kind regards,
Deph

<!-- gh-comment-id:1840707645 --> @Dephrilibrium commented on GitHub (Dec 5, 2023): Heyho , thanks for the feedback. That would be great! Just for completeness, for the moment I wrote myself a small workaround powershell script which asks for the - Path of the input file, - how much images should be extracted per second (given in FPS) and - Folderpath where to store the extracted images for the codeline of my initial issue comment: `./ffmpeg -i "<Path>\<to>\<video>\Saphir Segmented Cut.mp4" -vf fps=1/3 "<Path>/<to>/<extracted>/img_%06d.png"` Content of my `FFMPEG_Extractor.ps1`: ``` $vidPath = Read-Host -Prompt "Insert video path" echo "Extracting images from: $vidPath" $fps = Read-Host -Prompt "How much images (in FPS)" echo "Extracting images every $fps FPS" $imgPath = Read-Host -Prompt "Define a storepath for the images" echo "Extracting to $imgPath" echo "Running FFMPEG:" echo "C:\ProgramData\ScreenToGif\ffmpeg.exe -i $vidPath -vf fps=$fps $imgPath\img_%06d.png" C:\ProgramData\ScreenToGif\ffmpeg.exe -i "$vidPath" -vf fps=$fps "$imgPath\img_%06d.png" Read-Host -Prompt "EOS. Hit enter to close..." ``` Kind regards, Deph
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#924
No description provided.