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 9th February 2019, 15:15   #1  |  Link
Danette
Registered User
 
Join Date: Apr 2013
Posts: 148
Correcting Time compressed Sources

I currently have some NTSC DVDís of several older TV shows that have been made from time compressed sources. Iíd like to collect opinions on the best way to reverse this process for both video and audio (hopefully simultaneously with simple script), without affecting video quality. Although the amount of stretching will vary from show to show, it is generally in the area of 5-10%.

Searching on this subject has not left me with any good options that I can find.
Danette is offline   Reply With Quote
Old 9th February 2019, 18:45   #2  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,091
The technique you use will depend on what technology was used to shorten the shows.

You need to provide a clip.

A clip's duration can be shortened by simply removing frames and then adjusting the audio to fit. The audio can either be pitched-corrected, or not. The duration can also be shortened by remapping every frame using motion estimation. This leads to much smoother results, but can introduce artifacts. Another technique is to use frame blending in place of the motion estimation.

Each of these processes will require a different approach to undo.

Many syndicated shows are simply edited to fit a new time slot. This was quite common with old shows. The usual candidates for this were the opening and closing credits and, in many cases, the entire intro. One of the great things when old TV shows were put on DVD or, more recently, became available for streaming, was to finally see them as they were originally broadcast, without those cuts.

You obviously cannot restore footage that isn't there at all.

As always, my recommendation is to look around and find better sources. I'd start with Amazon and Netflix.
johnmeyer is offline   Reply With Quote
Old 9th February 2019, 21:44   #3  |  Link
Danette
Registered User
 
Join Date: Apr 2013
Posts: 148
Quote:
Originally Posted by johnmeyer View Post
The technique you use will depend on what technology was used to shorten the shows.

You need to provide a clip.

A clip's duration can be shortened by simply removing frames and then adjusting the audio to fit. The audio can either be pitched-corrected, or not. The duration can also be shortened by remapping every frame using motion estimation. This leads to much smoother results, but can introduce artifacts. Another technique is to use frame blending in place of the motion estimation.

Each of these processes will require a different approach to undo.

Many syndicated shows are simply edited to fit a new time slot. This was quite common with old shows. The usual candidates for this were the opening and closing credits and, in many cases, the entire intro. One of the great things when old TV shows were put on DVD or, more recently, became available for streaming, was to finally see them as they were originally broadcast, without those cuts.

You obviously cannot restore footage that isn't there at all.

As always, my recommendation is to look around and find better sources. I'd start with Amazon and Netflix.
Thanks. That's just about what I've been able to find as well: it can be done, with much effort, but there will be artifacts.

There are no better sources, as this show was issued on DVD by the licensing studio and is time compressed from previous syndication targets, not edited by cutting. Unfortunately, this studio has no interest in doing anything more with this show.
Danette is offline   Reply With Quote
Old 10th February 2019, 02:59   #4  |  Link
manono
Moderator
 
Join Date: Oct 2001
Location: Hawaii
Posts: 7,209
Quote:
Originally Posted by Danette View Post
There are no better sources, as this show was issued on DVD by the licensing studio and is time compressed from previous syndication targets, not edited by cutting.
Quote:
Originally Posted by johnmeyer View Post
You need to provide a clip.
Maybe you missed that part. There is no one-size-fits-all. They speed them up to all kinds of framerates by removing differing numbers of fields per given amount of time.

Quote:
...without affecting video quality.
If you reencode, you affect video quality.

Last edited by manono; 10th February 2019 at 03:02.
manono is offline   Reply With Quote
Old 10th February 2019, 18:16   #5  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,091
Quote:
Originally Posted by manono View Post
Maybe you missed that part. There is no one-size-fits-all. They speed them up to all kinds of framerates by removing differing numbers of fields per given amount of time.
Yes, I realize that the time compression might be quite different in each part of the show. For instance, one thing that almost all shows seem to do is to roll the credits at 3-6 times normal speed, often while reducing them in size and showing a promo for the next show in the remaining part of the screen. The whole show is obviously not sped up by that same amount.

The only reason I asked for a clip was to get some sense of which of the various compression methods were being used on the sections of the main show where compression was being used. Once you know the technique, you can devise the remedy; without that knowledge, any advice is useless.

I posted, several years ago, a script that attempts to look for temporal gaps and then synthesizes a frame to insert at that point. If they are just simply dropping frames (which I have actually seen, so I know it is sometimes done that way), this script would work reasonably well and could be the beginning of a solution to something like this. It would definitely help. You'd then have to keep track of each frame number where a frame was inserted and feed that to some sort of audio stretching algorithm in order to keep the audio in sync. I don't know how to do that trick.

If all the frames have been re-generated by motion estimation, there won't be any gaps and my script would be useless.

Here's that post I referred to:

Automatically fix dups followed (eventually) by drops

The script is in post #6.

Last edited by johnmeyer; 10th February 2019 at 18:20. Reason: Added reference at end to post number that contains the script
johnmeyer is offline   Reply With Quote
Old 10th February 2019, 19:40   #6  |  Link
manono
Moderator
 
Join Date: Oct 2001
Location: Hawaii
Posts: 7,209
Quote:
Originally Posted by manono View Post
Maybe you missed that part
That was directed at Danette. The comment was in no way meant to criticize what you wrote. I apologize for not being more clear. as I can see now where it's open for misinterpretation.

