attempting to copy only one selected audio track

Questions involving a Windows version of FFmpeg.
Post Reply
CaptainKen
Posts: 5
Joined: Thu Jan 05, 2017 3:37 pm

attempting to copy only one selected audio track

Post by CaptainKen » Thu Jan 05, 2017 3:50 pm

I have a 2 audio channel avi that I'm trying to copy to new file with the video and only audio track 2. I've tried multiple variations of the following, but can only get the first audio track each time.

ffmpeg -i INPUT.avi -c copy -map 0:v:0 -map 0:a:2 OUTPUT.avi

Code: Select all

General
Complete name                            : INPUT.avi
Format                                   : AVI
Format/Info                              : Audio Video Interleave
File size                                : 1.37 GiB
Duration                                 : 1h 27mn
Overall bit rate                         : 2 245 Kbps
Movie name                               : INPUT
Director                                 : Me
Writing application                      : VirtualDubMod 1.5.10.2 (build 2540/release)
Copyright                                : http://hitfilms.ru/

Video
ID                                       : 0
Format                                   : MPEG-4 Visual
Format profile                           : Advanced [email protected]
Format settings, BVOP                    : 2
Format settings, QPel                    : No
Format settings, GMC                     : No warppoints
Format settings, Matrix                  : Default (MPEG)
Muxing mode                              : Packed bitstream
Codec ID                                 : XVID
Codec ID/Hint                            : XviD
Duration                                 : 1h 27mn
Bit rate                                 : 1 654 Kbps
Width                                    : 704 pixels
Height                                   : 384 pixels
Display aspect ratio                     : 1.85:1
Frame rate                               : 25.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.245
Stream size                              : 1.01 GiB (74%)
Writing library                          : XviD 1.2.1 (UTC 2008-12-04)

Audio #1
ID                                       : 1
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Codec ID                                 : 2000
Duration                                 : 1h 27mn
Bit rate mode                            : Constant
Bit rate                                 : 384 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Frame rate                               : 31.250 fps (1536 spf)
Compression mode                         : Lossy
Stream size                              : 241 MiB (17%)
Alignment                                : Split accross interleaves
Interleave, duration                     : 40 ms (1.00 video frame)
Interleave, preload duration             : 500 ms

Audio #2
ID                                       : 2
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Mode extension                           : CM (complete main)
Format settings, Endianness              : Big
Codec ID                                 : 2000
Duration                                 : 1h 27mn
Bit rate mode                            : Constant
Bit rate                                 : 192 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Frame rate                               : 31.250 fps (1536 spf)
Compression mode                         : Lossy
Stream size                              : 120 MiB (9%)
Alignment                                : Split accross interleaves
Interleave, duration                     : 40 ms (1.00 video frame)
Interleave, preload duration             : 500 ms
Would someone please provide a working solution?

Ken

llogan
Posts: 332
Joined: Fri Mar 14, 2014 3:29 am

Re: attempting to copy only one selected audio track

Post by llogan » Wed Jan 11, 2017 6:18 pm

Show the complete console output from your ffmpeg command.

CaptainKen
Posts: 5
Joined: Thu Jan 05, 2017 3:37 pm

Re: attempting to copy only one selected audio track

Post by CaptainKen » Thu Jan 12, 2017 3:04 pm

I was able to get it working by removing the "v" and the "a" as shown here:

ffmpeg -i Input.avi -c copy -map 0:0 -map 0:2 -shortest Output.avi

I guess that they are no longer supported? Or are they only used if working with a video and audio input file?

llogan
Posts: 332
Joined: Fri Mar 14, 2014 3:29 am

Re: attempting to copy only one selected audio track

Post by llogan » Thu Jan 12, 2017 5:35 pm

They should work, but 0:a:2 refers to the 3rd audio stream.

CaptainKen
Posts: 5
Joined: Thu Jan 05, 2017 3:37 pm

Re: attempting to copy only one selected audio track

Post by CaptainKen » Thu Jan 12, 2017 6:16 pm

I tried multiple variations such as: 0:a:1 and 0:a:2. Although each attempt included 0:v:0.

llogan
Posts: 332
Joined: Fri Mar 14, 2014 3:29 am

Re: attempting to copy only one selected audio track

Post by llogan » Thu Jan 12, 2017 7:08 pm

I can't provide any other input without seeing the complete console output from the command.

CaptainKen
Posts: 5
Joined: Thu Jan 05, 2017 3:37 pm

Re: attempting to copy only one selected audio track

Post by CaptainKen » Fri Jan 13, 2017 3:19 am

Sorry, but once I got it to work I deleted the original file.

However, I just tried it again with a different file, and now the original posting works using -c copy -map 0:v:0 -map 0:a:1. :o

I greatly appreciate your attempt to help and apologize if you feel that I've wasted your time. Thank you!

Post Reply
'