{"action":"created","issue":{"url":"https://api.github.com/repos/rg3/youtube-dl/issues/9534","repository_url":"https://api.github.com/repos/rg3/youtube-dl","labels_url":"https://api.github.com/repos/rg3/youtube-dl/issues/9534/labels{/name}","comments_url":"https://api.github.com/repos/rg3/youtube-dl/issues/9534/comments","events_url":"https://api.github.com/repos/rg3/youtube-dl/issues/9534/events","html_url":"https://github.com/rg3/youtube-dl/issues/9534","id":155569820,"number":9534,"title":"ERROR: Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument","user":{"login":"hadmut","id":941640,"avatar_url":"https://avatars.githubusercontent.com/u/941640?v=3","gravatar_id":"","url":"https://api.github.com/users/hadmut","html_url":"https://github.com/hadmut","followers_url":"https://api.github.com/users/hadmut/followers","following_url":"https://api.github.com/users/hadmut/following{/other_user}","gists_url":"https://api.github.com/users/hadmut/gists{/gist_id}","starred_url":"https://api.github.com/users/hadmut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hadmut/subscriptions","organizations_url":"https://api.github.com/users/hadmut/orgs","repos_url":"https://api.github.com/users/hadmut/repos","events_url":"https://api.github.com/users/hadmut/events{/privacy}","received_events_url":"https://api.github.com/users/hadmut/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-18T18:26:40Z","updated_at":"2016-05-18T19:17:31Z","closed_at":"2016-05-18T18:37:38Z","body":"Hi,\r\n\r\nyoutube-dl does not properly convert audio. e.g. when doing \r\n\r\n youtube-dl -v --audio-format aac --merge-output-format mp4 'https://www.youtube.com/results?search_query=vjf3WMzPvpY'\r\n[debug] System config: []\r\n[debug] User config: []\r\n[debug] Command-line args: [u'-v', u'--audio-format', u'aac', u'--merge-output-format', u'mp4', u'https://www.youtube.com/results?search_query=vjf3WMzPvpY']\r\n[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8\r\n[debug] youtube-dl version 2016.05.10\r\n[debug] Python version 2.7.11+ - Linux-4.4.0-22-generic-x86_64-with-Ubuntu-16.04-xenial\r\n[debug] exe versions: avconv 2.8.6-1ubuntu2, avprobe 2.8.6-1ubuntu2, ffmpeg 2.8.6-1ubuntu2, ffprobe 2.8.6-1ubuntu2, rtmpdump 2.4\r\n[debug] Proxy map: {}\r\n[youtube:search_url] vjf3WMzPvpY: Downloading webpage\r\n[download] Downloading playlist: vjf3WMzPvpY\r\n[youtube:search_url] playlist vjf3WMzPvpY: Downloading 1 videos\r\n[download] Downloading video 1 of 1\r\n[youtube] vjf3WMzPvpY: Downloading webpage\r\n[youtube] vjf3WMzPvpY: Downloading video info webpage\r\n[youtube] vjf3WMzPvpY: Extracting video information\r\n[youtube] vjf3WMzPvpY: Downloading MPD manifest\r\n[debug] Invoking downloader on u'https://r1---sn-cxg7ene7.googlevideo.com/videoplayback?id=be37f758cccfbe96&itag=137&source=youtube&requiressl=yes&pl=17&initcwndbps=1792500&mn=sn-cxg7ene7&mm=31&mv=m&ms=au&ratebypass=yes&mime=video/mp4&gir=yes&clen=101607074&lmt=1463391925128486&dur=487.353&upn=MT_fUCY56t4&sver=3&fexp=9410706,9413139,9416126,9416891,9419452,9421084,9422596,9428398,9429014,9431012,9432057,9433096,9433946,9434086,9435265,9435772,9436323,9436348,9436446,9436617,9436810,9436871&signature=57A60CA80A34245E7BFAFF31BEEF27F87AC9DBE8.8538FF753BD7BC4A2C1A5B97B9C982DAF2408780&key=dg_yt0&mt=1463594106&ip=91.64.206.115&ipbits=0&expire=1463616010&sparams=ip,ipbits,expire,id,itag,source,requiressl,pl,initcwndbps,mn,mm,mv,ms,ratebypass,mime,gir,clen,lmt,dur'\r\n[download] Destination: Russischer Historiker über vier Einschränkungen der deutschen Souveränität durch 2+4-Vertrag-vjf3WMzPvpY.f137.mp4\r\n[download] 100% of 96.90MiB in 17:07\r\n[debug] Invoking downloader on u'https://r1---sn-cxg7ene7.googlevideo.com/videoplayback?id=be37f758cccfbe96&itag=251&source=youtube&requiressl=yes&pl=17&initcwndbps=1792500&mn=sn-cxg7ene7&mm=31&mv=m&ms=au&ratebypass=yes&mime=audio/webm&gir=yes&clen=8694398&lmt=1463271709121292&dur=487.361&upn=MT_fUCY56t4&sver=3&fexp=9410706,9413139,9416126,9416891,9419452,9421084,9422596,9428398,9429014,9431012,9432057,9433096,9433946,9434086,9435265,9435772,9436323,9436348,9436446,9436617,9436810,9436871&signature=0E784D73A4A2E1917671D436DBBDB6D5270CEB6E.84FA260856408B1EC763AA78EC0E6FFF3892B964&key=dg_yt0&mt=1463594106&ip=91.64.206.115&ipbits=0&expire=1463616010&sparams=ip,ipbits,expire,id,itag,source,requiressl,pl,initcwndbps,mn,mm,mv,ms,ratebypass,mime,gir,clen,lmt,dur'\r\n[download] Destination: Russischer Historiker über vier Einschränkungen der deutschen Souveränität durch 2+4-Vertrag-vjf3WMzPvpY.f251.webm\r\n[download] 100% of 8.29MiB in 01:28\r\n[ffmpeg] Merging formats into \"Russischer Historiker über vier Einschränkungen der deutschen Souveränität durch 2+4-Vertrag-vjf3WMzPvpY.mp4\"\r\n[debug] ffmpeg command line: avconv -y -i 'file:Russischer Historiker über vier Einschränkungen der deutschen Souveränität durch 2+4-Vertrag-vjf3WMzPvpY.f137.mp4' -i 'file:Russischer Historiker über vier Einschränkungen der deutschen Souveränität durch 2+4-Vertrag-vjf3WMzPvpY.f251.webm' -c copy -map 0:v:0 -map 1:a:0 'file:Russischer Historiker über vier Einschränkungen der deutschen Souveränität durch 2+4-Vertrag-vjf3WMzPvpY.temp.mp4'\r\nERROR: Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument\r\nTraceback (most recent call last):\r\n  File \"/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py\", line 1781, in post_process\r\n    files_to_delete, info = pp.run(info)\r\n  File \"/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py\", line 445, in run\r\n    self.run_ffmpeg_multiple_files(info['__files_to_merge'], temp_filename, args)\r\n  File \"/usr/local/bin/youtube-dl/youtube_dl/postprocessor/ffmpeg.py\", line 168, in run_ffmpeg_multiple_files\r\n    raise FFmpegPostProcessorError(msg)\r\nFFmpegPostProcessorError\r\n\r\n\r\n\r\nit tries to put opus audio into mp4, which seems to cause an error message by avconv. Just try to run the avconv from command line.\r\n"},"comment":{"url":"https://api.github.com/repos/rg3/youtube-dl/issues/comments/220129922","html_url":"https://github.com/rg3/youtube-dl/issues/9534#issuecomment-220129922","issue_url":"https://api.github.com/repos/rg3/youtube-dl/issues/9534","id":220129922,"user":{"login":"dstftw","id":1908898,"avatar_url":"https://avatars.githubusercontent.com/u/1908898?v=3","gravatar_id":"","url":"https://api.github.com/users/dstftw","html_url":"https://github.com/dstftw","followers_url":"https://api.github.com/users/dstftw/followers","following_url":"https://api.github.com/users/dstftw/following{/other_user}","gists_url":"https://api.github.com/users/dstftw/gists{/gist_id}","starred_url":"https://api.github.com/users/dstftw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dstftw/subscriptions","organizations_url":"https://api.github.com/users/dstftw/orgs","repos_url":"https://api.github.com/users/dstftw/repos","events_url":"https://api.github.com/users/dstftw/events{/privacy}","received_events_url":"https://api.github.com/users/dstftw/received_events","type":"User","site_admin":false},"created_at":"2016-05-18T19:17:31Z","updated_at":"2016-05-18T19:17:31Z","body":"The closest thing you can do in order to achieve\r\n>video with AVC video codec, AAC audio codec, and both packed into mp4\r\n\r\n(you had to mention this in the OP post in the first place since it's not possible to decipher that your intention was actually to download audio, convert it, download video and mux them).\r\n\r\nis to download formats separately (`-f bestvideo[ext=mp4]` and `-f bestaudio -x --audio-format aac`) and mux them by hand."}}