{"action":"created","issue":{"url":"https://api.github.com/repos/rg3/youtube-dl/issues/2817","labels_url":"https://api.github.com/repos/rg3/youtube-dl/issues/2817/labels{/name}","comments_url":"https://api.github.com/repos/rg3/youtube-dl/issues/2817/comments","events_url":"https://api.github.com/repos/rg3/youtube-dl/issues/2817/events","html_url":"https://github.com/rg3/youtube-dl/issues/2817","id":32338378,"number":2817,"title":"faststart","user":{"login":"svnpenn","id":926619,"avatar_url":"https://avatars.githubusercontent.com/u/926619?v=3","gravatar_id":"","url":"https://api.github.com/users/svnpenn","html_url":"https://github.com/svnpenn","followers_url":"https://api.github.com/users/svnpenn/followers","following_url":"https://api.github.com/users/svnpenn/following{/other_user}","gists_url":"https://api.github.com/users/svnpenn/gists{/gist_id}","starred_url":"https://api.github.com/users/svnpenn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svnpenn/subscriptions","organizations_url":"https://api.github.com/users/svnpenn/orgs","repos_url":"https://api.github.com/users/svnpenn/repos","events_url":"https://api.github.com/users/svnpenn/events{/privacy}","received_events_url":"https://api.github.com/users/svnpenn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rg3/youtube-dl/labels/request","name":"request","color":"165725"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-04-28T07:57:53Z","updated_at":"2015-02-26T21:16:28Z","closed_at":null,"body":"If I run this command\r\n\r\n~~~\r\nyoutube-dl -f 22 -x --add-metadata --id 8ATu1BiOPZA\r\n~~~\r\n\r\nIt does almost everything I need\r\n\r\n- downloads the file with the highest quality audio (192k)\r\n- extracts said audio without re-encoding\r\n- adds metadata\r\n\r\nHowever using `-x` invokes FFmpeg. FFmpeg by default will not set [`faststart`](http://multimedia.cx/eggs/improving-qt-faststart)\r\nin fact if a file already has `faststart` it will even be removed. Without\r\n`faststart` these files will not play in my car. This can only be remedied by\r\nrunning FFmpeg with [the correct flag](http://superuser.com/a/616799)\r\n\r\n~~~\r\nffmpeg -i 8ATu1BiOPZA.m4a -c copy -movflags faststart outfile.m4a\r\n~~~\r\n\r\nIt would be nice if `youtube-dl` had this as an option, or perhaps even\r\nas the default when using FFmpeg."},"comment":{"url":"https://api.github.com/repos/rg3/youtube-dl/issues/comments/76275184","html_url":"https://github.com/rg3/youtube-dl/issues/2817#issuecomment-76275184","issue_url":"https://api.github.com/repos/rg3/youtube-dl/issues/2817","id":76275184,"user":{"login":"jaimeMF","id":1239727,"avatar_url":"https://avatars.githubusercontent.com/u/1239727?v=3","gravatar_id":"","url":"https://api.github.com/users/jaimeMF","html_url":"https://github.com/jaimeMF","followers_url":"https://api.github.com/users/jaimeMF/followers","following_url":"https://api.github.com/users/jaimeMF/following{/other_user}","gists_url":"https://api.github.com/users/jaimeMF/gists{/gist_id}","starred_url":"https://api.github.com/users/jaimeMF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaimeMF/subscriptions","organizations_url":"https://api.github.com/users/jaimeMF/orgs","repos_url":"https://api.github.com/users/jaimeMF/repos","events_url":"https://api.github.com/users/jaimeMF/events{/privacy}","received_events_url":"https://api.github.com/users/jaimeMF/received_events","type":"User","site_admin":false},"created_at":"2015-02-26T21:16:28Z","updated_at":"2015-02-26T21:16:28Z","body":"For a few versions you can use the `--exec` option to run an arbitrary command, for example you could use the script `faststart.sh`:\r\n```bash\r\n#!/bin/sh\r\n\r\nVIDEO=$1\r\nTEMPFILE=$VIDEO.temp\r\nmv \"$VIDEO\" \"$TEMPFILE\"\r\n\r\nffmpeg -i \"$TEMPFILE\" -c copy -movflags faststart \"$VIDEO\"\r\nrm \"$TEMPFILE\"\r\n```\r\n\r\nwith the command `youtube-dl URL -x --add-metadata --exec './faststart.sh {}'`.\r\nIs that enough?"}}