Page 1 of 1

[avconv] Video Passthrough + Multiple Audio Tracks

Posted: Thu Jul 14, 2016 10:08 am
by plittlefield
Hi Folks,

I would like to change a few DVD rips, so that they have multiple audio tracks.

This is the original command:-

HandBrakeCLI --input /dev/dvd --main-feature --audio-lang-list eng --aencoder copy:ac3 --output "movie.mp4"

Instead of ripping the original DVD again, I would like to run HandBrakeCLI with some sort of video passthrough which keeps the video track untouched and then just encode the single original DVD surround audio track in to 2 audio tracks... AAC + AC-3 Passthrough.

Stream #0.0(und): Video: h264 (Main), yuv420p, 720x424 [PAR 64:45 DAR 128:53], 903 kb/s, 25 fps, 25 tbr, 90k tbn, 180k tbc
Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, fltp, 159 kb/s
Stream #0.2(eng): Audio: ac3, 48000 Hz, 5.1, fltp, 384 kb/s

However, I cannot see a video passthrough option on the command line help.

If HandBrakeCLI cannot do this, what is the best ffmpeg alternative?

Thanks for your help.

Regards,

Paully

HandBrake 20160611220333-44a359d-master
Ubuntu 14.04.4 LTS

Re: Video Passthrough + Multiple Audio Tracks

Posted: Thu Jul 14, 2016 10:18 am
by rollin_eng
HB cannot do video passthrough, I'm not sure of alternatives on linux.

Re: Video Passthrough + Multiple Audio Tracks

Posted: Thu Jul 14, 2016 10:54 am
by Deleted User 11865
plittlefield wrote:If HandBrakeCLI cannot do this, what is the best ffmpeg alternative?
avconv :P

What's wrong with using ffmpeg?

Re: Video Passthrough + Multiple Audio Tracks

Posted: Thu Jul 14, 2016 11:40 am
by plittlefield
OK, now I know HB cannot do video passthrough (although it kind of goes against "what it does", IMHO I think it would be neat to have "--encoder copy" as an option, why not? :-)

OK, so I have used ffmpeg or avconv before, I was not sure of the specific command line options.

So far, I have built this command line up, but wanted to check with you experts on the "multiple audio tracks" part, so that it creates a libaac and a copied ac-3 stream.

avconv -i input.mp4 -vcodec copy -acodec libfaac -ac 2 -ar 48000 -ab 160k -acodec copy output.mp4

I am not familiar with the 'map' option, but basically, I just need to encode the existing ac-3 audio as an aac track, then copy that same ac-3 track as the second audio track.

From this...

Stream #0.0(und): Video: h264 (Main), yuv420p, 720x424 [PAR 64:45 DAR 128:53], 911 kb/s, 25 fps, 25 tbr, 90k tbn, 180k tbc
Stream #0.1(eng): Audio: ac3, 48000 Hz, 5.1, fltp, 448 kb/s

...to this...

Stream #0.0(und): Video: h264 (Main), yuv420p, 720x424 [PAR 64:45 DAR 128:53], 911 kb/s, 25 fps, 25 tbr, 90k tbn, 180k tbc
Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, fltp, 160 kb/s
Stream #0.2(eng): Audio: ac3, 48000 Hz, 5.1, fltp, 448 kb/s

Is this possible, and can you show me the correct full ffmpeg / avconv command line please?

Thank you!

:-)

Paully

Re: Video Passthrough + Multiple Audio Tracks

Posted: Thu Jul 14, 2016 12:22 pm
by Deleted User 11865
https://libav.org/avconv.html#Main-options
https://libav.org/avconv.html#Advanced-options

It should be noted that -vcodec and -acodec are aliases to legacy option names that don't always work well in my experience. I recommend using -codec instead.

I would try this:

Code: Select all

avconv -i INPUT -map 0:0 -map 0:1 -map 0:1 -codec:0 copy -codec:1 libfdk_aac -b:1 160k -ar:1 48k -ac:1 2 -codec:2 copy OUTPUT

Code: Select all

-map 0:0 -map 0:1 -map 0:1
select input stream 0:0, input stream 0:1 and input stream 0:1 again

Code: Select all

-codec:0 copy
set encoder to passthgrough for output stream 0 (video track)

Code: Select all

-codec:1 libfdk_aac
set encoder to passthgrough for output stream 1 (first audio track) (you should build avconv with libfdk_aac, it's better than libfaac)

Code: Select all

-b:1 160k -ar:1 48k -ac:1 2
set bitrate to 160 Kbps, sample rate to 48 kHz and number of channels to 2 (Stereo) for output stream 1 (first audfio track)

Code: Select all

-codec:2 copy
set encoder to passthgrough for output stream 2 (second audio track)

Re: [avconv] Video Passthrough + Multiple Audio Tracks

Posted: Thu Jul 14, 2016 3:15 pm
by plittlefield
Amazing, thank you for being so quick and so detailed with your reply.

Much appreciated.

Regards,

Paully

Re: Video Passthrough + Multiple Audio Tracks

Posted: Thu Jul 14, 2016 4:17 pm
by mduell
plittlefield wrote:OK, now I know HB cannot do video passthrough (although it kind of goes against "what it does", IMHO I think it would be neat to have "--encoder copy" as an option, why not? :-)
Would merely require a full rearchitecting of the entire program.

There are plenty of tools on all platforms for remuxing with audio changes. HB is not one of them.

Re: [avconv] Video Passthrough + Multiple Audio Tracks

Posted: Thu Jul 14, 2016 5:23 pm
by Deleted User 13735
If you need to automate the process, all you need to do is figure out a script to run Handbrake and MP4Box interdependently, I would think.

Re: [avconv] Video Passthrough + Multiple Audio Tracks

Posted: Thu Jul 14, 2016 5:59 pm
by Deleted User 11865
Moved to Tiki Bar.

Re: [avconv] Video Passthrough + Multiple Audio Tracks

Posted: Mon Aug 08, 2016 4:15 pm
by plittlefield
Firstly, thank you to everyone for replying to this thread.

Rodeo's command line works a treat.

How would I also include the 'chapter' metadata information in the finished MP4 file?

Here is a sample source MP4 file that I would like to copy the video, convert and add 2 audio tracks, drop the subtitles track, but add the Chapters information...

http://pastebin.com/3PD8KTiJ

Many thanks,

Paully

Re: [avconv] Video Passthrough + Multiple Audio Tracks

Posted: Mon Aug 08, 2016 4:34 pm
by Deleted User 11865
No clue about that, sorry.

Re: [avconv] Video Passthrough + Multiple Audio Tracks

Posted: Wed Jan 11, 2017 1:42 am
by Deleted User 13735
You should be able to do that straightaway in mp4Box.

Re: [avconv] Video Passthrough + Multiple Audio Tracks

Posted: Thu Jul 20, 2017 8:43 am
by --=BJ=--
Well, i must say... it would be nice to have an option for video-pass through in handbrake. Just for making new .ssa files or audio conversions only.

You have my vote for a future update :)

Re: [avconv] Video Passthrough + Multiple Audio Tracks

Posted: Thu Jul 20, 2017 2:28 pm
by Woodstock
With dozens of free programs out there to do remuxing (which is what you're asking for), why would it be "nice" to add to a program that was never intended to be "just" a remuxer?

Re: [avconv] Video Passthrough + Multiple Audio Tracks

Posted: Thu Jul 20, 2017 10:52 pm
by BradleyS
--=BJ=-- Let's try to avoid resurrecting 7 month old threads.