Resource icon

Animated gif Creator 1.00

koala

Active Member
koala submitted a new resource:

Animated gif Creator - Create animated gif/video snippets from your OBS recordings on the fly

This script will start an external ffmpeg to extract a section of the recorded video and export this as animated gif or mp4/webm video snippet.

If you want to export a small section of your capture area as an animated gif or to some small video snippet in general, this is for you.

You mark the section with the borders of a group, then start recording with the script hotkey. Recording is stopped automatically a few seconds later and the section will be exported from the recorded video. If...

Read more about this resource...
 

aPenald

New Member
I have a feature request that would help with making seamless looping gifs with ease.
If possible, a button that sets the 'Video Length' variable, to the duration of an input source of your choice?
That way, you can use the 'Speed' option on the media source input source to make everything else match the speed/duration of the main input source.

You would do it in command line on windows like so
Code:
FOR /F %i IN ('ffprobe -v error -show_entries "format=duration" -of "default=noprint_wrappers=1:nokey=1" -i input.gif') DO set gifDuration=%i
 

koala

Active Member
Unfortunately, I don't understand the "seamless" part of the request.

Currently, there is just endless gif looping over exactly the length you specify in the plugin settings. I explicitly set -loop 0. I guess you don't want a setting to toggle between no looping and endless looping? Although that's a valid function and very easy to implement. Just a setting in the plugin and one more variable in the *.cmd passed through to ffmpeg.

But what is the "seamless" part? You seem to want the plugin to somehow refer to some media source, read the "speed" property, and do what with this? If you playback and record a media source, you already have a video file and should probably use one of the existing video-to-gif converters and directly convert the video file without OBS. And if you need to postprocess that pre-existing video, you should probably create the animated gif with your postprocessing software, not with OBS (which is no postprocessing software).

To have some control over a somewhat seamless looping, the plugin supports time increments in the length setting that corresponds to the length of a frame within the gif. If you have a seam, increment or decrement the length in the plugin settings one or two frames backwards or forward, then let the plugin process the video again, until you find a setting with least seam. I don't know how one can automate this. There is always the human eye who has to decide if there is a visible seam or not.
 

aPenald

New Member
Unfortunately, I don't understand the "seamless" part of the request.

Currently, there is just endless gif looping over exactly the length you specify in the plugin settings. I explicitly set -loop 0. I guess you don't want a setting to toggle between no looping and endless looping? Although that's a valid function and very easy to implement. Just a setting in the plugin and one more variable in the *.cmd passed through to ffmpeg.

But what is the "seamless" part? You seem to want the plugin to somehow refer to some media source, read the "speed" property, and do what with this? If you playback and record a media source, you already have a video file and should probably use one of the existing video-to-gif converters and directly convert the video file without OBS. And if you need to postprocess that pre-existing video, you should probably create the animated gif with your postprocessing software, not with OBS (which is no postprocessing software).

To have some control over a somewhat seamless looping, the plugin supports time increments in the length setting that corresponds to the length of a frame within the gif. If you have a seam, increment or decrement the length in the plugin settings one or two frames backwards or forward, then let the plugin process the video again, until you find a setting with least seam. I don't know how one can automate this. There is always the human eye who has to decide if there is a visible seam or not.
I'm sorry I might've worded that wrong, I just wanted a button that would change the "Video_Length" variable, to the duration of a media file of your own choice. So that one could for example, use OBS to add effects to a gif without changing the original duration of that gif.
If you set the "Show Image" toggle hotkey, on the same hotkey as Record GIF, the final gif your script renders will end up being the original length of the gif you started out with :D
 

Chrisnetika

New Member
way an option can be added to copy the transparency/chroma? Trying to make an animated gif of a game where i chromekey out a color and made it transparent however resulting gifs are not transparent and instead have black. Can the black be transparent?
 

koala

Active Member
The plugin is just a postprocessor for an OBS created video. It constructs a ffmpeg command line to convert an original video created by OBS to a new video you want. So it has to work with what OBS writes to the original video.

So if you tell me how to configure OBS with a proper encoder+container format that actually writes an alpha channel into the original file (I don't know any such configuration!), I can look if changes are required to forward this alpha information into the video created by ffmpeg.

There is a quick+dirty alternative for gif only if there is no alpha in the original video: just declare one existing color as transparent, ffor example black with #000000, if this is the color OBS writes for transparency in a *.mp4 or *.mkv file. Then tell ffmpeg to create the gif with this color as transparent. This is how all gif creating software works, as far as I can tell. I will look into the required settings in the plugin - it probably requires an input field for the color and a check box to activate the feature if output is gif (or just one check box with "use black as transparent"), and finally the proper handling of this information in the created ffmpeg command line.
 

DJ Rabbit

New Member
Man I want to get this working but I really don't understand the ffmpeg.. Can anyone show screenshots or something?
 

aPenald

New Member
Top