Jump to content

Choice of video codec affects audio quality


TomH

Recommended Posts

 Forking this audio discussion out of the topic 100 clip multi screen method... 

On 6/30/2020 at 1:57 PM, TomH said:

Another issue is the quality of the ambient audio in the export. It sounds ok within VP, I think, but the export exhibits the artifacts of too many audio data compression-expansion passes or excessive data compression. 

Manifesting as a kind of burbling or flutter in the hiss of ambient noise captured from wind in trees (I presume), the distortion was introduced in the export from VP. I have now checked more closely using just the one video clip (a long shot of a flag waving in the breeze). The VP Preview sounds the same as the original MP4 file - the hiss or wind noise is smooth across the spectrum. Exported to MP4 and it is degraded by the H264 and H265 video codecs, whether the audio bit rate is 128 or 192kbps. In MP4, VP gives no choice of audio codec - only AAC-LC is available. Surprisingly, choosing the MPEG-4 video codec results in audio quality that is indistinguishable (or nearly so) from that of the source clip. 

H264 AVC is supposed to be better than MPEG-4 (I know the H264 standard encompasses MPEG-4 but those are the labels VP puts on its choices) for video but it should have no effect on the audio stream when its encoder is the same. Using the Default Quality/Filesize setting in VP, here are some parameters for the resulting files:

Video
Compressor   Filesize    AudioBitRate VideoFormat    
H264         5.87MiB     192kb/s      AVC
H265         1.52MiB     192kb/s      HEVC
MPEG-4       4.48MiB     166kb/s      MPEG-4 Visual

All above set at Default Quality/FileSize, 30fps, 192kb/s

It's puzzling that VP produces a larger file from the "H264" "Compressor" than from the "MPEG-4" when the former is supposed to be able to produce a much smaller file for the same picture quality or a higher video quality for a given file size. It's as though VP wants the H264 "default quality" to be much better than MPEG-4's yet I could see no discernible difference in the waving flag. And despite the MPEG-4 actual bitrate for audio being lower (according to MediaInfo), it sounds much better on the wind noise than H264. I even tried "High Quality" H264 (twice the file size) but that, too, suffers the same audio impairment.

So I think there is something seriously wrong with VP's implementation of the H264 and H265 codecs and the only viable choice for MP4 format is the MPEG-4 "Compressor".

P.S. The H264 and MPEG-4 exports for Default Quality/FileSize can be auditioned here

Edited by TomH
added link to sample files
Link to comment
Share on other sites

Reviewed the two examples with high quality headphones. The H264 may have a bit more 'flutter' than the MPEG.  Yet, to my ear, the difference between the two was negligible.

But, then again, my hearing rolls off at about 10K.  A pointer to your threads was passed along.

Link to comment
Share on other sites

I did a fair bit of close listening to audio codecs starting over 30 years ago so my hearing may be somewhat 'trained' to detect distortions. I perceive the difference between my two samples to be much worse than negligible. And there really should be none because they both use the same audio codec. If anything, the higher bitrate of the H264 audio stream should give it an advantage.

23 minutes ago, borate said:

  A pointer to your threads was passed along.

What is the process of reporting a bug? What do you mean by "passed along"?

Thanks again for engaging with me on my posts.

Link to comment
Share on other sites

Thanks, borate. I had posted a report through the website "I need technical support" option which has essentially the same form as the bug report. The bug report itself can be started outside VP using this URL https://www.nch.com.au/software/bug.html but there is no link to it on the website. Launching from VP itself fills in the product and version number on the form.

I think there should be a "Report a bug" option on the website. What if VP (or any NCH product) is frozen? You can't file a bug report.

Link to comment
Share on other sites

Posed the comparison to a musician/audio engineer friend, a long-time owner of a high-end recording studio.  His plant has produced many theatrical films and TV programs. His response...

"On speakers they sound so close I didn't hear any difference. On headphones I thought I could hear some "watery" sound in the H264. But the difference I thought I heard seemed quite subtle to me."

Link to comment
Share on other sites

Don't listen to them directly from OneDrive online; that adds a layer of confusion. Having just now done so with Edge, I was taken aback and agree that the difference is subtle when heard that way; the quality was disturbing in both. When the files are local and played through the Windows 10 Films & TV app, the difference is enough that I detect it with laptop speakers and find it objectionable with headphones. I downloaded the MPEG and confirmed that the file played cleanly, locally, but something had changed when played online.

So I tried Firefox: the MPEG started off with the flutter distortion but within a few seconds it cleared up and stayed that way on repeated plays back and forth between H264 and MPEG. Back to Edge, and MPEG cleaned up within a couple of seconds. But back and forth between H264 and MPEG tends to degrade the MPEG while the local file plays clean; same with Chrome. So maybe there is some issue with caching in the browser or Internet which results in the data being mixed up - I know that sounds crazy but better to avoid the possibility of confounding the A-B comparison with one more source of error. 

A great way to A-B them is to drop the two downloaded files into Audacity or another multi-track editor on separate tracks and loop play the first 3 seconds while soloing one then the other. If neither you nor your friend hear the hf flutter on the H264, then either both of you have hearing impairment that I don't or there is something amiss with every H264 codec in my system. In the national broadcasting company that I spent my career, that defect would have ruled out the codec for music, drama and other applications for which we wanted near CD quality. We certainly used low quality codecs for news gathering from locations where (or the era when) telephone-line modem was the only data transport channel available. 

Link to comment
Share on other sites

Downloaded your files to WavePad and ran A/B comparisons.

Your AAC (H264) is indeed 'burbly" when contrasted with your MPEG4.

Using that MPEG4 file as the standard, exported it in VP to H264 at AAC highest quality.  Result was closely comparable to the original.  How that would impact different content is unclear.

Also tested AVI exports at Mp3 and PCM with clean results, comparable to the original and perhaps slightly better than H264 at highest quality.

The developers would have to confirm whether Mp4 H264 and MPEG4 "both use the same audio codec."

Link to comment
Share on other sites

Great! We're on the same page and your hearing is just fine where it matters! I assume your initial observations were clouded by that mysterious behaviour when playing through an Internet browser.

According to MediaInfo, the "H264" and "MPEG:4" labelled MP4 exports use the identical AAC-LC codec but the so-called 192kbps is 166kbps for MPEG.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...