Author Topic: Audio synch 2.7.4  (Read 560 times)

mmmmna

  • Newbie
  • *
  • Posts: 3
Audio synch 2.7.4
« on: November 30, 2019, 06:07:15 PM »
I use Linux (Currently Ubuntu Mate 18.04 LTS which is only 64 bit).

I've downloaded and use AVIDemux 2.7.2 App Image.

I'm transferring VHS tapes to digital format. NTSC, I'm sure.

To transfer, I'm using a device I bought from Amazon, shows on Amazon with
DM272 watermarked over the photo. It appears identical with EZ Cap 272, and the
printed manual was titled EZ Cap 272.

This is a stand alone device, meaning it does not require software for
conversions.

I deliberately chose a non-software conversion device because I do not possess
any Windows (nor a compatible Mac) computer. And am not interested in obtaining
such operating systems.

My truest editing needs are to simply trim excess lead in and lead out. This
editing is necessary since I cannot see when the VCR begins and ends sending
actual content to the EZ Cap 272.

I have attempted to use Linux apps Kino, Flowblade, KDENlive and OpenShot.
These are too featured for me to grasp, and exceed my needs.

My note today is because my audio is losing synch after AVIDemux trims the
endpoints.

I can get the audio into synch at one point in the output, but the audio loses
synch elsewhere.

Input format: .avi; output format: .avi. Yup, I'm that clueless and I do not wish to switch
formats unless to an MP4 format which is future-proof.

My guess for the cause of losing synch is there may be a frames per second
change which affects video but not audio.

If that is the issue, I would like to change the AVIDemux output frame rate to match
the input frame rate. I do not know either frame rate, so this is my guess.

Avidemux>File menu>Information:
A new popup window appears, is titled Properties.


=====================================================
Video
=====================================================
Codec 4CC:      XVID
Image Size:      800 x 592
Aspect Ratio:      1:1 (1:1)
Frame Rate:      30.000 fps
Total Duration:      02:30:00.333

=====================================================
Extra Video Properties
=====================================================
ExtraDataSize:      00

=====================================================
Audio
=====================================================
Codec:         MP3
Channels:      Stereo
Bitrate:      8000 Bps / 64 kbps
Frequency:      44100 Hz
Total Duration:      02:29:18.101





Q: how do I set the intended output frame rate in AVIDemus?


TIA.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3580
Re: Audio synch 2.7.4
« Reply #1 on: November 30, 2019, 07:31:30 PM »
I've downloaded and use AVIDemux 2.7.2 App Image.

2.7.2 or 2.7.4 as the topic title says? By all means, I'd recommend the latest nightly or building from source yourself, which is trivial on Ubuntu.

Quote
I'm transferring VHS tapes to digital format. NTSC, I'm sure.

If NTSC, then 30.000 FPS is most probably wrong.

Quote
To transfer, I'm using a device I bought from Amazon, shows on Amazon with
DM272 watermarked over the photo. It appears identical with EZ Cap 272, and the
printed manual was titled EZ Cap 272.

This is a stand alone device, meaning it does not require software for
conversions.

It encodes video to Xvid and packs audio and video into AVI – both a poor choice nowadays. Sure, the manufacturer avoided paying for a H.264 licence, but anyway, a (too) high price for convenience. Does this device deinterlace video before compressing at least?

Quote
I deliberately chose a non-software conversion device because I do not possess
any Windows (nor a compatible Mac) computer.

There must be capture devices which output uncompressed video and which work on Linux, e.g. https://gordonlesti.com/digitize-a-vhs-tape-with-ffmpeg-and-easycap-on-linux/ or https://opensource.com/article/18/3/digitizing-vhs-fedora

Quote
My guess for the cause of losing synch is there may be a frames per second
change which affects video but not audio.

Not a change (it is impossible with AVI, which is just a fixed time base multiplied with the current frame number), but 30.000 looks wrong for NTSC, it should be 30000/1001 (timebase = 30000 clock ticks per second, with a frame every 1001 ticks ~ 29,97002997 FPS).

Quote
If that is the issue, I would like to change the AVIDemux output frame rate to match
the input frame rate.

You can easily do this by applying the "change fps" video filter, but this requires re-encoding the video stream once again = you lose quality. Doing such a trick without re-encoding should be possible with some codecs, but currenty it is not supported by Avidemux.

mmmmna

  • Newbie
  • *
  • Posts: 3
Re: Audio synch 2.7.4
« Reply #2 on: November 30, 2019, 09:49:52 PM »
Well, as I am very much not able to purchase any more equipment, I'll work with what I have on hand and take your final statement as my solution:
Quote
You can easily do this by applying the "change fps" video filter, but this requires re-encoding the video stream once again...

