Simple dialog to pass user's text to command line script

Today I made a context menu entry that:

  1. generates square thumbnail (256x256) for any video file (suported by ffmpeg). That command doesn't take into account aspect ratio yet (but it will)
  2. draws transparent box on top of it
  3. draws some text in the box (at the moment it draws the text I'm writing directly in the command line below -- I marked its position with: TEXT GOES HERE)

What I'd like to achieve is some kind of input dialog that shows up and asks me for the text I want to draw on the thumbnail.

Is there anybody willing to help? :slight_smile:

D:\video\ffmpeg\ffmpeg.exe -i {filepath} -ss 400 -filter_complex scale=256x256:force_original_aspect_ratio=increase,crop=256:256,drawbox=y=ih/PHI:color=black@0.5:width=iw:height=48:t=max,drawtext="fontsize=22:fontcolor=white:fontfile='c\:\\windows\\fonts\\arial.ttf':text='TEXT GOES HERE':x=(w-tw)/2:y=(h/PHI)+th" -f image2 -pix_fmt rgba -vframes 1 -y {sourcepath}folder.jpg

Thanks in advance.

You probably won't need scripting for this.

{dlgstring} can ask for text from the user and insert it into a command line.

(If you need to do things like handle quotes and escape/convert them into something else for the command line, then a script might be needed, but not if it's simply inserting whatever is typed into the command line.)

Thanks for your help - i'm trying to implement it now.

Just one more question I forgot to ask.
As you can see the whole "ffmpeg -i ...." command is quite lengthy. Can I split it between few lines with some special character at the end of each line ?


I don't think you can, at least with a normal command.

You could use variables to split things up a bit but it's probably more trouble than it's worth unless you're going to be editing it a lot in the future.

Thank you.
And {dlgstring} works fine.