1

Topic: Avisynth Opening Prores with multitrack audio

Hi, I am trying to find the best option to open a Quicktime Prores file with multitrack / channel audio.
I am trying to use FFmpegSource2 but this seems to only allow you to select a track to output, and I have a file with 10 mono tracks. Is there anyway Avisynth can open this file and keep the audio in tact?

Kind regards.

2

Re: Avisynth Opening Prores with multitrack audio

I don't thing AudioDub supports something like 'AudioDub(V, a1, ..., a10)', so merging the separate audio channels to a multi audio stream is probably the only way to handle this in Avisynth.

Something a long the lines of

v =  FFVideoSource("Path to source", track=1)
a1 = FFAudioSource("Path to source", track=1)
... 
a10 = FFAudioSource("Path to source", track=1)
a= MergeChannels(a1,...,a10)
AudioDub(v,a)

should work, but it will return the video stream and a 10 channel audio stream (not 10 separate channels)



Cu Selur

3

Re: Avisynth Opening Prores with multitrack audio

I am also trying QTInput, which also returns 1 track with 10 channels. Is there an audio channel map option in Avisynth to allow me to split this 1 track 10 channel out into 10 mono tracks, or 8 mono and 1 stereo tracks?
Or is it a restriction of Avisynth to only have 1 multichannel audio track?

Thanks for your help.
Kind regards.

4

Re: Avisynth Opening Prores with multitrack audio

You can only output one video and one audio stream.

Cu Selur

5

Re: Avisynth Opening Prores with multitrack audio

Ahh, I wondered if that was an Avisynth restriction.
One last question.....
In your opinion would I be better of using FFmpegSource2 or QTInput?

6

Re: Avisynth Opening Prores with multitrack audio

That depends on the format of your video&audio, personally I normally use LWLibavVideoSource & LWLibavAudioSource smile

7 (edited by speedyrazor 2015-02-07 12:59:41)

Re: Avisynth Opening Prores with multitrack audio

I am mainly using Quicktime prores, sometime mxf's. I haven't heard of LWLibavVideoSource & LWLibavAudioSource?
How would I use LWLibavVideoSource with 10 audio channels?

Kind regards.

8

Re: Avisynth Opening Prores with multitrack audio

Basically the same as with FFAudioSource,..

