Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 16th September 2010, 07:29   #1  |  Link
tateu
Registered User
 
Join Date: Jan 2002
Location: Los Angeles, CA USA
Posts: 132
QTInput Update 2010 - Quicktime Source Plugin

A user, UltraTV, recently asked for multitrack audio output support in the Quicktime source plugin, QTinput . The current release version of QTinput takes all of the input audio channels and mixes them down to a single stereo or mono output. I haven't worked on QTinput in a long time and I don't remember why I forced the audio output to be mixed down but it turns out that I needed to add just 2 lines of code to be able to output all channels separately.

This first test version will only output separate audio channels (down mixing is disabled) but I think I should make the audio down mix vs. multitrack output a user selectable option. The current QTInput option for audio is:
audio = false (disable audio)
audio = true (enable audio)

Does anyone see a problem if I change it to (or have a better suggestion)?
audio = 0 (disable audio)
audio = 1 (enable down mixed audio)
audio = 2 (enable multi track/channel audio)

Give it a go, if you're interested, and let me know your thoughts. I'll put the source code up, one of these days, too.


Updated 2010-09-16:
Here is the second test version. This one uses the above mentioned audio parameters (audio=0, 1 or 2).
QTSource_20100916_Test02.zip

Last edited by tateu; 17th September 2010 at 07:34.
tateu is offline   Reply With Quote
Old 16th September 2010, 08:36   #2  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,482
Thank you, Tateu! I'm not sure you realize how important this plugin is to so many people

I'm delighted to see any development whatsoever!!

Interestingly, with the previous QTInput release I'm using (circa 2008), this mixdown behavior isn't what I typically see. Most of my sources have between 2 and 8 mono PCM channels (plus ProRes or Photo JPEG video), and they all return the correct number of channels. Does the mixdown you speak of only apply to very high channel counts - i.e. ~10 tracks?

Derek
Blue_MiSfit is offline   Reply With Quote
Old 16th September 2010, 10:09   #3  |  Link
tateu
Registered User
 
Join Date: Jan 2002
Location: Los Angeles, CA USA
Posts: 132
Hmm...I just tested a 4 mono track file and a 4 channel file with 13 different versions of QTSource.dll, from 2005 through 2009 and they all only return 1 mixed mono track. Maybe you just got lucky or your files are encoded a little differently than mine? Or maybe it's the version of Quicktime you have installed? I'm currently using v7.6.5 (518.40). I don't know.
tateu is offline   Reply With Quote
Old 16th September 2010, 21:22   #4  |  Link
a451guy451
Xbox Live: o 4lif o
 
a451guy451's Avatar
 
Join Date: Jun 2009
Location: Monrovia, CA
Posts: 64
I've been playing with this all morning, and its working great. I've used it on MOV files with up to 24 audio channels, and using getchannel() I can successfully pull from any of the 24 tracks. Thanks for the update!
a451guy451 is offline   Reply With Quote
Old 16th September 2010, 22:23   #5  |  Link
UltraTV
Registered User
 
Join Date: Jul 2007
Posts: 56
You're the best Tateu! Looks golden. I'll continue testing through the weekend and let you know if I run into any issues.
UltraTV is offline   Reply With Quote
Old 19th September 2010, 08:57   #6  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,482
Ah-HAH! Here's the deal with my files:

I did in fact have (for example) 8 mono channels comprising a 5.1ch mix and an LtRt downmix. All 8 channels passed through to avisynth discretely. HOWEVER, the trick in my case was that each channel had an actual QuickTime channel assignment - i.e. L, R, C, LFE, LS, Rs, Lt, Rt etc... Still 8 discrete tracks in QuickTime, but all a part of a big happy mix!

I guess adding the channel assignment / mapping fixes this issue? Glad to see unassigned / unmapped tracks work fine now too!!

Derek
Blue_MiSfit is offline   Reply With Quote
Old 20th September 2010, 18:42   #7  |  Link
SynchronousArts
Multimedia Grunt
 
SynchronousArts's Avatar
 
Join Date: Apr 2008
Location: People's Republic of Kaulifonnia
Posts: 29
Thank You very much tateu!

I did some tests with a variety of sources that I opened with VirtualDub. All worked as expected:

ProRes with Stereo
Black Magic Stereo (mode=1)
Avid Stereo
ProRes 8 channel 24 bit (shows as 16 bit in VD)
DVCProHD 4 channel (requires external QT plugin for video)
XDCAM 2 and 8 channel (requires external QT plugin for video)

SA
__________________
Grunt: 4b- one who does routine unglamorous work
SynchronousArts is offline   Reply With Quote
Old 20th September 2010, 20:18   #8  |  Link
UltraTV
Registered User
 
Join Date: Jul 2007
Posts: 56
The update works correctly, but I'm having quite a few issues that I don't think are related to the update. I'll post them here just in case somebody has some experience and can help, or if you recognize it as a qtsource limitation that would be good to know as well.