Oh, you've seen real frame drops? Me, I've only seen field drops.
manono is offline   Reply With Quote
Old 10th February 2019, 21:08   #7  |  Link
rjd0309
Wanted Dead or Dead
 
rjd0309's Avatar
 
Join Date: Apr 2008
Location: Phoenix, Arizona
Posts: 36
Daneete, I had to deal with this same problem a few months ago. I had two recordings of an old tv episode. One recording was time-sped, the other was normal speed. The timesped recording had much better video quality.

Comparing side-by-side audio segments from the two recordings indicated that the timesped recording had been sped up by exactly 15% by removing video frames and then resampling the audio so that it would run 15% faster, but with no change in pitch.

My quick and dirty solution was to slow down the video by 15% by creating additional on-the-fly frames using a custom pattern of pulldown flags created with Donald Graft's DGpulldown utility. I also resampled the audio so that it would play 15% slower, but with no change in pitch.

It was as if the timesped video had a frame rate of 25500/1001, but was being played back at the 15% faster frame rate of 30000/1001. I used DGpulldown to create a custom pulldown-flag pattern based upon the custom input frame rate of 25500/1001 and an output rate of 30000/1001.

I used Besweet's Soundtouch option to resample the audio. For every 17 original audio samples, I needed 20.

BeSweet -core( -input input.wav -output output.wav -2ch ) -soundtouch( -r 20 17 )
rjd0309 is offline   Reply With Quote
Old 11th February 2019, 01:45   #8  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,091
Quote:
Originally Posted by manono View Post
Oh, you've seen real frame drops? Me, I've only seen field drops.
It all depends. The project I linked to where I created the script to try to find gaps and interpolate frames at that point was progressive footage, and the drops were complete frames. It all depends on how the video "came to be," how many hands have touched it and attempted to change it, etc.

What I have found over the past twenty years of doing this is:

Anything is possible.
johnmeyer is offline   Reply With Quote
Old 11th February 2019, 03:12   #9  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 6,304
Can someone confirm,
When compressed by dropping fields, they are dropped in top/bottom or bottom/top pairs (even if not from same original frame pair, I guess they MUST be).

So there are these (original pre drop) possibilities ('.' being missing field)
Code:
 t1 | t2 | .  | t4
-------------------    TYPE A
 b1 | b2 | .  | b4


 t1 | t2 | .  | t4
-------------------    TYPE B
 b1 | .  | b3 | b4


 t1 | .  | t3 | t4
-------------------    TYPE C
 b1 | b2 | .  | b4
And TYPE B would imply TFF, and TYPE C BFF.
And if TFF, then only types A or B could be present, if BFF then types A or C only. [possibly two types mixed if edited after time compression, or compression in pieces]
All three types should never [legally] occur in a stream. [Otherwise as in DGIndex, "Illegal Field Order Transition"]

EDIT: For Progressive Frames dropped, could try Duplicity/DropDeadGorgeous combo.

Duplicity/DropDeadGorgeous:- What they can do.
Duplicity: Creates dupe DBase for use by DropDeadGorgeous. You can use ChangeFPS to insert duplicate frames to same framerate as desired output (use dupes as markers when creating DBase).
DropDeadGorgeous: Searches for duplicate, then on finding dupe, scans to at most "ScanAhead" frames prior to dupe looking for frame with biggest difference from its predecessor. [Dupe or SceneChange curtails big diff scan distance]
Interpolate at biggest diff frame and move along one, the frames between big diff (inclusive) to the frame before the dupe,
this sqeezes out the dupe and inserts an interpolated frame where biggest diff is found.
Advantage: All non dupe original frames are kept verbatim in output.

Code:
Locate Dupe, scan prior to dupe to find biggest diff, interpolate at big diff and relocate frames following bigdiff along to squeeze out the dupe.

12345678      IN: Where 7 is Dupe, and diff 2->3 is Big (B)
  |   |
  B   D

12I34568      OUT: Interpolates 2->3 (I), relocates (R) following frames along one place to squeeze out the dupe (dupe frame 7 gone).
  |||||
  IRRRR
Where multiple consecutive dupes (M) found, then will interpolate M frames at B, and relocate frames B to first dupe - 1, to squeeze out the dupes.
Code:
12345678      IN: Multiple consecutive dupes=2(M), Where 6 & 7 are Dupe, and diff 2->3 is Big (B)
  |  ||
  B  DD

12II3458      OUT: Interpolates 2(M) frames(I, 2->3 as interp source), relocates (R) following frames along 2(M) places to squeeze out the dupes (dupe frames 6 & 7 gone).
  |||||
  IIRRR
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 11th February 2019 at 12:45.
StainlessS is offline   Reply With Quote
Old 11th February 2019, 14:28   #10  |  Link
Frank62
Registered User
 
Join Date: Mar 2017
Location: Germany
Posts: 44
We have good experiences with TFM / TDecimate, mode 2 by specifying a framerate. If you have a second source with bad picture quality but correct timing you can calculate a pseudo-framerate (must be a bit higher) for TDecimate and later do assumefps(24000,1001), which slows it down finally.
If you don't have a reference source you can assume the pseudo-framerate by trial and error.
This worked very well for several series where we had this problem.
Frank62 is offline   Reply With Quote
Reply

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 21:39.


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