Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 09-08-2018, 09:41 AM   #1
Moy
Human being with feelings
 
Moy's Avatar
 
Join Date: Oct 2017
Location: China
Posts: 60
Default Video: When importing video with multiple soundtracks, REAPER only recognize one.

Hi There,
When I import a video with TWO sound tracks (4 channels) into REAPER, it can only recognize ONE.
Like this:


However in Audition (and Video players) we can see that the video has totally 4 audio channels. Many films with multiple Language tracks would use this method to encode sound track.
And when I export the sound from Audition and import it to REAPER, it can recognize all 4 Channels!


So I guess is there anything was missed when importing video?
Please support importing multiple sound tracks of a video.

(BTW I wrote it on FR before, but I think it's more like.. sort of a bug or design flaw?)

Sincerely,
Moy
Moy is offline   Reply With Quote
Old 11-28-2018, 07:21 PM   #2
Moy
Human being with feelings
 
Moy's Avatar
 
Join Date: Oct 2017
Location: China
Posts: 60
Default

Bump, bump.
Since nowadays REAPER is developing features about video, hope this could be noticed
Moy is offline   Reply With Quote
Old 11-29-2018, 12:16 AM   #3
Eliseat
Human being with feelings
 
Eliseat's Avatar
 
Join Date: Mar 2018
Location: Cologne
Posts: 1,362
Default

Reaper imports multi channel but actually not multi tracks. To get around until this feature gets implemented you could just use a demuxer to separate video from audio before importing into Reaper. MKVtoolnix, MP4Muxer and mp4creator are tools which allow in a second to split video from audio.

But of course multi track import would be cool in Reaper. But I'm not sure how often this is needed.

Greetings
Eli
Eliseat is offline   Reply With Quote
Old 12-11-2018, 03:32 AM   #4
Moy
Human being with feelings
 
Moy's Avatar
 
Join Date: Oct 2017
Location: China
Posts: 60
Default

Quote:
Originally Posted by Eliseat View Post
Reaper imports multi channel but actually not multi tracks. To get around until this feature gets implemented you could just use a demuxer to separate video from audio before importing into Reaper. MKVtoolnix, MP4Muxer and mp4creator are tools which allow in a second to split video from audio.

But of course multi track import would be cool in Reaper. But I'm not sure how often this is needed.

Greetings
Eli
Yay, maybe I'm confusing "sound tracks" and "channels".
For now I would just use other software to extract sound tracks, thanks for your recommends!
__________________
Nice to meet REAPER.
My Chinese tutorials of RAEPER: https://zhuanlan.zhihu.com/reaper
Moy is offline   Reply With Quote
Old 06-10-2020, 10:35 AM   #5
Moy
Human being with feelings
 
Moy's Avatar
 
Join Date: Oct 2017
Location: China
Posts: 60
Default

*Bump* Still hoping for it
__________________
Nice to meet REAPER.
My Chinese tutorials of RAEPER: https://zhuanlan.zhihu.com/reaper
Moy is offline   Reply With Quote
Old 06-10-2020, 10:51 AM   #6
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
Default

It's not bug. Reaper just doesn't support multiple soundtracks.
vitalker is online now   Reply With Quote
Old 12-06-2020, 01:57 PM   #7
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   #8
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 05-16-2021, 04:14 AM   #9
vitalker
Human being with feelings
 
vitalker's Avatar
 
Join Date: Dec 2012
Posts: 13,333
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:
So smart!
vitalker is online now   Reply With Quote
Old 05-16-2021, 07:28 PM   #10
Moy
Human being with feelings
 
Moy's Avatar
 
Join Date: Oct 2017
Location: China
Posts: 60
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.
Wow that's GREAT!
Thank you for sharing, I love it <3
__________________
Nice to meet REAPER.
My Chinese tutorials of RAEPER: https://zhuanlan.zhihu.com/reaper
Moy is offline   Reply With Quote
Old 03-03-2022, 05:51 AM   #11
scientificsound
Human being with feelings
 
Join Date: May 2019
Posts: 8
Default

EDIT: the manual method using ffmpeg worked! still it'd be great to get the reaper script working...

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.
@Leandro, first off, thanks for all your scripts and videos, they're always super helpful.

Unfortunately, I'm having an issue running this script. I'm attempting to explode the audio an MP4 video as you show in your video. It is encoded withe the following codecs:
Code:
Timecode, Linear PCM, HEVC
There should be 4 tracks of audio (I can verify that in VLC and when opening with adobe audition), but when I run the script, it attempts to make 5 audio streams (the first 4 files are 0 bytes, and the 5th is 20 bytes) and i get the following error:
Code:
...media file to new one-stream (one-track) media files.lua:72: Error converting media files: 1
ffmpeg version N-102461-g8649f5dca6-tessus  https://evermeet.cx/ffmpeg/  Copyright (c) 2000-2021 the FFmpeg developers
  built with Apple clang version 11.0.0 (clang-1100.0.33.17)
  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
  libavutil      57.  0.100 / 57.  0.100
  libavcodec     59.  1.100 / 59.  1.100
  libavformat    59.  0.101 / 59.  0.101
  libavdevice    59.  0.100 / 59.  0.100
  libavfilter     8.  0.101 /  8.  0.101
  libswscale      6.  0.100 /  6.  0.100
  libswresample   4.  0.100 /  4.  0.100
  libpostproc    56.  0.100 / 56.  0.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fa5fa40b940] st: 0 edit list: 1 Missing key frame while searching for timestamp: 1000
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fa5fa40b940] st: 0 edit list 1 Cannot find an index entry before timestamp: 1000.
Guessed Channel Layout for Input Stream #0.1 : mono
Guessed Channel Layout for Input Stream #0.2 : mono
Guessed Channel Layout for Input Stream #0.3 : mono
Guessed Channel Layout for Input Stream #0.4 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/elarrieu/Downloads/MVI_0117.MP4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: mp42hvc1CAEP
    make            : 
    make-eng        : 
    model           : 
    model-eng       : 
    creation_time   : 2021-10-09T16:01:29.000000Z
    timecode        : 01:27:08:21
  Duration: 00:37:50.88, start: 0.000000, bitrate: 130334 kb/s
  Stream #0:0(eng): Video: hevc (Rext) (hvc1 / 0x31637668), yuv422p10le(pc, bt709/unknown/unknown), 3840x2160, 127255 kb/s, 25 fps, 25 tbr, 25k tbn (default)
    Metadata:
      creation_time   : 2021-10-09T16:01:29.000000Z
      vendor_id       : [0][0][0][0]
  Stream #0:1(eng): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, mono, s16, 768 kb/s (default)
    Metadata:
      creation_time   : 2021-10-09T16:01:29.000000Z
      vendor_id       : [0][0][0][0]
  Stream #0:2(eng): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, mono, s16, 768 kb/s (default)
    Metadata:
      creation_time   : 2021-10-09T16:01:29.000000Z
      vendor_id       : [0][0][0][0]
  Stream #0:3(eng): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, mono, s16, 768 kb/s (default)
    Metadata:
      creation_time   : 2021-10-09T16:01:29.000000Z
      vendor_id       : [0][0][0][0]
  Stream #0:4(eng): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, mono, s16, 768 kb/s (default)
    Metadata:
      creation_time   : 2021-10-09T16:01:29.000000Z
      vendor_id       : [0][0][0][0]
  Stream #0:5(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
    Metadata:
      creation_time   : 2021-10-09T16:01:29.000000Z
      timecode        : 01:27:08:21