Thank you!

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3580
Re: Audio synch 2.7.4
« Reply #3 on: November 30, 2019, 10:07:06 PM »
There are still some strange things. Do the video properties you posted match the source video or an already edited one? Because the loss of A/V sync would happen with the source video as well if the FPS of the AVI was wrong, not just after editing.

Another open question is deinterlacing. If the video hasn't been deinterlaced prior to compression, the result is ruined, there is no use in proceeding.

mmmmna

  • Newbie
  • *
  • Posts: 3
Re: Audio synch 2.7.4
« Reply #4 on: December 07, 2019, 03:31:47 AM »
That info in my first post is for an input file that I wish to edit, intended to show what I was starting with coming from the EZ Cap 272 (see link below).

I checked the file data for a few edited avi files, they all state 30.000 FPS (per avidemux), before and after editing. Also, popped the same input file from my first post into VLC and the codec information in VLC shows 30 FPS. Maybe someone is rounding off?



Back to the point: as far as I can tell referencing a source and its fully edited file, the input file audio is definitely in synch before editing, as in less than about a hundred milliseconds of constant error (showing the same amount of error start to finish). In this case, the source file is a commercially transcribed family hour show from the 1960s, sent to retail channels on VHS somewhere around 1999. I suspect it is all public domain, but I digress.

The error after avidemux editing is to continuously go further out of synch.

Another view of the audio synch error is where I attempted to add a fixed audio shift for avidemux output audio. I can get audio in synch in pretty much ONE location in the output file, with the audio being too early in the beginning of the output file, audio is just right in the middle of the output file and audio is late at the end of the output file. If you need hard numbers, I can eventually get them by reediting the source file once more so as to have live data for you.

In my layman ears, it sure sounds like a 29.97 to 30.00 kind of error to me, but you decide. Maybe I'm pointing to the wrong end of the horse.

Deinterlacing? The manual for the capture box doesn't declare such. Target audience issue. Think gramma and grandpa: "Just plug it in and press record? Yayyy! Aren't we MODERN, hun?!".

Device website:  http://www.ezcap.com/article_list_98.html, listed on the right side.

I should do this...

Input file: 2019 07 23 RS 5 pack vol 3 VP 57 min.avi
Quote
=====================================================
Video
=====================================================
Codec 4CC:      XVID
Image Size:      800 x 592
Aspect Ratio:      1:1 (1:1)
Frame Rate:      30.000 fps
Total Duration:      01:00:53.733

=====================================================
Extra Video Properties
=====================================================
ExtraDataSize:      00

=====================================================
Audio
=====================================================
Codec:         MP3
Channels:      Stereo
Bitrate:      8000 Bps / 64 kbps
Frequency:      44100 Hz
Total Duration:      01:00:36.683


Output file: 2019 07 23 RS 5 pack vol 3 VP 57 min_edit plus 1300.avi
Quote

=====================================================
Video
=====================================================
Codec 4CC:      XVID
Image Size:      800 x 592
Aspect Ratio:      1:1 (1:1)
Frame Rate:      30.000 fps
Total Duration:      00:55:44.433

=====================================================
Extra Video Properties
=====================================================
ExtraDataSize:      00

=====================================================
Audio
=====================================================
Codec:         MP3
Channels:      Stereo
Bitrate:      8000 Bps / 64 kbps
Frequency:      44100 Hz
Total Duration:      00:55:28.701

The reference in the output file name to 'plus 1300' refers to a millisecond amount of delay I tried in hopes of seeing everything synch up. Nope.
« Last Edit: December 07, 2019, 03:33:46 AM by mmmmna »

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3580
Re: Audio synch 2.7.4
« Reply #5 on: December 07, 2019, 07:17:06 AM »
I don't think 30 fps is due to rounding. The device spec says they use a fixed fps value of 30, so they do exactly as advertised (which is wrong for NTSC input).

I can get audio in synch in pretty much ONE location in the output file, with the audio being too early in the beginning of the output file, audio is just right in the middle of the output file and audio is late at the end of the output file.

This matches the effects of the wrong (too high) FPS. Please try re-encoding a portion of the source video with the changeFps filter applied (custom input frequency 30.00 to "29.97 (NTSC)") as a test. If the result is in sync, re-encode the entire video.

Quote
Deinterlacing? The manual for the capture box doesn't declare such. Target audience issue. Think gramma and grandpa: "Just plug it in and press record? Yayyy! Aren't we MODERN, hun?!".

Gramma and grandpa still posess eyesight, once they use such video conversion tools. They don't need to know what interlacing means. An interlaced video should be de-interlaced before compression (some codecs are capable of treating interlaced input in a special way, but don't rely on that). Otherwise jagged distorted shapes of moving objects are not correctable later.