[avconv] Video Passthrough + Multiple Audio Tracks
-
- Posts: 38
- Joined: Wed Nov 18, 2009 10:03 am
[avconv] Video Passthrough + Multiple Audio Tracks
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
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
-
- Veteran User
- Posts: 4854
- Joined: Wed May 04, 2011 11:06 pm
Re: Video Passthrough + Multiple Audio Tracks
HB cannot do video passthrough, I'm not sure of alternatives on linux.
Re: Video Passthrough + Multiple Audio Tracks
avconvplittlefield wrote:If HandBrakeCLI cannot do this, what is the best ffmpeg alternative?
What's wrong with using ffmpeg?
-
- Posts: 38
- Joined: Wed Nov 18, 2009 10:03 am
Re: Video Passthrough + Multiple Audio Tracks
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
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
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:
select input stream 0:0, input stream 0:1 and input stream 0:1 again
set encoder to passthgrough for output stream 0 (video track)
set encoder to passthgrough for output stream 1 (first audio track) (you should build avconv with libfdk_aac, it's better than libfaac)
set bitrate to 160 Kbps, sample rate to 48 kHz and number of channels to 2 (Stereo) for output stream 1 (first audfio track)
set encoder to passthgrough for output stream 2 (second audio track)
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
Code: Select all
-codec:0 copy
Code: Select all
-codec:1 libfdk_aac
Code: Select all
-b:1 160k -ar:1 48k -ac:1 2
Code: Select all
-codec:2 copy
-
- Posts: 38
- Joined: Wed Nov 18, 2009 10:03 am
Re: [avconv] Video Passthrough + Multiple Audio Tracks
Amazing, thank you for being so quick and so detailed with your reply.
Much appreciated.
Regards,
Paully
Much appreciated.
Regards,
Paully
Re: Video Passthrough + Multiple Audio Tracks
Would merely require a full rearchitecting of the entire program.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?
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
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.
-
- Posts: 38
- Joined: Wed Nov 18, 2009 10:03 am
Re: [avconv] Video Passthrough + Multiple Audio Tracks
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
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
No clue about that, sorry.
Re: [avconv] Video Passthrough + Multiple Audio Tracks
You should be able to do that straightaway in mp4Box.
Re: [avconv] Video Passthrough + Multiple Audio Tracks
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
You have my vote for a future update
Re: [avconv] Video Passthrough + Multiple Audio Tracks
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
--=BJ=-- Let's try to avoid resurrecting 7 month old threads.