[mp4 @ 0x7fa5ca407d00] Application provided duration: -9223372036854775808 / timestamp: -9223372036854775808 is out of range for mov/mp4 format
[mp4 @ 0x7fa5ca407d00] pts has no value
Output #0, mp4, to '/Users/elarrieu/Downloads/MVI_0117 [stream 1] 004.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: mp42hvc1CAEP
    make            : 
    make-eng        : 
    model           : 
    model-eng       : 
    timecode        : 01:27:08:21
    encoder         : Lavf59.0.101
  Stream #0:0(eng): Video: hevc (Rext) (hvc1 / 0x31637668), yuv422p10le(pc, bt709/unknown/unknown), 3840x2160, q=2-31, 127255 kb/s, 25 fps, 25 tbr, 25k tbn (default)
    Metadata:
      creation_time   : 2021-10-09T16:01:29.000000Z
      vendor_id       : [0][0][0][0]
[wav @ 0x7fa5ca417d80] Codec none not supported in WAVE format
Could not write header for output file #5 (incorrect codec parameters ?): Function not implemented
Error initializing output stream 5:0 -- 
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #1:0 (pcm_s16be (native) -> pcm_s16le (native))
  Stream #0:2 -> #2:0 (pcm_s16be (native) -> pcm_s16le (native))
  Stream #0:3 -> #3:0 (pcm_s16be (native) -> pcm_s16le (native))
  Stream #0:4 -> #4:0 (pcm_s16be (native) -> pcm_s16le (native))
  Stream #0:5 -> #5:0 (copy)
    Last message repeated 1 times


