Jump to content

Andile Johnson

Member
  • Posts

    1
  • Joined

  • Last visited

Andile Johnson's Achievements

Helping Hand

Helping Hand (3/5)

0

Reputation

  1. Using a hotkey on Mac, I want to trigger a file conversion with ffmpeg (I'm converting a .mov file to .mp4). The process uses terminal, and I can get it working perfectly the way that I want it when I manually enter the file-path of the input file in terminal. However I want to automate this process to input the correct filename/path for whatever file I have selected, and also to be able to activate it with a hotkey. Desired process: 1. Use custom hotkey to start process (no further manual input after this) 2. Automatically copy file path from MacOS for selected file (key combo item Alt CMD C) 3. Combine the clipboard contents into the correct placeholder in the pre-written ffmpeg code 4. Pass this new combined text (code plus name/path) into terminal and activate the video encoding process 5. Get a notification once encoding is complete (I have notification working properly via terminal so not necessary to use Alfred). I have most things working, but step 3-4 is where I'm going wrong, I can't seem to combine the clipboard of filename/filepath with the ffmpeg code. Here's an example of text from the clipboard: Volumes/Drive/Client/_Renders/Filename.mov Here's the ffmpeg terminal code: for file in {path/filename - this is where I want to paste}; do ffmpeg -i "$file" -c:v libx264 -b:v 15M -vf scale=1920:1080 -c:a aac -b:a 320k -ar 48000 -pix_fmt yuv420p "${file%.mov}.mp4"; osascript -e 'display notification "Complete" with title "MP4"' & done Any help will be appreciated
×
×
  • Create New...