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

-postprocessor-args Applied Multiple Times #26863

Closed
antgiant opened this issue Oct 11, 2020 · 3 comments
Closed

-postprocessor-args Applied Multiple Times #26863

antgiant opened this issue Oct 11, 2020 · 3 comments
Labels

Comments

@antgiant
Copy link

@antgiant antgiant commented Oct 11, 2020

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.09.20
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

youtube-dl -f bestaudio --extract-audio --audio-format mp3 -o "Testing.%(ext)s"  --embed-thumbnail --add-metadata --postprocessor-args "-ss 46:01 " "https://vimeo.com/464541793" --verbose
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-f', 'bestaudio', '--extract-audio', '--audio-format', 'mp3', '-o', 'Testing.%(ext)s', '--embed-thumbnail', '--add-metadata', '--postprocessor-args', '-ss 46:01 ', 'https://vimeo.com/464541793', '--verbose']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2020.09.20
[debug] Python version 3.4.4 (CPython) - Windows-10-10.0.17763
[debug] exe versions: ffmpeg 2020-10-07-git-a086b73e1f-essentials_build-www.gyan.dev, ffprobe 2020-10-07-git-a086b73e1f-essentials_build-www.gyan.dev
[debug] Proxy map: {}
[vimeo] 464541793: Downloading webpage
[vimeo] 464541793: Extracting information
[vimeo] 464541793: Downloading JSON metadata
[vimeo] 464541793: Downloading JSON metadata
WARNING: Unable to download JSON metadata: HTTP Error 403: Forbidden
[vimeo] 464541793: Downloading akfire_interconnect_quic m3u8 information
[vimeo] 464541793: Downloading akfire_interconnect_quic m3u8 information
[vimeo] 464541793: Downloading fastly_skyfire m3u8 information
[vimeo] 464541793: Downloading fastly_skyfire m3u8 information
[vimeo] 464541793: Downloading akfire_interconnect_quic MPD information
[vimeo] 464541793: Downloading akfire_interconnect_quic MPD information
[vimeo] 464541793: Downloading fastly_skyfire MPD information
[vimeo] 464541793: Downloading fastly_skyfire MPD information
[vimeo] 464541793: Downloading thumbnail ...
[vimeo] 464541793: Writing thumbnail to: Testing.jpg
[debug] Invoking downloader on 'https://skyfire.vimeocdn.com/1602399887-0x309c3f8c9348306fbccb28e57078997b9fafbfec/3d60fe57-3444-49d0-b21d-ab5e3fc42b85/sep/video/7ce39f59,a390af55,b05423e8,c49277e9,620496d1/master.mpd?base64_init=1'
[dashsegments] Total fragments: 909
[download] Destination: Testing.m4a
[download] 100% of 165.86MiB in 04:45
[ffmpeg] Correcting container in "Testing.m4a"
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:Testing.m4a" -c copy -f mp4 -ss "46:01" "file:Testing.temp.m4a"
[debug] ffmpeg command line: ffprobe -show_streams "file:Testing.m4a"
[ffmpeg] Destination: Testing.mp3
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:Testing.m4a" -vn -acodec libmp3lame "-q:a" 5 -ss "46:01" "file:Testing.mp3"
Deleting original file Testing.m4a (pass -k to keep)
[ffmpeg] Adding metadata to 'Testing.mp3'
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:Testing.mp3" -c copy -metadata "date=20201003" -metadata "title=2020-10-10 - Tabernacling with God by Pastor Chandler Tarbox" -metadata "comment=The weekly Livestream of the Spring Meadows SDA church." -metadata "purl=https://vimeo.com/464541793" -metadata "description=The weekly Livestream of the Spring Meadows SDA church." -metadata "artist=Spring Meadows SDA" -ss "46:01" "file:Testing.temp.mp3"
ERROR: file:Testing.mp3: Invalid argument
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpksi3o1r1\build\youtube_dl\YoutubeDL.py", line 2065, in post_process
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpksi3o1r1\build\youtube_dl\postprocessor\ffmpeg.py", line 509, in run
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\ytdl-org\tmpksi3o1r1\build\youtube_dl\postprocessor\ffmpeg.py", line 235, in run_ffmpeg_multiple_files
youtube_dl.postprocessor.ffmpeg.FFmpegPostProcessorError: file:Testing.mp3: Invalid argument

Description

I am attempting to accomplish downloading a part of a video. Since #622 makes it clear there is not currently support for that I have attempted to use the -postprocessor-args option to pass in a start time (-ss). However, that command is then applied twice completely breaking it as it doubles the amount cut off the front and just breaks the the -to command completely.
Here is the relevant part of the full log

[ffmpeg] Correcting container in "Testing.m4a"
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:Testing.m4a" -c copy -f mp4 -ss "46:01" "file:Testing.temp.m4a"
[debug] ffmpeg command line: ffprobe -show_streams "file:Testing.m4a"
[ffmpeg] Destination: Testing.mp3
[debug] ffmpeg command line: ffmpeg -y -loglevel "repeat+info" -i "file:Testing.m4a" -vn -acodec libmp3lame "-q:a" 5 -ss "46:01" "file:Testing.mp3"

I also tried the --external-downloader-args method described in #12347 and those args were completely ignored, resulting in full length download.

While for me this breaks trimming it would also break a number of other uses for -postprocessor-args as it will double up any processing done via -postprocessor-args.

@antgiant
Copy link
Author

@antgiant antgiant commented Oct 11, 2020

see this thread - https://unix.stackexchange.com/questions/230481/how-to-download-portion-of-video-with-youtube-dl-command

I did. In fact my command is pretty much a directly this answer from that thread. I also mentioned trying --external-downloader-args. That was me trying to turn the first several answers on the thread you mentioned into a single command. but it seems that is broken in youtube-dl at the moment as well.

Either way I consider it a bug that -postprocessor-args are applied twice. Far more that just my particular use case will be negatively impacted by that.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Oct 17, 2020

This is expected behavior, --postprocessor-args is applied to each post processor.

@dstftw dstftw closed this Oct 17, 2020
@dstftw dstftw added the invalid label Oct 17, 2020
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
3 participants
You can’t perform that action at this time.