News for hackers. Stuff that matters.
Re:Show HN: FFmpeg UI by taylorfinley on Thursday June 15, 2023 @02:32AM (#36337109)
ChatGPT makes a wonderful natural language interface for ffmpeg. I like to ask for a bash script that uses ffmpeg to achieve my goal. Recent example output:

  #!/bin/bash

  # Set the input file name
  input_file="input.mp4"

  # Trim the videos
  ffmpeg -i $input_file -ss 00:01:08.5 -to 00:01:11.05 -c copy shot1.mp4
  ffmpeg -i $input_file -ss 00:01:13.3 -to 00:01:22 -c copy shot2.mp4
  ffmpeg -i $input_file -ss 00:01:24 -c copy shot3.mp4

  # Prepare the list of files to concatenate
  echo "file 'shot1.mp4'" > files.txt
  echo "file 'shot2.mp4'" >> files.txt
  echo "file 'shot3.mp4'" >> files.txt

  # Concatenate the video segments
  ffmpeg -f concat -safe 0 -i files.txt -c copy output.mp4
Re:Show HN: FFmpeg UI by bkyan on Thursday June 15, 2023 @06:02AM (#36338354)
Same with the GPT-4 API for embedding within apps!

Example (in Go):

  post_json := `{"model": "gpt-4-0613", "messages": [{"role": "system", "content": "You are an AI assistant for an instance of ffmpeg.  Respond to the user message by running the run_ffmpeg_command function with command line parameters for the video conversion functionality that the user asked for.  Use input.mp4 for the input filename and use output.mp4 for the output filename."}, {"role": "user", "content": ` + string(user_message_json) + `}], "functions": [{ "name": "run_ffmpeg_command", "description": "Run a ffmpeg command with parameters", "parameters": { "type": "object", "properties": { "params": { "type": "array", "items": { "type": "string", "description": "a parameter for the ffmpeg command" }, "description": "The parameters to pass into the ffmpeg command" } }, "required": ["params"] } } ], "function_call": { "name": "run_ffmpeg_command" } }`
Re:Show HN: FFmpeg UI by ybouane on Thursday June 15, 2023 @01:28PM (#36343871)
Very interesting!