title: FFMPEG - How to get exactly file name and add a drawtext in each output video of a rendering queue
body: <p>I need some help with this FFMPEG code running in Windows:</p>
  
  <pre><code>@ECHO OFF
  Setlocal EnableDelayedExpansion
  
  Set INPUT=D:\In
  
  Set OUTPUT=D:\Out
  
  for %%a in ("%INPUT%\*.*") DO ffmpeg -i "%%a" -vf "drawtext=text=${%%a}:x=105:y=120:fontfile=font/impact.ttf:fontsize=25:fontcolor=white" -vcodec libx264 -pix_fmt yuv420p -r 30 -g 60 -b:v 2000k -acodec libmp3lame -b:a 128k -ar 44100 -preset ultrafast "%OUTPUT%/%%~na.mp4"
  </code></pre>
  
  <p>I have some video files like <code>The.Input.Video.mp4</code> in <code>INPUT</code> folder and I want to create output videos with the filename text added, so I use <code>drawtext=text=${%%a}</code>. The problem is, the received text for each video shows as "<code>D:\FFMPEG\BIN\The.Input.Video.MP4</code>" (It contains the file path, the "." and the mp4 suffix). How can I remove them and get the filename as "The Input Video" only. Thanks alot.</p>