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

Could not write header for output file #0 (incorrect codec parameters ?), .temp extension #5674

Closed
hedii opened this issue May 11, 2015 · 4 comments

Comments

@hedii
Copy link
Contributor

@hedii hedii commented May 11, 2015

I am having some problems with this command.
The result is 3 files:

  • Un requin a la grande motte-cINHZVtwack.f141.m4a
  • Un requin a la grande motte-cINHZVtwack.f247.webm
  • Un requin a la grande motte-cINHZVtwack.temp.mkv

Note the .temp at the end of the supposed converted file, this is my problem.

youtube-dl -v https://www.youtube.com/watch?v=cINHZVtwack
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'https://www.youtube.com/watch?v=cINHZVtwack']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.05.10
[debug] Python version 2.7.6 - Linux-3.13.0-32-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] exe versions: avconv 9.18-6, avprobe 9.18-6, ffmpeg N-42858-gdbdc6e5-
[debug] Proxy map: {}
[youtube] cINHZVtwack: Downloading webpage
[youtube] cINHZVtwack: Extracting video information
[youtube] cINHZVtwack: Downloading DASH manifest
WARNING: You have requested formats incompatible for merge. The formats will be merged into mkv
[debug] Invoking downloader on 'https://r19---sn-25ge7nez.googlevideo.com/videoplayback?id=708347655b7069c9&itag=247&source=youtube&requiressl=yes&pl=24&mm=31&mv=m&ms=au&ratebypass=yes&mime=video/webm&gir=yes&clen=9856887&lmt=1430114731367809&dur=37.971&sver=3&signature=119745698DD1BF60FE5E4B50CBFDD7E13A3F8E47.14E1AA535637BC35A0A3D4932D357482C223F58C&key=dg_yt0&fexp=907263,934954,9405995,9406196,9407887,9408142,9408622,9408687,9408707,9409251,9410705,9414626,948124,952612,952637,952642&upn=90_bkvDAg08&mt=1431334685&ip=193.248.36.34&ipbits=0&expire=1431356387&sparams=ip,ipbits,expire,id,itag,source,requiressl,pl,mm,mv,ms,ratebypass,mime,gir,clen,lmt,dur'
[download] Resuming download at byte 2096128
[download] Destination: Un requin a la grande motte-cINHZVtwack.f247.webm
[download] 100% of 9.40MiB in 00:00
[debug] Invoking downloader on 'https://r19---sn-25ge7nez.googlevideo.com/videoplayback?id=708347655b7069c9&itag=141&source=youtube&requiressl=yes&pl=24&mm=31&mv=m&ms=au&ratebypass=yes&mime=audio/mp4&gir=yes&clen=916075&lmt=1429090110210971&dur=38.057&sver=3&signature=4F0E9069D4184848DBF0ADB26DC4413F97E2B696.7AA07D085845635983B9C66EDA5ED1A5BEB43502&key=dg_yt0&fexp=907263,934954,9405995,9406196,9407887,9408142,9408622,9408687,9408707,9409251,9410705,9414626,948124,952612,952637,952642&upn=90_bkvDAg08&mt=1431334685&ip=193.248.36.34&ipbits=0&expire=1431356387&sparams=ip,ipbits,expire,id,itag,source,requiressl,pl,mm,mv,ms,ratebypass,mime,gir,clen,lmt,dur'
[download] Destination: Un requin a la grande motte-cINHZVtwack.f141.m4a
[download] 100% of 894.60KiB in 00:00
[ffmpeg] Merging formats into "Un requin a la grande motte-cINHZVtwack.mkv"
WARNING: Your copy of avconv is outdated, update avconv to version 10-0 or newer if you encounter any errors.
[debug] ffmpeg command line: avconv -y -i 'Un requin a la grande motte-cINHZVtwack.f247.webm' -i 'Un requin a la grande motte-cINHZVtwack.f141.m4a' -c copy -map 0:v:0 -map 1:a:0 'Un requin a la grande motte-cINHZVtwack.temp.mkv'
ERROR: Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1529, in post_process
    files_to_delete, info = pp.run(info)
  File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 590, in run
    self.run_ffmpeg_multiple_files(info['__files_to_merge'], temp_filename, args)
  File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py", line 148, in run_ffmpeg_multiple_files
    raise FFmpegPostProcessorError(msg)
FFmpegPostProcessorError
@hedii hedii changed the title incomplete conversion, .temp extension Could not write header for output file #0 (incorrect codec parameters ?), .temp extension May 11, 2015
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented May 11, 2015

WARNING: Your copy of avconv is outdated, update avconv to version 10-0 or newer if you encounter any errors.

You'll have to update avconv or (if ffmpeg N-42858-gdbdc6e5- is new enough) use the --prefer-ffmpeg option.

@jaimeMF jaimeMF closed this May 11, 2015
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented May 11, 2015