1
ffmpeg version N-102461-g8649f5dca6-tessus  https://evermeet.cx/ffmpeg/  Copyright (c) 2000-2021 the FFmpeg developers
  built with Apple clang version 11.0.0 (clang-1100.0.33.17)
  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
  libavutil      57.  0.100 / 57.  0.100
  libavcodec     59.  1.100 / 59.  1.100
  libavformat    59.  0.101 / 59.  0.101
  libavdevice    59.  0.100 / 59.  0.100
  libavfilter     8.  0.101 /  8.  0.101
  libswscale      6.  0.100 /  6.  0.100
  libswresample   4.  0.100 /  4.  0.100
  libpostproc    56.  0.100 / 56.  0.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fa5fa40b940] st: 0 edit list: 1 Missing key frame while searching for timestamp: 1000
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fa5fa40b940] st: 0 edit list 1 Cannot find an index entry before timestamp: 1000.
Guessed Channel Layout for Input Stream #0.1 : mono
Guessed Channel Layout for Input Stream #0.2 : mono
Guessed Channel Layout for Input Stream #0.3 : mono
Guessed Channel Layout for Input Stream #0.4 : mono
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/elarrieu/Downloads/MVI_0117.MP4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: mp42hvc1CAEP
    make            : 
    make-eng        : 
    model           : 
    model-eng       : 
    creation_time   : 2021-10-09T16:01:29.000000Z
    timecode        : 01:27:08:21
  Duration: 00:37:50.88, start: 0.000000, bitrate: 130334 kb/s
  Stream #0:0(eng): Video: hevc (Rext) (hvc1 / 0x31637668), yuv422p10le(pc, bt709/unknown/unknown), 3840x2160, 127255 kb/s, 25 fps, 25 tbr, 25k tbn (default)
    Metadata:
      creation_time   : 2021-10-09T16:01:29.000000Z
      vendor_id       : [0][0][0][0]
  Stream #0:1(eng): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, mono, s16, 768 kb/s (default)
    Metadata:
      creation_time   : 2021-10-09T16:01:29.000000Z
      vendor_id       : [0][0][0][0]
  Stream #0:2(eng): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, mono, s16, 768 kb/s (default)
    Metadata:
      creation_time   : 2021-10-09T16:01:29.000000Z
      vendor_id       : [0][0][0][0]
  Stream #0:3(eng): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, mono, s16, 768 kb/s (default)
    Metadata:
      creation_time   : 2021-10-09T16:01:29.000000Z
      vendor_id       : [0][0][0][0]
  Stream #0:4(eng): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, mono, s16, 768 kb/s (default)
    Metadata:
      creation_time   : 2021-10-09T16:01:29.000000Z
      vendor_id       : [0][0][0][0]
  Stream #0:5(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
    Metadata:
      creation_time   : 2021-10-09T16:01:29.000000Z
      timecode        : 01:27:08:21