Basically, I have some very large 1080p ProRes 422 movies with 10 discrete audio tracks. Loading the movies using qtinput(audio=true) then getchannel(7,8) to grab the stereo tracks works correctly in virtualdub, but when exporting to wav or using wavi, only the first 20 minutes or so of audio actually decodes to the pcm file. The rest is silence.

Some of the movies are split, so concatenating and outputting causes the first 20 minutes of each split section to dump to pcm correctly, after that it goes back to silence.

Also, I'm having some audio sync issues. I'm not sure what's causing this either, but other 2 channel ProRes content has usually been completely solid.

Anybody seen this before?

Last edited by UltraTV; 20th September 2010 at 20:24. Reason: Noticed other issues...
UltraTV is offline   Reply With Quote
Old 21st September 2010, 10:14   #9  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,547
i've seen that before. it was sporadic until i realised it was somehow related to multichannel.

if i captured a file with 2 stereo pairs, i'd get the first pair (which was what i wanted), but the audio would cut out after x time.

if i captured as 1 stereo pair and ditched the other 2 tracks on the tape, audio would come through till the end.

it may be some 2 gig limit or other weirdness.

@ tateu: great to see an update this plugin gets more use than most, even if it tends to expose some of quicktime's undesirable elements.

multichannel output is a great idea! i had no idea the channel assignments made a difference (i just captured files and exported the audio from quicktime if i needed it).

btw, while we're on audio, it wouldn't be possible to get uncompressed audio into qtoutput would it? probably much too big an ask. also, for examples of in-script exporting, you should check out soundfileout to see what can be done (like not having to play the script through linearly...)
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 21st September 2010, 18:15   #10  |  Link
UltraTV
Registered User
 
Join Date: Jul 2007
Posts: 56
So I managed to find a quick workaround for the issue I was seeing with multiple audio tracks causing the audio to drop out after x amount of time. Basically, this is solved if I delete the extra audio channels in Quicktime and save out to a reference movie that has only two channels. Same holds true for concatenating multiple segments of a movie into one large segment using Save As... and selecting reference movie. Seems to work well.

Unfortunately, now that the audio plays for the entire movie, the audio is losing sync. It seems like qtsource might be reporting erroneous fps data to avisynth, but I'm not sure. I'm doing some more debugging and I'll let you know the results. If anybody has a workaround I'd be glad to test that while I'm at it.

----
Update

It looks like it's definitely an issue with qtinput. I have a workaround that works fairly well. Basically, export to wav from Quicktime then encode to aac or ac3 from that wav file. Using wavi or virtualdub with qtinput to output sound causes audio sync issues.

We'll take a look at the source when you have a chance to post it and see if there isn't anything we can do to help.

Last edited by UltraTV; 22nd September 2010 at 01:55. Reason: Updated with more tests and results.
UltraTV is offline   Reply With Quote
Old 22nd September 2010, 05:37   #11  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,482
Try mode=2. I use this in all cases. It's been so long I don't recall exactly why, but I don't usually have sync issues

Derek
Blue_MiSfit is offline   Reply With Quote
Old 22nd September 2010, 11:10   #12  |  Link
7ekno
Registered User
 
Join Date: Jul 2007
Posts: 389
Wow, thanks tateu, this is one amazing source filter

7ek
7ekno is offline   Reply With Quote
Old 22nd September 2010, 13:57   #13  |  Link
Yellow_
Registered User
 
Join Date: Sep 2009
Posts: 378
Oh this is good, :-) VfW added too.