Or if you don't want to get the video as a single file (worse quality), use the -f best option (as explained in the last two paragraphs of the FORMATS SELECTION section).

@hedii
Copy link
Contributor Author

@hedii hedii commented May 11, 2015

ok thx, i updated avconv to 11.3-6

with this command:

/usr/local/bin/youtube-dl -v --newline -o "/home/hedi/%(title)s-%(id)s.%(ext)s" --restrict-filenames --format bestvideo+bestaudio/best --merge-output-format mp4 'https://www.youtube.com/watch?v=cINHZVtwack'

I get:

[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'--newline', u'-o', u'/home/hedi/%(title)s-%(id)s.%(ext)s', u'--restrict-filenames', u'--format', u'bestvideo+bestaudio/best', u'--merge-output-format', u'mp4', u'https://www.youtube.com/watch?v=cINHZVtwack']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.05.10
[debug] Python version 2.7.6 - Linux-3.13.0-32-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] exe versions: avconv 11.3-6, avprobe 11.3-6, ffmpeg N-42858-gdbdc6e5-
[debug] Proxy map: {}
[youtube] cINHZVtwack: Downloading webpage
[youtube] cINHZVtwack: Extracting video information
[youtube] cINHZVtwack: Downloading DASH manifest
[debug] Invoking downloader on 'https://r19---sn-25ge7nez.googlevideo.com/videoplayback?id=708347655b7069c9&itag=247&source=youtube&requiressl=yes&ms=au&mv=m&pl=24&mm=31&ratebypass=yes&mime=video/webm&gir=yes&clen=9856887&lmt=1430114731367809&dur=37.971&fexp=907263,919154,934954,9405699,9407536,9407991,9408142,9408227,9408586,9408708,9412472,9413159,945137,946008,948124,952612,952637,952642&upn=NY4XLe_GzsE&mt=1431336230&sver=3&signature=3C8F8C0A328762C2FDEC030B9B5B12E3DEC5798D.670DE02551F1042F16F65592DAB80B4B8263BD80&key=dg_yt0&ip=193.248.36.34&ipbits=0&expire=1431357882&sparams=ip,ipbits,expire,id,itag,source,requiressl,ms,mv,pl,mm,ratebypass,mime,gir,clen,lmt,dur'
[download] Destination: /home/hedi/Un_requin_a_la_grande_motte-cINHZVtwack.f247.webm
[download]   0.0% of 9.40MiB at 37.39KiB/s ETA 04:17
[download]   0.0% of 9.40MiB at 110.85KiB/s ETA 01:26
[download]   0.1% of 9.40MiB at 256.28KiB/s ETA 00:37
[download]   0.2% of 9.40MiB at 543.24KiB/s ETA 00:17
[download]   0.3% of 9.40MiB at  1.04MiB/s ETA 00:09
[download]   0.7% of 9.40MiB at  1.01MiB/s ETA 00:09
[download]   1.3% of 9.40MiB at  1.39MiB/s ETA 00:06
[download]   2.6% of 9.40MiB at  2.15MiB/s ETA 00:04
[download]   5.3% of 9.40MiB at  3.47MiB/s ETA 00:02
[download]  10.6% of 9.40MiB at  5.84MiB/s ETA 00:01
[download]  21.3% of 9.40MiB at  9.99MiB/s ETA 00:00
ERROR: unable to download video data: [Errno 1] _ssl.c:1429: error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1411, in process_info
    partial_success = dl(fname, new_info)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1359, in dl
    return fd.download(name, info)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/common.py", line 342, in download
    return self.real_download(filename, info_dict)
  File "/usr/local/bin/youtube-dl/youtube_dl/downloader/http.py", line 145, in real_download
    data_block = data.read(block_size if not is_test else min(block_size, data_len - byte_counter))
  File "/usr/lib/python2.7/socket.py", line 380, in read
    data = self._sock.recv(left)
  File "/usr/lib/python2.7/httplib.py", line 567, in read
    s = self.fp.read(amt)
  File "/usr/lib/python2.7/socket.py", line 380, in read
    data = self._sock.recv(left)
  File "/usr/lib/python2.7/ssl.py", line 341, in recv
    return self.read(buflen)
  File "/usr/lib/python2.7/ssl.py", line 260, in read
    return self._sslobj.read(len)
SSLError: [Errno 1] _ssl.c:1429: error:1408F119:SSL routines:SSL3_GET_RECORD:decryption failed or bad record mac

I do want the best audio and best video and convert them with avconv to an mp4 file

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented May 11, 2015

That's not an error in youtube-dl, you can try to download it again. (I guess it's temporary, since you could download the same video and format in the other folder).

Note that webm can't be merged in an mp4 file. If you only want to get an mp4 file at the end, you have to use -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]'.

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.