[mp4 @ 0x7fa5ca407d00] Application provided duration: -9223372036854775808 / timestamp: -9223372036854775808 is out of range for mov/mp4 format
[mp4 @ 0x7fa5ca407d00] pts has no value
Output #0, mp4, to '/Users/elarrieu/Downloads/MVI_0117 [stream 1] 004.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: mp42hvc1CAEP
    make            : 
    make-eng        : 
    model           : 
    model-eng       : 
    timecode        : 01:27:08:21
    encoder         : Lavf59.0.101
  Stream #0:0(eng): Video: hevc (Rext) (hvc1 / 0x31637668), yuv422p10le(pc, bt709/unknown/unknown), 3840x2160, q=2-31, 127255 kb/s, 25 fps, 25 tbr, 25k tbn (default)
    Metadata:
      creation_time   : 2021-10-09T16:01:29.000000Z
      vendor_id       : [0][0][0][0]
[wav @ 0x7fa5ca417d80] Codec none not supported in WAVE format
Could not write header for output file #5 (incorrect codec parameters ?): Function not implemented
Error initializing output stream 5:0 -- 
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #1:0 (pcm_s16be (native) -> pcm_s16le (native))
  Stream #0:2 -> #2:0 (pcm_s16be (native) -> pcm_s16le (native))
  Stream #0:3 -> #3:0 (pcm_s16be (native) -> pcm_s16le (native))
  Stream #0:4 -> #4:0 (pcm_s16be (native) -> pcm_s16le (native))
  Stream #0:5 -> #5:0 (copy)
    Last message repeated 1 times
Does anyone have an idea what could be going wrong here? Thanks!

Last edited by scientificsound; 03-03-2022 at 06:15 AM.
scientificsound is offline   Reply With Quote
Old 03-09-2022, 06:34 AM   #12
leafac
Human being with feelings
 
leafac's Avatar
 
Join Date: Sep 2020
Location: Portugal
Posts: 110
Default

@scientificsound

Thanks for the nice words. I’m happy that my code & videos are helpful to you.

The issue doesn’t seem to be coming from the script, but from ffmpeg. The script is a glue to call ffmpeg from within REAPER, but the actual work of exploding media is done by ffmpeg.

ffmpeg is this command-line tool that can convert between several audio/video formats, and is used under the hood by everything from desktop applications to YouTube.

The error message from ffmpeg seems to indicate that the codecs in your file aren’t supported. See, for example, how it says “Function not implemented”.

I wonder if this is still an issue in the latest versions of ffmpeg. Can you please test this for us?

Here’s what you have to do:

1. Download https://evermeet.cx/ffmpeg/ffmpeg-105884-g74117abf0c.7z

2. Extract the file called ‘ffmpeg’ from the ‘.7z’.

3. Rename ‘ffmpeg’ into ‘leafac_ffmpeg’.

4. Replace the file at ‘<YOUR-REAPER-CONFIGURATION-FOLDER>/Data/leafac_ffmpeg’ with this new version.

5. Try running the action again in REAPER.

Thanks for helping out.

Let me know how it goes.
leafac is offline   Reply With Quote
Old 11-15-2022, 07:08 AM   #13
PabloSorribes
Human being with feelings
 
Join Date: Oct 2019
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.
Wow thanks leafac!
This script is really helping me prepare some screen recordings / tutorials for a Game Audio Talk that I'll have later this week. Great work!

/Pablo
PabloSorribes is offline   Reply With Quote
Old 06-30-2023, 01:23 AM   #14
Moy
Human being with feelings
 
Moy's Avatar
 
Join Date: Oct 2017
Location: China
Posts: 60
Default

It seems that the recent updates of RP have been focused on videos feature, so I hope this post can get some attention!
__________________
Nice to meet REAPER.
My Chinese tutorials of RAEPER: https://zhuanlan.zhihu.com/reaper
Moy is offline   Reply With Quote
Old 06-30-2023, 02:33 AM   #15
AnalogDevice
Human being with feelings
 
Join Date: Sep 2009
Posts: 20
Default

@leafac
How does your script handle mkv with six tracks/streams of WAV 24-bit?
Just want to know if it does any lossy conversion to audio when WAV at 24-bit is already present?
Would like to be sure that there is no conversion happening with original audio while importing to Reaper. It seems as if it is always generating WAV with 16-bit...
__________________
Reaper x64 (6.latest), Win 11 Home (Version 10.0.22621 Build 22621)
AnalogDevice 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 03:47 PM.


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