Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER for Video Editing/Mangling

Reply
 
Thread Tools Display Modes
Old 03-01-2020, 09:15 AM   #1
James HE
Human being with feelings
 
James HE's Avatar
 
Join Date: Mar 2007
Location: I'm in a barn
Posts: 4,467
Default REAPER not seeing multichannel audio on .mkv

I swear this was working for me recently. I have a bunch of .mkv files I need to edit.
They contain 4 channel audio, however REAPER only sees them as 2ch. If I watch the files in VLC, I can set the audio channel to 3 and hear the other tracks, So I know they are there.

Is there some setting I need to change?
James HE is offline   Reply With Quote
Old 03-03-2020, 02:22 AM   #2
FixItInPost
Human being with feelings
 
Join Date: Jun 2018
Location: South Africa
Posts: 24
Default

Hi James HE,

There are 2 methods of storing multiple instances of audio in a file - multi-channel and multi-stream/track.

Multi-channel - multiple audio channels are contained in a single audio stream e.g. 5.1 surround sound. WAV (Waveform Audio File Format) files can only store multi-channel audio e.g. 2 channel Stereo, 5.1 surround. Some field recorders record various audio sources as multi-channel WAV files.

Multi-stream/track - multiple audio instances are contained in separate audio streams. Typical usage includes different language tracks for a single video file (e.g. English, German, etc for a film). In theory you could have multi-streams/tracks that could have a mix of multi-channel, stereo channel, and mono, all in one file. Matroska (.MKV) files can handle multi-streams/tracks.

Since you mention that you "set the audio channel to 3" within VLC player makes me think that your Matroska (MKV) file contains multi-stream/track audio as it’s almost impossible to isolate a single channel in a multi-channel file within VLC. If you can see more that one track when you click Audio -> Audio Track then you have multi-stream/track audio. Another way within VLC to see what streams a given file has is to bring up the Codec Information window (Ctrl+J in Windows, Mac ??) - if you see multiple audio streams listed then you have a multi-stream/track file.

I read somewhere on the forum that REAPER cannot handle multi-stream/track audio, just multi channel audio, hence the "Channel Mode" option within the Media Item Properties window. Perhaps someone can clarify this?
FixItInPost is offline   Reply With Quote
Old 04-11-2020, 04:20 PM   #3
shady
Human being with feelings
 
Join Date: Jun 2017
Posts: 110
Default

If you post the video someone could try it out maybe (I could)
__________________
twitch.tv/suprshady trying to stream REAPER stuff.. more than twice a year
shady is offline   Reply With Quote
Old 12-06-2020, 01:56 PM   #4
leafac
Human being with feelings
 
leafac's Avatar
 
Join Date: Sep 2020
Location: Portugal
Posts: 110
Default

For those of you who, like me, stumble upon this, here are the most relevant ffmpeg commands:

Inspect a file to figure out the video and audio tracks it includes (something called “streams”):

Code:
$ ffmpeg -i example.mkv
This command is going to show you stream identifiers such as ‘0:0’. Take note, because these identifiers are used in the commands below.

Extract a video track into its own file:

Code:
$ ffmpeg -i example.mkv -map 0:0 -c copy example-video.mp4
The ‘-c copy’ part is there so that we’re just taking the video out of one container (MKV) and putting it into another (MP4) without reecoding, which would be slow and lossy.

Extract an audio track into its own file:

Code:
$ ffmpeg -i example.mkv -map 0:1 example-audio.wav
This time we’re not simply taking the audio out of one container and putting it into another; we’re actually reencoding to WAV. Typically the MKV included audio in AAC and we could use ‘-c copy’ to extract the AAC without reencoding, but I tried to work with AAC in REAPER and it didn’t go well, for example, I’d make edits and the audio would go out of sync. Reencoding isn’t as big a deal with audio as it is with video because it’s super-fast and we don’t lose quality, as we’re going from a more compressed stream (AAC) to a less compressed stream (WAV).

Extract an audio channel into its own file:

Code:
$ ffmpeg -i example.mkv -map_channel 0.1.0 example-audio.wav
Programs such as OBS may record in stereo even if the source was mono, for example, a microphone. With the command above we’re extracting a single channel and creating a mono WAV. The ‘0.1’ corresponds to the stream (the thing that was ‘0:1’ in the examples above); the final ‘.0’ means channel 0 (that is the left channel in a stereo stream).

Putting it all together:

Code:
$ ffmpeg -i example.mkv -map 0:0 -c copy example-video.mp4 -map_channel 0.1.0 example-microphone.wav -map 0:2 example-computer.wav
The example above is a single command that extracts all the relevant parts of a multitrack recording and produces files that are ready to edit in REAPER.
leafac is offline   Reply With Quote
Old 05-16-2021, 03:49 AM   #5
leafac
Human being with feelings
 
leafac's Avatar
 
Join Date: Sep 2020
Location: Portugal
Posts: 110
Default

I developed a better solution: a ReaScript that explodes these multi-track audio files into single-track files right from REAPER:



I also live-streamed the whole development process for those interested in coding, Lua, and so forth.
leafac is offline   Reply With Quote
Old 09-30-2022, 08:29 AM   #6
ke7zum
Human being with feelings
 
Join Date: May 2020
Posts: 2
Default

Quote:
Originally Posted by leafac View Post
I developed a better solution: a ReaScript that explodes these multi-track audio files into single-track files right from REAPER:



I also live-streamed the whole development process for those interested in coding, Lua, and so forth.
just to note for what ever reason, the waves are in the same folder as the thing, so this works, however not as expected. I have to play wiht this a bit more.
ke7zum is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 12:18 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.