Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st February 2016, 09:19   #1  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Extracting timecode from mpg

I have a VHS captured mpg file, and in the middle of the video, the video went off sync for about 15 minutes. There're random frame drops that cause video speed up here and there, and I have no clue where to spot every one of them.

I tried to fix it by blind guessing every spot and slow them down accordingly base on the audio, but the process is so hard and very frustrating.

I've noticed that with the mpg on playback, if I seek to a spot in that problematic section, the video will be in sync for a couple of seconds before the video speed up again, so I thought that there should be a counter in the mpg that's keeping track of the frame speed, and eventually there a way to extract this timecode?
lansing is offline   Reply With Quote
Old 1st February 2016, 11:14   #2  |  Link
kuchikirukia
Registered User
 
Join Date: Oct 2014
Posts: 476
Tried remuxing it with the correct frame rate/duration?
kuchikirukia is offline   Reply With Quote
Old 1st February 2016, 14:08   #3  |  Link
thecoreyburton
Guest
 
Posts: n/a
Or potentially / additionally remuxing it to another format, it could be how the format is being handled.
  Reply With Quote
Old 1st February 2016, 14:56   #4  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
Quote:
Originally Posted by lansing View Post
there should be a counter in the mpg that's keeping track of the frame speed, and eventually there a way to extract this timecode?
There is a piece of metadata attached to every frame called the "Presentation Time Stamp" and another one called "Display Time Stamp" - the time the media player should throw the frame on the screen (frames are decoded "out of order"). Play the file with ffprobe.exe (included with ffmpeg) using this batch file
http://forum.doom9.org/showthread.ph...02#post1692702
You are probably going to be most interested in pkt_pts_time or best_effort_timestamp_time.
raffriff42 is offline   Reply With Quote
Old 1st February 2016, 20:01   #5  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
Quote:
Originally Posted by raffriff42 View Post
There is a piece of metadata attached to every frame called the "Presentation Time Stamp" and another one called "Display Time Stamp" - the time the media player should throw the frame on the screen (frames are decoded "out of order"). Play the file with ffprobe.exe (included with ffmpeg) using this batch file
http://forum.doom9.org/showthread.ph...02#post1692702
You are probably going to be most interested in pkt_pts_time or best_effort_timestamp_time.
I have ran the video with the batch, the number on pkt_pts_time and best_effort_timestamp_time are identical on the problematic section
lansing is offline   Reply With Quote
Old 1st February 2016, 20:09   #6  |  Link
raffriff42
Retried Guesser
 
raffriff42's Avatar
 
Join Date: Jun 2012
Posts: 1,373
They are normally identical to one another, from the few samples I have seen. Frame to frame, they should progress at a uniform rate (1/framerate seconds)
raffriff42 is offline   Reply With Quote
Old 1st February 2016, 20:22   #7  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
So it doesn't work on my video?
lansing is offline   Reply With Quote
Old 2nd February 2016, 08:24   #8  |  Link
lansing
Registered User
 
Join Date: Sep 2006
Posts: 1,657
So after 2 days of thinking, I finally figured out a logical process to fix this. I'm using Adobe Premiere's "razor tool" and "rate stretch tool" to do this.

First sync a point from the start and end of the video to the audio, extends the video duration to match the audio. Then go to the middle of the video and find another sync point, split the video in half as session A and B base on that point, and then either stretch/shrink A or B on that point to sycn with the audio. Then find sync points in session A and B separately and repeat the process over and over again. And eventually the process will cover the entire video with sync point interval of a few seconds apart, and the problem will be fixed.
lansing is offline   Reply With Quote
Reply

Tags
extract, mpg, timecode, vhs

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 14:39.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.