View Full Version : DirectShowSource gives wrong audio tracks and content / VFR solution
TCmullet
29th January 2016, 03:54
I've been mostly using Lsmash to open video files. But I have a strange one that is VFR. I've heard that opening it with DirectShowSource can help. (I know what to do with the DSS parameters for what I want DSS for.)
But when I open it in the script in VirtualDub,
1. I get 6 channels of sound when viewing audio display and info() confirms there are 6, when the file only has 2 channel AAC, according to MediaInfo. VLC says it's stereo audio.
2. None of the 6 channels has any sound on it. (Vdub shows the audio waveforms as flatlines throughout the video.) Yet playing the file in VLC plays sound properly.
How can I figure out what's wrong in my system?
TCmullet
29th January 2016, 04:08
Holy smokes! I posted my problem after hours of attempting to solve on my own research. Suddenly, the problem has gone away. It's now the proper 2 channels and there is sound. I don't know what I did! I guess I shall probably delete this thread soon.
kuchikirukia
29th January 2016, 07:44
The problem with DSS, as I hear it, is that you never really know what it's going to use. My wild guess is you have a splitter somewhere set to upmix to 5.1.
`Orum
29th January 2016, 21:13
In case the problem crops up again, or someone else comes here with the same issue, the simplest way to deal with it is probably just avoid any audio handling in DSS at all. Simply set audio=false in DSS(), and then AudioDub() in the audio (if you actually need it) using a different source filter for the audio.
But yeah, it does sound like a splitter is upmixing. It's probably easiest to troubleshoot by rendering the file in GraphEdit (or one of its more modern (http://blog.monogram.sk/janos/tools/monogram-graphstudio/) clones (https://github.com/cplussharp/graph-studio-next)).
TCmullet
29th January 2016, 22:31
I think I roughly know what the scenario was, at least in a general way. During all the research and testing, I had been listening to TV through my capture device, on the same PC. I wasn't capturing to a file, but merely monitoring the show. But it now occurs to me that maybe because DirectShow is a part of Windows, then maybe the capture system is somehow using it. It was after I had shut that down and restarted Vdub that the 6 channel silence went away and 2 channel sound came up!
To Orem, my whole reason for using DSS was FOR audio. It's a VFR file (yuk) and I had just found out that there are options in DSS to get the frame rate constant and audio synced. So I HAVE to have audio in DSS this time.
I DID try a LOT to figure out how to get GraphEdit (which I've never seen) onto my system without installing any kind of developers kit, and I found nothing. But for now, it appears, DSS is okay on this PC.
But I guess I learned that with DSS, one might need to avoid multitasking with other multimedia types of applications. (Hauppauge software for realtime capture, in this case.)
`Orum
29th January 2016, 23:24
Right, I get that it's VFR and you need audio, but I just have a few other concerns. If you're using this for real-time playback, you'll need to convert to CFR (AviSynth assumes CFR) within whatever source filter you use; e.g. in DSS() you need to set convertfps=true, or use other source filters like DSS2() which automatically convert.
If you're doing this for editing, namely passing anything to Trim(), you'd want something that's frame-accurate, which DSS() is not. The only thing that I've personally found to be frame-accurate is LSMASH, which *can* convert VFR to CFR or leave it as VFR. No matter what you do in AviSynth though it will be a compromise when working with VFR+audio and Trim()ing--either you convert to CFR, which is generally not ideal, or you lose your audio sync (though there may be some special audio filters that I'm unaware of that will take a timecode).
TCmullet
31st January 2016, 05:31
Right, I get that it's VFR and you need audio, but I just have a few other concerns. If you're using this for real-time playback, you'll need to convert to CFR within whatever source filter you use; e.g. in DSS() you need to set convertfps=true, or use other source filters like DSS2() which automatically convert.
If you're doing this for editing, namely passing anything to Trim(), you'd want something that's frame-accurate, which DSS() is not. The only thing that I've personally found to be frame-accurate is LSMASH, which *can* convert VFR to CFR or leave it as VFR. No matter what you do in AviSynth though it will be a compromise when working with VFR+audio and Trim()ing--either you convert to CFR, which is generally not ideal, or you lose your audio sync (though there may be some special audio filters that I'm unaware of that will take a timecode).
No it's not for playback, but for creating a CFR output file. As I said, I already had found out about convertfps=true, and I wasn't asking about that. However, I did NOT know that LSMASH could handle VFR!!! Great! I see now that I should make my code read:
mainfile = "myVfrFile.mp4"
video = LWLibavVideoSource(mainfile,fpsnum=30000,fpsden=1001)
audio = LWLibavAudioSource(mainfile)
AudioDub(video,audio)
Are you saying that adding fpsnum and fpsden as above WILL apply duplication of frames only to the frames at the wrong framerate and leave the rest intact?? This will be great, if true!
sneaker_ger
31st January 2016, 07:12
Yes, duplication/removal of frames should only happen where necessary.
Emulgator
1st February 2016, 00:25
I DID try a LOT to figure out how to get GraphEdit (which I've never seen) onto my system without installing any kind of developers kit, and I found nothing.
Graphstudionext (http://www.videohelp.com/software/GraphStudio) may be of help here.
Wilbert
1st February 2016, 22:26
http://www.videohelp.com/software/GraphEdit
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.