Log in

View Full Version : VirtualDub2 - Handling of PCM audio codec


RocketJet
1st May 2021, 09:23
VirtualDub2 outputs PCM in IEEE format,
whereas original VirtualDub outputs PCM in integer format.

It would be good if VirtualDub2 allowed the user
to select either of these variants,
rather than being forced to use IEEE Float.

I suggest having 2 entries in the list of codecs,
one as PCM-Integer and the other as PCM-Float.

The reason for this is that there are other applications around
that do not support the Float format. EG AviDemux.

StainlessS
1st May 2021, 12:36
avisynth script

Colorbars.trim(0,-500)
ConvertAudioToFloat
OPT_AllowFloatAudio = true
return last


Above feeds Float into VD2.
Save video as normal, writes Float audio.

Set:
Menu/Audio/Full Processing Mode
Writes Float Audio.

Set Additionally:
Menu/Audio/Conversion/Precision = 16 bit
In Menu/Audio/Compression/ Default = No Compression PCM, shows "Format ID = 0x0003, Bytes PerBlock = 4 bytes".
Save Video Writes No Audio.

Seems bugged to me, should write 16 bit audio [I think].

EDIT:
Bytes PerBlock = 4 bytes, looks like 16 bit * 2 for stereo, float shows 8 bytes, ie 32 bits * 2.

EDIT: Shekh seems to be AWOL of late, but he does monitor VD2 thread, if he dont respond at all,
then suggest post bugrep in VD2 thread.

EDIT:
I suggest having 2 entries in the list of codecs,
one as PCM-Integer and the other as PCM-Float.
Not needed, PCM when 16 bit input, outputs 16 bit, if Direct Stream Copy, then writes whatever input is.
You need to manually convert Float to 16 bit via Full Processing / Convert precision.
[Leastwise when bug is fixed]

RocketJet
1st May 2021, 13:13
Thanks for the quick reply.
I used the Conversion setting, and it worked fine.
I have created a start-up vdscript so that it will be the new default for me.
Many thanks,

StainlessS
1st May 2021, 13:47
I used the Conversion setting, and it worked fine.
What build are you using ? [latest is 44282]

Maybe could be an Avisynth -> VD2 problem.

EDIT: I'll check with mine when I get back to Windows, currently on Linux.

RocketJet
1st May 2021, 13:58
I am using build 44282.

I wasn't using AviSynth,
so that is not an issue for me.

Now that I have set up a startup vdscript, I am happy.
Thanks.

StainlessS
1st May 2021, 14:27
I'm using VD2 44282, and when saving prev script with float audio, uncompressed RGB,
it saves audio as float, OK.
Direct loading same result clip [avi not avs script] with float audio into VD2, and changing to Audio Full Processing, Conversion to 16 bit,
again saves NO AUDIO. Dont know why yours is working and mine aint.

When you convert to 16 bit, what does it say in PCM for Format ID mine says, "Format ID = 0x0003, Bytes PerBlock = 4 bytes"

RocketJet
2nd May 2021, 08:35
For my integer file:
In VirtualDub File Information mine shows as:
Audio Codec: pcm_s16le
Channels, sampling format: stereo(2),s16
Sampling rate: 48000 Hz
Bitrate: 1536 kb/sec

In VirtualDub Audio Compression it says:
Format ID: PCM
Bytes per block: 4 bytes
Data rate: 192000 bytes/sec
Granularity: 48000.0 blocks/sec

In MediaInfo it says:
1536 kb/s, 48.0 kHz, 16 bits, 2 channels, PCM (little, signed)

When trying to save an integer PCM as a PCM Float,
the resulting file came out as integer,
even though I select float in the conversion panel.
No problem in the reverse (Float to Integer),
file plays OK.

My Float file shows as:
VirtualDub Information
Audio codec: pcmf_f32le
Channels, sample format: stereo (2), flt
Sampling rate: 48000 Hz
Bitrate: 3072 kb/sec

VirtualDub Audio Compression shows:
Format ID: PCM float
Bytes per block 8 bytes
Data rate: 384000 bytes/sec
Sample rate: 48000.0 blocks/sec

MediaInfo:
3072 kb/sec, 48.0 kHz, 32 bites, 2 channels, PCM (IEEE) (Float)


Hope this helps.