lettier / gifcurry

😎 The open-source, Haskell-built video editor for GIF makers.
https://lettier.github.io/gifcurry
BSD 3-Clause "New" or "Revised" License
1.35k stars 57 forks source link

Feature request: Adding timing for text #22

Closed sarmadsiddiqui closed 5 years ago

sarmadsiddiqui commented 6 years ago

Hi again. Would you consider adding a way to add timing information for overlay text? For example if I'm making a gif of a single back-and-forth conversation, it would be nice to have the first line displayed for x seconds, then the second line is displayed for y seconds.

I was thinking a possible way to implement it in the gui, perhaps something like the attached file.

with_timing_anno

Labels 1 and 2 point to the fields --similar to how you implemented it for selecting clip start and duration-- for the displayed text.

Label 3, which points to the plus button, is saying if you want to add a second line of text with different timing. Perhaps hitting the plus button adds a similar field right below it, or pops up a dialogue, like for selecting fonts. I could mock that up too, if what I'm saying is not clear.

Maybe this adds too much complexity to the program and is beyond the intended scope, but if not, it would be a cool feature to add. Thanks again, lovely program to use.

lettier commented 6 years ago

Hello @iuqiddis,

Thank you for the feature request.

Multiple time based text overlays are currently in the works. Below is a mock up demonstration.

gifcurry

You'll be able to click Add and it will display another text overlay. For each text overlay, you can set the font, size, left/right/up/down position, and the start and duration time.

This feature and being able to see the text in the preview are slated for the next major release.

I'll update this issue once the feature is finished.

Thank you for the kind words and I'm glad you're enjoying Gifcurry.

:+1:

sarmadsiddiqui commented 6 years ago

awesome. looks great. cheers.

lettier commented 6 years ago

Hello @iuqiddis,

Wanted to give you an update regarding the multiple time based text overlays feature.

It is almost complete and I'll be uploading a pre-release AppImage soon.

test

:+1:

lettier commented 6 years ago

Hello @iuqiddis,

You can now try out the pre-release AppImage for version 4.0.0.0.

:+1:

sarmadsiddiqui commented 6 years ago

The feature works great. I tried it on three different clips, easy enough to move timing and placement. thanks a lot!

can i ask about some other features introduced in version 4.0.0.0 in this thread? they are not related to the text overlaying interface. Or should i start a new thread for other comments or requests. thanks again!

lettier commented 6 years ago

Hello @iuqiddis,

I'm glad you like it.

Sure. You can ask them here if you'd like.

:+1:

sarmadsiddiqui commented 6 years ago

cool.

  1. (this is is related to the text overlay) Is there a possibility of adding a parameter for outline weight?

  2. Previously the output was as .mp4 and the quality seemed a lot better (when going for the higher quality). The webm version, even at the 'insane' quality seems pretty low quality in the clips i've tried. I can reply later with a comparison between version 3 and 4 and upload it back with the source file you shared in a different thread (I assume its not some bug on my computer). BUT, coming to my request, would you consider having output options for both h264 and webm (also because safari doesn't support webm unfortunately)

  3. Lastly (so sorry for the length), is it possible to implement importing embedded subtitles with timing and load them as pre-loaded text? This might be an edge case, but a lot of times I cut 2-3second scenes with dialogue (hence the timing for text) and often my sources have embedded subtitles. It would be cool if that can get atomically imported.

cheers.

lettier commented 6 years ago

Hello @iuqiddis,

1) Sure. Would this increase and decrease the size of the text outline? I could add it among the current text controls.

2)

It would be great to add it as a configurable option but that just isn't tenable at the moment unfortunately. :disappointed: Gifcurry will have to stay with the royalty free codec VP9 inside the WebM container for now. Even though Gifcurry does not distribute, implement, and/or link (neither statically or dynamically) with an implementation of any royalty-burdened (or any for that matter) codec, it is safer to stick with the WebM VP9 combination.

That said, the VP9 codec is very comparable to what you might find used in MP4 and in some cases it is better. The good news is I have increased the quality of the output video considerably to that of 1080p HD video. I've also increased the insane quality level by removing all color count restrictions. When saving as a video, Gifcurry now bypasses the GIF creation step and goes straight to creating the video after the annotation step.

Input video: https://svs.gsfc.nasa.gov/vis/a010000/a012000/a012034/Ice_Edge_UHD_YouTube.mp4 Sample output video (900 width @ Insane): https://streamable.com/zg03z Sample output GIF (900 width @ High): gif-test-high

You can try out the new settings using the pre-release 4.0.0.0 AppImage.

In the future, Gifcurry will switch to the AV1 codec which should be supported by Safari since Apple joined the consortium.

For now, you can pass Gifcurry's output to Curlew or in the terminal just type ffmpeg -i gifcurry.webm gifcurry.mp4.

3) I could offer a load option for a Structured Subtitle Format (SRT) file that would then automatically create all of the texts. Or are you saying it would read the subtitles directly from the input video file? This may be difficult depending on how many languages are stored with the video. If they are "burned in" then it would not be possible to read them from the video file.

:+1:

sarmadsiddiqui commented 6 years ago
  1. yes, exactly. just decreasing the size of the outline. thanks.

  2. I tried the app image link with one of my sources and yup, the insane quality is much nicer now (I'd consider it good/great, whereas the previous output was pretty poor).

For this particular scene, the previous 4.0.0.0 was outputting both 'insane' and 'low' webm at ~160 kB, which besides being strange, resulted in poor output quality in both cases. Now the 'insane' setting with AppImage download results in a ~1.0MB high quality output which is awesome; for comparison the 'medium' setting GIF is 24MB and a lot poorer in quality (but still usaable i suppose). I'm using 720p resolution as output to play around with the clips, thus the high GIF size.

Version Quality Size (kB) Qualitative Assessment
new insane 1121 high/great
new high 1121 high/great
new medium 937 maybe slightly worse than above two
new low 833 slightly worse. still perfectly adaquate
old insane 158 blocky/not good
old high 158 blocky/not good
old low 165 blocky/not good

For a different clip, I get similar ratios between insane and low (~83%):

Version Quality Size (kB) Qualitative Assessment
new insane 770 high/great
new high 770 high/great
new low 636 slightly worse. still perfectly adaquate

I was going to suggest maybe playing around with the settings to only have insane, medium and low, where the low setting generates a file that is approximately 50-60% in size of the insane output? Based on my meager testing on two action-based clips, the the difference between insane and high webm doesn't seem to be much (as seen in the above tables).

As for going for webm, yeah, I can understand only having the option for the royalty-free option. I think you're playing it safe, but that's your call :) . I'll just stick to ffmpeg for h264 output, as you suggested.

  1. I was thinking more along just loading the embedded subtitles from the source clip to start off with. I assumed this would exclude burned-in subtitles. Maybe default to the first embedded track, or look for a particular language (English in my case, though of course that would vary by the user's wants or needs).

Thanks again for listening. Really appreciate your responses. Cheers.

lettier commented 6 years ago

Hello @iuqiddis,

1) I have updated the pre-release AppImage to include an outline size selection. I also added text rotation.

2) I went ahead and tweaked the settings reducing the quality options to only High, Medium, and Low.

Input video: https://svs.gsfc.nasa.gov/vis/a010000/a012000/a012034/Ice_Edge_UHD_YouTube.mp4

Video output at 1280x720:

3) I could do something similar that I do for Movie Monad where it will list the available languages, you would select one, and then it would import them for you.

:+1:

lettier commented 5 years ago

Hello @iuqiddis

You can now import SRT subtitles in version 6.0.0.0.

:+1: