0

I'm trying to get the output name to be the same as the input name while using the pipe command in ffmpeg.

Example:

The file is called 1-Minute Audio Test for Stereo Speakers & Headphones [2ZrWHtvSog4].m4a. I'm trying to get the output filename to be automatically the same as the input file name but with the .mp3 extension.

So the final name should be 1-Minute Audio Test for Stereo Speakers & Headphones [2ZrWHtvSog4].mp3 without having to type it in manually.

Example:

yt-dlp -o - -f 139 --external-downloader aria2c --external-downloader-args '-d ./ -x 10' https://www.youtube.com/watch?v=2ZrWHtvSog4 | ffmpeg -i pipe: -codec:a libmp3lame -b:a 8000 -ac 1 -ar 8000 test_audio.mp3

These commands create a file called test_audio.mp3 I'm trying to get it to be 1-Minute Audio Test for Stereo Speakers & Headphones [2ZrWHtvSog4].mp3 without having to type it in.

I'm not sure how to pipe / get the file name variable from the input file to the output file of ffmpeg.

My thoughts were to:

  1. Get the file name from yt-dlp and place that in a variable.
  2. Use that variable as the output file name with ffmpeg
Destroy666
  • 5,299
  • 7
  • 16
  • 35
Rick T
  • 133
  • 8

0 Answers0