Merge 2 audio tracks into one inside mp4 without re-encode video?

0

New Nvidia Share allows record videos with two audio tracks: one with in-game audio and second with microphone audio.

How can I merge the audio tracks into one without re-encode the video? If possible with a command line.

I've tried with ffmpeg

ffmpeg -i 1.mp4 -filter_complex "amerge,pan=stereo:c0<c0+c2:c1<c1+c3" 11.mp4

It merges audio tracks, but it also re-encodes video.

In case it matters here is a video information:

Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42 (isom/mp42)
File size                                : 109 MiB
Duration                                 : 15 s 135 ms
Overall bit rate                         : 60.4 Mb/s
Recorded date                            : 2017
Encoded date                             : UTC 2017-10-29 18:52:34
Tagged date                              : UTC 2017-10-29 18:52:34

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L5.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 1 frame
Format settings, GOP                     : M=1, N=30
Muxing mode                              : Container profile=High@1.3
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 15 s 135 ms
Bit rate                                 : 60.0 Mb/s
Width                                    : 2 560 pixels
Height                                   : 1 440 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Frame rate                               : 59.863 FPS
Minimum frame rate                       : 56.962 FPS
Maximum frame rate                       : 62.937 FPS
Original frame rate                      : 60.000 FPS
Standard                                 : PAL
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.272
Stream size                              : 108 MiB (99%)
Title                                    : VideoHandle
Encoded date                             : UTC 2017-10-29 18:52:34
Tagged date                              : UTC 2017-10-29 18:52:34
Color range                              : Limited
Color primaries                          : BT.601 NTSC
Transfer characteristics                 : BT.470 System M
Matrix coefficients                      : BT.601
mdhd_Duration                            : 15135

Audio #1
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 14 s 964 ms
Source duration                          : 14 s 981 ms
Bit rate mode                            : Constant
Bit rate                                 : 196 kb/s
Nominal bit rate                         : 96.0 kb/s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 spf)
Compression mode                         : Lossy
Stream size                              : 358 KiB (0%)
Source stream size                       : 359 KiB (0%)
Title                                    : SoundHandle / System sounds
Encoded date                             : UTC 2017-10-29 18:52:34
Tagged date                              : UTC 2017-10-29 18:52:34
mdhd_Duration                            : 14964

Audio #2
ID                                       : 3
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 14 s 976 ms
Source duration                          : 14 s 978 ms
Bit rate mode                            : Constant
Bit rate                                 : 192 kb/s
Nominal bit rate                         : 96.0 kb/s
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 spf)
Compression mode                         : Lossy
Stream size                              : 357 KiB (0%)
Source stream size                       : 357 KiB (0%)
Title                                    : SoundHandle / Microphone
Encoded date                             : UTC 2017-10-29 18:52:34
Tagged date                              : UTC 2017-10-29 18:52:34
mdhd_Duration                            : 14976

vanowm

Posted 2017-11-02T23:53:28.443

Reputation: 204

Answers

0

If your source file is an MP4, Extract the audio track from the video with a program called Yamb.

Then combine the audio with Yamb or another audio software. Then put the video and audio back together with Yamb. Everything will be left untouched and not re-encoded.

You can also extract audio and video with Yamb and then combine/append the audio and video into an MKV file with MKVMerge. Everything will be left untouched and not re-encoded.

Mike

Posted 2017-11-02T23:53:28.443

Reputation: 1