@Blue_MiSfit, have you tried / succeeded with ProRes using QTSource? I've got it working with VDub but can't get FFmpeg with .avs enabled to advance frames. :-(
Yellow_ is offline   Reply With Quote
Old 22nd September 2010, 15:10   #14  |  Link
JamesRitson
Registered User
 
Join Date: Sep 2010
Posts: 2
Hi tateu,

I've been using QTSource for a while now, as I prefer to frame-serve from Avid through to AviSynth then to MeGUI/CCE, so your plugin has been very much invaluable! Thanks for taking the time to update it and add new features.


Recently, I've also been using AviSynth to tidy up and improve video DSLR source footage, and up until now I haven't been able to use QTOutput because Quicktime will usually throw up an "Incorrect duration" error (Avid simply says the file is unsupported).

I downloaded this version and gave it another go, and the results are, tantalisingly, almost there! Quicktime will actually open the resulting clips now, but after three seconds the footage is replaced with a white screen which continues until the end of the clip - this happens irrespective of the codec used, eg Avid DNxHD, H264, Photo JPEG. I was wondering if you might know why this is happening and if there's any way to fix it?

At the moment I'm rendering out from VDub to MJPEG and importing that into Avid, but it would be fantastic to be able to cut out a generation loss and just render to DNxHD (Avid can "fast import" its own codecs without recompression). As mentioned above, Quicktime recognises the codec and bit rate, but after three seconds it renders pure white (the audio remains fine).

Thanks again though, it's a great little plugin and I'm very grateful for its existence!

Thanks,
James
JamesRitson is offline   Reply With Quote
Old 23rd September 2010, 00:51   #15  |  Link
UltraTV
Registered User
 
Join Date: Jul 2007
Posts: 56
Another update... The post regarding audio sync issues is garbage. It was caused by another tool down the pipeline. Audio Sync is fine. The only problem I have left is audio getting clipped after 20 minutes using getchannel(). I'm not sure if this is a qtinput issue or not. In any event, thanks again for the help.

Quote:
Recently, I've also been using AviSynth to tidy up and improve video DSLR source footage, and up until now I haven't been able to use QTOutput because Quicktime will usually throw up an "Incorrect duration" error (Avid simply says the file is unsupported).
What format are those files coming off the DSLR? Quicktime is terrible at dealing with h.264 in general, so you would be better to try changing the container to .mp4 and using directshowsource. If not, your best bet is to do what you're doing... My preferred workflow for DSLR is quicktime h264 to ProRes422.
UltraTV is offline   Reply With Quote
Old 23rd September 2010, 08:25   #16  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,547
nice to see audio writing included

however, "format=" seems to not work as expected - it'll just stuff my raw data into h.264, or something similar (file is expected size, but i get black frames).

i can work around this by leaving "format" out, leaving "raw" in, and choosing 2vuy from the dialog that comes up. i compared the results and they are indeed lossless, so quicktime doesn't appear to be doing it's own rendering (which is a relief).

also, stereo, 16 bit 48k audio appears to be clicky. that might be just me or my script, but my script doesn't have too many bells and/or whistles in it. i'll try narrow it a bit and get back.

[edit]

something else was causing the audio clickiness. no idea what, but it's not qtoutput! excellent.

btw, control over audio settings exposed in the function call would be good too - it seems to default to 44.1k, stereo 16, but perhaps it could choose settings based on the audio fed to it?
__________________
sucking the life out of your videos since 2004

Last edited by Mug Funky; 23rd September 2010 at 08:37.
Mug Funky is offline   Reply With Quote
Old 23rd September 2010, 11:38   #17  |  Link
JamesRitson
Registered User
 
Join Date: Sep 2010
Posts: 2
Quote:
Originally Posted by UltraTV View Post
What format are those files coming off the DSLR? Quicktime is terrible at dealing with h.264 in general, so you would be better to try changing the container to .mp4 and using directshowsource. If not, your best bet is to do what you're doing... My preferred workflow for DSLR is quicktime h264 to ProRes422.
You pretty much hit the nail on the head there: I thought I'd give it a go with ffmpegsource2 instead, compensating for the gamma change with Levels (a 1.1 change brings the gamma back in line with the Quicktime original) and the resulting .mov (in DNxHD) came out fine. Thanks for the advice!
JamesRitson is offline   Reply With Quote
Old 26th September 2010, 21:07   #18  |  Link
a451guy451
Xbox Live: o 4lif o
 
a451guy451's Avatar
 
Join Date: Jun 2009
Location: Monrovia, CA
Posts: 64
Quote:
Originally Posted by UltraTV View Post
...The only problem I have left is audio getting clipped after 20 minutes using getchannel()....
I'm actually experiencing this too (just didn't notice before because I was playing with really short sample files). I don't know how to verify if this is caused by qtinput though.
a451guy451 is offline   Reply With Quote
Old 4th October 2010, 16:40   #19  |  Link
the_fry
Registered User
 
Join Date: Apr 2008
Posts: 3
Hello Everybody, especially tateo.

I integrated tateo's great plugin a while ago into a encoding pipeline using AVS with QTSource/QTInput and mencoder.
This has been working like a charm for the last three years.
After installing the latest Quicktime Update (7.6.8) the pipeline broke.

Some avs files won't open in VirtualDub at all.
Messages like "Avisynth read error: CAVIStreamSynth: System exception - Acccess Violation at 0x668eca8b, reading from 0x0".
Some files open but I just get one static noise frame of video (audio plays back).
Some files open and play perfectly.
The QTInput 2010 Version does open a few files that would end with exceptions in VirtualDub with 0.0.5a. But by far not all.
And: I can't get mplayer to play or mencoder to recode ANY of the files (even those that work with VirtualDub).

WHAT THE F?
Yes, something must have changed with Quicktime 7.6.8 that changes the AVS/QTSource output in such ways that mencoder/mplayer can't handle. I have no clue what's going on.
Any word from the wise?

Last edited by the_fry; 4th October 2010 at 16:45.
the_fry is offline   Reply With Quote
Old 26th January 2011, 21:25   #20  |  Link
zambelli
Doom9ing since 2001
 
zambelli's Avatar
 
Join Date: Oct 2001
Location: Seattle, WA, USA
Posts: 1,967
Tateu,
First of all, thanks so much for this plugin! It's truly a lifesaver, especially for ProRes422 sources.

Is multi-channel audio support the only difference between 0.0.8 and the 2010-09-16 version, or are there other changes/bugfixes?

Also, may I suggest making version 0.0.8, if not the latest one, easier to find? It seems that the only reference to it exists in one of the Doom9 threads. And http://avisynth.org/warpenterprises/ still lists an ancient 2006 version.
__________________
Alex Zambelli | Blog | Twitter
zambelli is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 +1. The time now is 16:44.


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