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

[Bug] --exec doesn't work on Windows because of single quotes #11497

Closed
Reino17 opened this issue Dec 20, 2016 · 1 comment
Closed

[Bug] --exec doesn't work on Windows because of single quotes #11497

Reino17 opened this issue Dec 20, 2016 · 1 comment
Labels

Comments

@Reino17
Copy link

@Reino17 Reino17 commented Dec 20, 2016

  • I've verified and I assure that I'm running youtube-dl 2016.12.20
  • I've at least skimmed through README and most notably FAQ and BUGS sections
  • I've searched the bugtracker for similar issues including closed ones

The purpose of my issue is:

  • Bug report (encountered problems with youtube-dl)

youtube-dl.exe -vf 18 https://www.youtube.com/watch?v=QgQ-D6bvc1A --exec "ffmpeg -hide_banner
-i {} -c copy -bsf:v h264_mp4toannexb {}.new.ts"
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['-vf', '18', 'https://www.youtube.com/watch?v=QgQ-D6bvc1A', '--ex
ec', 'ffmpeg -hide_banner -i {} -c copy -bsf:v h264_mp4toannexb {}.new.ts']
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2016.12.20
[debug] Python version 3.4.4 - Windows-XP-5.1.2600-SP3
[debug] exe versions: ffmpeg N-82759-g1f5630a-Sherpya
[debug] Proxy map: {}
[youtube] QgQ-D6bvc1A: Downloading webpage
[youtube] QgQ-D6bvc1A: Downloading video info webpage
[youtube] QgQ-D6bvc1A: Extracting video information
[youtube] QgQ-D6bvc1A: Downloading MPD manifest
[debug] Invoking downloader on 'https://r4---sn-mn4vg5aa-5hns.googlevideo.com/videoplayback?g
ir=yes&itag=18&mn=sn-mn4vg5aa-5hns&signature=4EA90C7BB341BD1B8A800EB25004E3ACAD6478AA.8CF354B
272571A796E82824968C48EFC33EBBB31&key=yt6&ms=au&mv=m&mt=1482271060&dur=89.698&ei=7KlZWOO0I8Ok
1gLl3JXwCA&lmt=1482229941216632&ip=2001%3A980%3A2408%3A1%3Ad66%3Aade4%3A3e76%3Adcf5&expire=14
82292812&id=o-AEXaZmy0b4iQS8upDLzMfyiLoQVHFYYF8L0_HWVfq6TU&upn=MS76gPkPaw4&initcwndbps=251000
0&source=youtube&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%
2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&pl=35&mm=31
&ratebypass=yes&requiressl=yes&ipbits=0&mime=video%2Fmp4&clen=5668603'
[download] Amsterdam - Gewelddadige beroving toerist-QgQ-D6bvc1A.mp4 has already been downloa
ded
[download] 100% of 5.41MiB
[exec] Executing command: ffmpeg -hide_banner -i 'Amsterdam - Gewelddadige beroving toerist-Q
gQ-D6bvc1A.mp4' -c copy -bsf:v h264_mp4toannexb 'Amsterdam - Gewelddadige beroving toerist-Qg
Q-D6bvc1A.mp4'.new.ts
'Amsterdam: No such file or directory
ERROR: Command returned error code 1
Traceback (most recent call last):
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmph8curlv3\build\youtube_d
l\YoutubeDL.py", line 1837, in post_process
  File "C:\Users\dst\AppData\Roaming\Build archive\youtube-dl\rg3\tmph8curlv3\build\youtube_d
l\postprocessor\execafterdownload.py", line 26, in run
youtube_dl.utils.PostProcessingError: Command returned error code 1

--exec "ffmpeg -hide_banner -i {} -c copy -bsf:v h264_mp4toannexb {}.new.ts"
expands to
[exec] Executing command: ffmpeg -hide_banner -i 'Amsterdam - Gewelddadige beroving toerist-QgQ-D6bvc1A.mp4' -c copy -bsf:v h264_mp4toannexb 'Amsterdam - Gewelddadige beroving toerist-QgQ-D6bvc1A.mp4'.new.ts

Or in other words: {} expands to '{}'. This is bad for 2 reasons:

  1. Single quotes won't work in Windows. Hence the 'Amsterdam: No such file or directory-error.
  2. The suffix .new.ts is ignored.

No problem at all doing this manually:

ffmpeg -hide_banner -i "Amsterdam - Gewelddadige beroving toerist-QgQ-D6bvc1A.mp4" -c copy -b
sf:v h264_mp4toannexb "Amsterdam - Gewelddadige beroving toerist-QgQ-D6bvc1A.new.ts"
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Amsterdam - Gewelddadige beroving toerist-QgQ-D6bvc1
A.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2016-12-20T10:32:18.000000Z
  Duration: 00:01:29.70, start: 0.000000, bitrate: 505 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x36
0 [SAR 1:1 DAR 16:9], 407 kb/s, 24.89 fps, 25 tbr, 25 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s (d
efault)
    Metadata:
      creation_time   : 2016-12-20T10:32:18.000000Z
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
Output #0, mpegts, to 'Amsterdam - Gewelddadige beroving toerist-QgQ-D6bvc1A.new.ts':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    encoder         : Lavf57.58.101
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x36
0 [SAR 1:1 DAR 16:9], q=2-31, 407 kb/s, 24.89 fps, 25 tbr, 90k tbn, 25 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95 kb/s (d
efault)
    Metadata:
      creation_time   : 2016-12-20T10:32:18.000000Z
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 2231 fps=0.0 q=-1.0 Lsize=    6279kB time=00:01:29.67 bitrate= 573.6kbits/s speed= 574
x
video:4458kB audio:1051kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 
13.958075%
@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jan 7, 2017

Duplicate of #5889.

@yan12125 yan12125 closed this Jan 7, 2017
@dstftw dstftw added DRM duplicate and removed DRM labels Apr 1, 2017
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.