Audio distortion in (Linux Xubuntu 18.04) version 2.7.9 while editing

Started by maclenin, August 09, 2021, 08:12:55 PM

Previous topic - Next topic

maclenin

Essentially, I am having audio issues with a 1 GB VOB file.

After editing out (saving and cutting) a handful of multi-minute-long segments from a roughly 40 minute video clip, I am starting to have the following audio issue with the remaining 20 minutes of video.

When I move more than 5 seconds ahead - along the video timeline - from where I am currently playing video - the audio, at the new location, is distorted. Video is not affected.

For example, I press the "play/stop" button - move the "cursor" along the timeline to a point more than 5 seconds further along the timeline - and press the "stop/play" or space bar to continue playing: the video plays normally, but the audio is silent or distorted.

When I try to save a clip within the "distorted" audio area "time frame", I receive the following error messages:

Audio

Cannot setup audio encoder, make sure your stream is compatible with audio encoder (number of channels, bitrate, format)

Failed

File test.mp4 was NOT saved correctly.

This (critical) audio issue aside - great expectations for this tool!

Thanks for any guidance!

eumagga0x2a

We have dozens of nightly builds which are "2.7.9". Do you refer to the latest (official or self-compiled)?

It would be necessary to examine the source video. What does mediainfo report about it?

Avidemux has generally a very limited (next to non-existent) capability to handle on-the-fly changes, so that in case the audio format changes midstream, we are screwed.

maclenin

Thanks for your reply!

I am trying to respond to your reply - thoroughly - but I am getting my IP banned among other shenanigans by the forum bot while I try to compose and preview my response - for example:

CleanTalk: *** Forbidden. You sent forms too often. Please wait a few minutes. ***

I think there was some other notice about my having added forbidden "contacts" content of some sort?

Spam alerts went bonkers.

I will keep trying to reply comprehensively!

In the meantime - I'll try to sneak this past:

Build:
http://www.avidemux.org/nightly/appImage4/

avidemuxUniversal_amd64_210731_129.app

More, soon!

 

maclenin

...a bit more:

Parameters:
Video Output - Mpeg4 AVC (x264)
Audio Output - MP3 (lame)
Output Format - MP4 Muxer
Active Filters - Crop

Workflow:
1. Set marker A
2. Set marker B
3. Save - marked clip
4. Cut - marked clip

As I save and cut away clips from the source file, the audio becomes progressively more unstable / distorted in the source file.

I can play the remaining source file content from start to end (uninterrupted) and the audio will not distort as it plays.

However, if I stop play and move the cursor or jump forward a minute or back a minute or a few frames either way, the audio will be distorted when I press play at the new location.

Again, video does not seem to be impacted.

maclenin

...it doesn't seem to like my mediainfo data:


CleanTalk: *** Forbidden. Contains contacts. Message seems to be spam. ***


Will keep at it!

maclenin

...I've attached the mediainfo data here:



Thanks, again, for your help!

eumagga0x2a

Thank you, there is absolutely nothing special with respect to file properties except of a very low video resolution which matches a VCD (a rare thing nowadays). Could you please provide the entire file as a sample if the content is innocuous enough?

maclenin

Thanks for the observations. Would love to share the source file but it's personal stuff for a relative - nothing racy - just private - otherwise, I'd send it on over!

Anything I can test on my end? I am game to give it a go!

With regard to the woeful VCD resolution, is there anything I can do to "upscale" it?

Also - to save a project (not a marked clip) - should I select File > Project Script > Save As Project?

Thanks, again, for your guidance!

eumagga0x2a

Now I do see a very strange thing in the mediainfo output:

Format                                  : MPEG-PS
File size                               : 1 024 MiB
Duration                                : 1 min 27 s
Overall bit rate mode                   : Variable
Overall bit rate                        : 98.1 Mb/s

How can the bitrate of a MPEG-2 video with such a low resolution be that incredibly high? Is the video really only 87 seconds long? Something is fishy here. Maybe timestamps are badly messed up.

Quote from: maclenin on August 10, 2021, 05:57:46 PMAnything I can test on my end?

Please delete the *.idx2 index file, start Avidemux with stdout and stderr redirected to a file

./avidemuxUniversal_amd64_210731_129.app > /tmp/admlog.txt 2>&1
load the video, reproduce the issue, then close Avidemux and attach /tmp/admlog.txt to your reply. If the log file is too large, then please compress it or split into sections.

maclenin

Thanks, again. I think you might be on to something re: timestamp.

Here's the data from the "info / properties" window. There's a variance in the video total duration vs. audio total duration. I think the video total duration is the accurate value.

=====================================================
Video
=====================================================
Codec 4CC: MPEG
Image Size: 352 x 240
Aspect Ratio: Unknown (10:11)
Frame Rate: 29.970 fps
Average Bitrate: 664 kbps
Total Duration: 02:42:16.827

=====================================================
Video Codec Extradata
=====================================================
Size: 0

=====================================================
Audio (1 active track)
=====================================================
Codec: AC3
Channels: Stereo
Bitrate: 16000 Bps / 128 kbps
Frequency: 48000 Hz
Total Duration: 00:01:26.643

I also attach admlog_edit.zip, which encloses admlog_edit.txt. I have whittled the original log file down from ~25mb and have marked with "..." where I have removed log entries between groups of (and similar):

[refill] 19:10:58-511  Trying to ignore the discontinuous timestamp (1 try)

There were roughly 100K+ lines of "Trying to ignore the discontinuous timestamp" entries in the log file.

Thanks, again, for your guidance!

eumagga0x2a

The issue is probably related to numerous SCR (system clock reference) resets in the source video. But numerous cases of the AC3 decoder (a52) updating the number of channels to extremely rare values like 3 and 4 indicate that we probably feed garbage to the decoder.

You might try to save the entire video in copy mode to a MKV (or at least as MPEG-TS rather than -PS) and edit the resulting file. Who knows, maybe this works around the problem.

maclenin

Great workaround suggestion.

Saving the entire file in copy mode - to MKV - seems to have resolved the audio issue.

Here's the MKV file "info/properties" detail - with video and audio durations, essentially, equal:

=====================================================
Video
=====================================================
Codec 4CC: MPEG
Image Size: 352 x 240
Aspect Ratio: Unknown (10:11)
Frame Rate: 29.970 fps
Average Bitrate: 664 kbps
Total Duration: 02:42:16.760

=====================================================
Video Codec Extradata
=====================================================
Size: 0

=====================================================
Audio (1 active track)
=====================================================
Codec: AC3
Channels: Stereo
Bitrate: 16000 Bps / 128 kbps
Frequency: 48000 Hz
Total Duration: 02:42:16.193

One additional question, if I may:

Is there any way to improve the resolution of the original video? Is an "up-conversion" possible?

Thanks, again, for the help / patience!

eumagga0x2a

Quote from: maclenin on August 12, 2021, 09:20:55 AMIs there any way to improve the resolution of the original video? Is an "up-conversion" possible?

Upscaling is possible (you may want to try the "spline" algorithm in the swsResize filter), but it won't improve quality, obviously. If you have technical reasons for upscaling (e.g. compatibilty with some old TV sets or such), do it, else I would leave the video as-is.

maclenin

Thanks!

Have proceeded as you suggest.

Used swsResize (spline) as well as ffmpeg (lanczos) in a few different scales with nearly identical results:

Size changes, but quality does not "upscale" given the source quality.

Thanks, again, for your guidance - on all fronts!