a1 = LSMASHAudioSource("path to source, stream_index=0)
....
a10 = LSMASHAudioSource("path to source, stream_index=9)

see: http://avisynth.nl/index.php/LSMASHSour … udioSource

9

Re: Avisynth Opening Prores with multitrack audio

Hi Selur, thanks for you kind advise, is there an advantage to using LSMASHAudioSource?

10

Re: Avisynth Opening Prores with multitrack audio

So far for me it has been more stable and could better handle interlaced content than FFVideoSource. smile

11 (edited by speedyrazor 2015-02-07 17:11:03)

Re: Avisynth Opening Prores with multitrack audio

Then I will give it a go, many thanks again for your guidance and advice. smile

Kind regards.

12

Re: Avisynth Opening Prores with multitrack audio

Sorry, keep thinking of another question.....
Are you using normal Avisynth 32 bit, or Avisynth+, 64 bit?? What version?

13

Re: Avisynth Opening Prores with multitrack audio

I'm using latest Avisynth MT 32bit. (files I use are available for download over at http://www.selur.de/downloads)
Avisynth+ 32bit doesn't offer any advantages for me.
64bit versions of Avisynth and Avisynth+ simply lack the necessary filters.
(+ at least 64bit Avisynth never ran stable for me,.. and a lot of other folks)
Avxsynth seems to be abandoned and never worked properly for me.
Vapoursynth seems nice, but has two major drawbacks for me:
a. missing a bunch of filters
b. requires to Python to be installed system wide (no portable Vapoursynth version)
c. requires to learn Python

Cu Selur

14

Re: Avisynth Opening Prores with multitrack audio

Nice, I will give Avisynth MT 32bit a try.
Sorry to keep asking, I am trying to open a quicktime using LWLibavVideoSource, but my files are coming out green, altering all colors, my source is quicktime prores HQ HD. What am I doing wrong?

15

Re: Avisynth Opening Prores with multitrack audio

Probably nothing, seems like LWLibavVideoSource can't handle your source properly. smile
(may be a newer version does, latest is r775 afaik)

16

Re: Avisynth Opening Prores with multitrack audio

Oh dear.. thats the version I am using, so no LWLibavVideoSource for me then? sad

17

Re: Avisynth Opening Prores with multitrack audio

Another question, I do apologise.....
So I am thinking of doing all my processing using Avisynth, then outputting to Prores HQ using ffmpeg, I would prefer to use ffmbc, for its more stable playback with Prores. So my question is, I would like to use map and map channel to get back the original audio channel configuration which was in my original Prores source, for example I have in my source:

Audio track 1 - mono
Audio track 2 - mono
Audio track 3 - mono
Audio track 4 - mono
Audio track 5 - mono
Audio track 6 - mono
Audio track 7 - stereo

But as we know know, Avisynth merges everything from my source into 1 track 8 channels. How would I command ffmbc to map that back into the original configuration?

Kind regards.

18

Re: Avisynth Opening Prores with multitrack audio

I normally don't use ffmpeg a for sound manipulation (I normally use sox), but iirc. '-filter_complex channelsplit' should create 8 separate channels and something like -filter_complex "[7:a][8:a]amerge=inputs=2[aout]" should allow to rejoin the last two channels.
https://trac.ffmpeg.org/wiki/AudioChannelManipulation will probably help to understand the ffmpeg syntax more.

Cu Selur

19

Re: Avisynth Opening Prores with multitrack audio

Could I use sox with ffmpeg, if so what sort of command might work with my file?

Kind regards.

20

Re: Avisynth Opening Prores with multitrack audio

You can't process video with sox, so you could only decode the audio with ffmpeg and pipe the output to sox. (I do that in Hybrid.)
Adding sox to your current processing is probably way more complicated than reading up ffmpegs map function. smile

21

Re: Avisynth Opening Prores with multitrack audio

Hi Selur, using '-filter_complex channelsplit' with 1 track with 8 channels, gives me an error:

Stream #0:1: Audio: pcm_f32le, 48000 Hz, 10 channels, flt, 15360 kb/s
[auto-inserted resampler 0 @ 029366a0] [SWR @ 028c48a0] Rematrix is needed between 10 channels and stereo but there is not enough information to do it
[auto-inserted resampler 0 @ 029366a0] Failed to configure output pad on auto-inserted resampler 0

I can't specify what type of channel split, 5.1, 7.1, etc, as it is just 8 mono channels.
I have read the specs, but can't figure this one out.

Kind regards.

22

Re: Avisynth Opening Prores with multitrack audio

Using a channel layout which covers 8 channels like 7.1 or octagonal should be okay (see: https://trac.ffmpeg.org/wiki/AudioChannelManipulation), you later have to assign the channels, see: https://ffmpeg.org/ffmpeg-filters.html# … nnelsplit.

"-map_channel" might be easier to handle,...

-map_channel [input_file_id.stream_specifier.channel_id|-1][:output_file_id.stream_specifier]

so

-map_channel 0.0.0:0.0 -map_channel 0.0.1:0.1 -map_channel 0.0.2:0.2 -map_channel 0.0.3:0.4  -map_channel 0.0.4:0.4  -map_channel 0.0.5:0.5  -map_channel 0.0.6:0.6   -map_channel 0.0.7:0.6

might be what you want.
I never tried this but this should assign channel 0-5 to output stream 0-5 (one channel per stream) and channel 6&7 to stream 7.

Cu Selur

23

Re: Avisynth Opening Prores with multitrack audio

Hi Selur, thanks for your examples, I have got the below script working, EXCEPT the resulting destination Prores file only has 1 audio track enabled, I have to open in quicktime pro and enable all the other audio tracks (and the timecode track) and then save the file. Do you know anyway of getting round this issue, automatically enabling all tracks by default?
Here is my current script:

C:\Temp\ffmpeg\ffmpeg.exe -i C:\Temp\MOVS\Source22_SMALL22.avs -map 0:0 -map 0:1 -map 0:1 -map 0:1 -map 0:1 -map 0:1 -map 0:1 -map 0:1 -map_channel 0.1.0:0.1 -map_channel 0.1.1:0.2 -map_channel 0.1.2:0.3 -map_channel 0.1.3:0.4 -map_channel 0.1.4:0.5 -map_channel 0.1.5:0.6 -map_channel 0.1.6:0.7 -map_channel 0.1.7:0.7 -timecode "00:00:00:00" -vcodec prores_ks -profile:v 3 -vtag apch -c:a pcm_s16le -y E:\AVS_NEW.mov