{"action":"created","issue":{"url":"https://api.github.com/repos/donmelton/video-transcoding-scripts/issues/16","labels_url":"https://api.github.com/repos/donmelton/video-transcoding-scripts/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/donmelton/video-transcoding-scripts/issues/16/comments","events_url":"https://api.github.com/repos/donmelton/video-transcoding-scripts/issues/16/events","html_url":"https://github.com/donmelton/video-transcoding-scripts/issues/16","id":56435145,"number":16,"title":"Unexpected results when invoking transcode-video.sh with the add-audio argument","user":{"login":"kford","id":821268,"avatar_url":"https://avatars.githubusercontent.com/u/821268?v=3","gravatar_id":"","url":"https://api.github.com/users/kford","html_url":"https://github.com/kford","followers_url":"https://api.github.com/users/kford/followers","following_url":"https://api.github.com/users/kford/following{/other_user}","gists_url":"https://api.github.com/users/kford/gists{/gist_id}","starred_url":"https://api.github.com/users/kford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kford/subscriptions","organizations_url":"https://api.github.com/users/kford/orgs","repos_url":"https://api.github.com/users/kford/repos","events_url":"https://api.github.com/users/kford/events{/privacy}","received_events_url":"https://api.github.com/users/kford/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-03T20:51:02Z","updated_at":"2015-02-03T22:23:11Z","closed_at":"2015-02-03T21:51:17Z","body":"Hi Don,\r\n\r\nThanks for the great scripts!\r\n\r\nI'm having a problem that is likely an issue with the way I'm using transcode-video.sh.  I have source video that has a single (or multiple) AC-3 audio tracks.  I wanted to convert them all to AAC (not add additional tracks) during transcoding.  Here's an example\r\n\r\n##### source.mkv (mediainfo tells me there is only a single audio track, like below)\r\n> Audio\r\n> ID                                       : 2\r\n> Format                                   : AC-3\r\n> Format/Info                              : Audio Coding 3\r\n\r\n##### I execute the following transcode-video.sh command\r\n\r\n    transcode-video.sh --slow --mkv --add-subtitle 1 --add-audio 1 --crop 54:58:0:0 source.mkv\r\n\r\n##### And it produces target.mkv (mediainfo tells me there are now 3 audo tracks in the target file, like below)\r\n> Audio #1\r\n> ID                                       : 2\r\n> Format                                   : AC-3\r\n> Format/Info                              : Audio Coding 3\r\n> ...\r\n> Audio #2\r\n> ID                                       : 3\r\n> Format                                   : AAC\r\n> Format/Info                              : Advanced Audio Codec\r\n> ...\r\n> Audio #3\r\n> ID                                       : 4\r\n> Format                                   : AAC\r\n> Format/Info                              : Advanced Audio Codec\r\n\r\nI'd appreciate any advice you can offer\r\n\r\nThank you."},"comment":{"url":"https://api.github.com/repos/donmelton/video-transcoding-scripts/issues/comments/72748534","html_url":"https://github.com/donmelton/video-transcoding-scripts/issues/16#issuecomment-72748534","issue_url":"https://api.github.com/repos/donmelton/video-transcoding-scripts/issues/16","id":72748534,"user":{"login":"kford","id":821268,"avatar_url":"https://avatars.githubusercontent.com/u/821268?v=3","gravatar_id":"","url":"https://api.github.com/users/kford","html_url":"https://github.com/kford","followers_url":"https://api.github.com/users/kford/followers","following_url":"https://api.github.com/users/kford/following{/other_user}","gists_url":"https://api.github.com/users/kford/gists{/gist_id}","starred_url":"https://api.github.com/users/kford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kford/subscriptions","organizations_url":"https://api.github.com/users/kford/orgs","repos_url":"https://api.github.com/users/kford/repos","events_url":"https://api.github.com/users/kford/events{/privacy}","received_events_url":"https://api.github.com/users/kford/received_events","type":"User","site_admin":false},"created_at":"2015-02-03T22:23:11Z","updated_at":"2015-02-03T22:23:11Z","body":"Thanks for the detailed response Don!  I've read it and I'll be updating my batch script to reflect what you've just shared with me.  Your example command was\r\n\r\n    transcode-video.sh --slow --mkv --no-surround --add-audio 2 --add-audio 3 --add-subtitle 1 --crop 54:58:0:0 source.mkv\r\n\r\nI assume, based on the quote below, that you added audio tracks 2 and 3 because track 1 was added by default (and because you specified no-surround, it was added as AAC), so you query the source to determine number of tracks, and add them all, excluding the first one which is added by default.  Correct?\r\n\r\n> For the case of an input file with multiple audio tracks, you'll need to identify how many\r\n> additional tracks there are and simply use an --add-audio option for each track with the\r\n> appropriate track number. For example, here's how you might handle a file with two\r\n> additional audio tracks:"}}