digitalFAQ.com Forum

digitalFAQ.com Forum (https://www.digitalfaq.com/forum/)
-   Restore, Filter, Improve Quality (https://www.digitalfaq.com/forum/video-restore/)
-   -   Capture in sync, but convert to MP4 is not? (https://www.digitalfaq.com/forum/video-restore/12970-capture-sync-convert.html)

ThumperStrauss 09-16-2022 08:45 PM

Capture in sync, but convert to MP4 is not?
 
I captured a VHS tape using my ATI 9600XT. The resulting AVI is in sync even after 2 hours, when I view it in my Windows 10 in MPC.

However, when I converted to mp4 (x264) with Selur Hybrid—as I've done many times before with other tapes—the resulting video gets further out of sync as it goes. The audio sampling rate of the raw capture and the mp4 are both 48000. I'm a bit stumped. What could be causing this? What setting should I zero in on?

dpalomaki 09-17-2022 06:24 AM

Is it a uniform drift rate?
How much drift; e.g., frames per hour?

Does it drift if you use other players or platforms?

Selur 09-17-2022 10:11 AM

Does it make a difference if you enable "Config->Automation->On Load->Always extract timecodes from input" and disable the 'only some' suboption?

traal 09-18-2022 09:59 AM

Is the video stream constant frame rate (CFR) or variable frame rate (VFR)? MediaInfo will tell you.

Selur 09-18-2022 10:03 AM

MediaInfo looks at a few time codes at the beginning of the file not the whole file.
So if the first xy hundred frames have a constant frame rate MediaInfo will report CFR and if a single frame has a wrong time stamp it will report VFR.
Especially with captures MediaInfo can be easilty wrong.

hodgey 09-18-2022 11:18 AM

It could also be drop frames marked in the avi file - I've encountered something similar with using avisynth directly rather than hybrid (while VLC and similar seem to be able to sync up on it's own). Don't think I managed to find a way around it when loading directly in avisynth. (The main issue is something with the capture card (Avermedia U3) driver causing frame drops/inserts at the start of a recording with virtualdub. It doesn't occur with amarectv but amarec has issues getting all the possible output formats.)

Don't think AVI can even be VFR, at least not if using huffyuv, lagarith et. al. More modern formats like mp4 and mkv feature timestamps for the individual frames but AVI can only mark frame drops and possibly inserts afaik.

Selur 09-18-2022 11:23 AM

Quote:

Don't think I managed to find a way around it when loading directly in avisynth.
Using ffms2 or lwlibavsource and specifying a frame rate should work. This will cause the source filter to decoder to a specific frame rate, but if the frame rate it too low, you might lose frames.
(.avi also has time stamps, with the settings above Hybrid uses ffmpeg to extract those and then check if the input is vfr or cfr)

lollo2 09-18-2022 05:19 PM

Quote:

AVI can only mark frame drops and possibly inserts
Are you sure about that? In all of my captures I can detect a duplicated frame, but never a dropped frame inside the avi file without having the capture log file.

- dropped frame: the data is simply missing, and in the avi file there is no a (simple) way to recognize it. I can only discover a dropped frame looking to the capture software report (for example the log file in AmarecTV) and comparing two captures of the same segment, where one presents a dropped frame. AFAIK a dropped frame can be written as a 0-byte length frame, but I ignore if the capture software we use do that, and eventually how to extract that info from the avi file with a piece of custom software and recognize a "dropped frame".

- inserted frame: this is easy, because an inserted frame is just a repetition of the previous frame. The capture software does not re-write the full frame, but just a few byte instruction, saying to repeat the previous frame. This is easily detectable, for exampe with VirtualDub, opening the avi file and using "Video -> Go -> Prev drop frame" or "Video -> Go -> Next drop frame". In VirtualDub the name "drop" is used, but it actually refers to "inserted" frames.

Just for curiosity, how do you manage the dropped frames in vhs-decode?

ThumperStrauss 09-22-2022 11:05 AM

I tried but this didn't help.

ThumperStrauss 09-22-2022 11:08 AM

According to MediaInfo, my captured AVI has constant audio. But my mp4 output is variable.

CAPTURED RAW FILE
Code:

Audio
ID                                      : 1
Format                                  : PCM
Format settings                          : Little / Signed
Codec ID                                : 1
Duration                                : 21 min 29 s
Bit rate mode                            : Constant
Bit rate                                : 1 536 kb/s
Channel(s)                              : 2 channels
Sampling rate                            : 48.0 kHz
Bit depth                                : 16 bits
Stream size                              : 236 MiB (2%)
Alignment                                : Aligned on interleaves
Interleave, duration                    : 33  ms (1.00 video frame)
Interleave, preload duration            : 500  ms

AFTER MP4 CONVERSION
Code:

Audio
ID                                      : 2
Format                                  : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                : mp4a-40-2
Duration                                : 21 min 29 s
Bit rate mode                            : Variable
Bit rate                                : 129 kb/s
Maximum bit rate                        : 135 kb/s
Channel(s)                              : 2 channels
Channel layout                          : L R
Sampling rate                            : 48.0 kHz
Frame rate                              : 46.875 FPS (1024 SPF)
Compression mode                        : Lossy
Stream size                              : 19.8 MiB (3%)
Encoded date                            : UTC 2022-09-20 02:02:15
Tagged date                              : UTC 2022-09-20 02:02:16


Selur 09-23-2022 11:00 AM

aac is variable bit rate, but that the audio uses variable bit rate has nothing to do with sync issues.


All times are GMT -5. The time now is 06:41 PM

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.