Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass in filename arguments from youtube-dl to exec? #16700

Closed
MichaelMallett opened this issue Jun 12, 2018 · 1 comment
Closed

How to pass in filename arguments from youtube-dl to exec? #16700

MichaelMallett opened this issue Jun 12, 2018 · 1 comment

Comments

@MichaelMallett
Copy link

@MichaelMallett MichaelMallett commented Jun 12, 2018


Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2018.06.11. If it's not, read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2018.06.11

Before submitting an issue make sure you have:

  • At least skimmed through the README, most notably the FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones
  • Checked that provided video/audio/playlist URLs (if any) are alive and playable in a browser

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

Description of your issue, suggested solution and other information

I'm struggling to figure out the format for -exec when running ffmpeg, I'm attempting to cut an audio file from youtube into a 30 second clip. However, I can't figure out a way to use {}, or youtube-dl output formats in the exec command.

If I try to use {} as the output name like so
youtube-dl -x https://soundcloud.com/rinsefm/sasasas110618 --exec "ffmpeg -ss 00:01:00.00 -i {} -ss 00:00:00.00 -t 00:00:30.00 {}"

I get a
Error while decoding stream #0:0: Invalid data found when processing input, presumably because it's overwriting the file while reading.

If I try and use the youtube-dl format for naming I get a syntax error as this is not valid for ffmpeg

youtube-dl -x https://soundcloud.com/rinsefm/sasasas110618 --exec 'ffmpeg -ss 00:01:00.00 -i {} -ss 00:00:00.00 -t 00:00:30.00 %(uploader)s%(title)s.%(ext)s'

I've been searching for hours in the find -exec documentation an across forums and I can't find a way to alter the name of the output file dynamically from the input file in exec. Ideally I'd like to use the original filename but append _clip to the name. Any pointers?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Jun 12, 2018

Input and output names should be different as you already mentioned. Also --exec does not support output template.

@dstftw dstftw closed this Jun 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.