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 20th January 2017, 12:15   #1  |  Link
thecoreyburton
Guest
 
Posts: n/a
Audio Slowdown (25>23.976, PAL>Film)

I've got a couple of PAL DVDs (as I'm from a region where PAL is the standard) that I'm currently ripping to my hard disk that I'm having some trouble with. These particular DVDs are progressive - but the footage was shot at 23.976fps, meaning there's been a speed up to get it on to disc. I'd like to restore it to the rate it's supposed to play at because now that I'm aware of speed-up, it's both incredibly noticable and frustrating. To begin, here are two sample files: Examples

Example 1 is the one I need assistance with. The audio is sped up, but the pitch you'll hear is the correct pitch - meaning during the speed up process, only the tempo was changed.

Example 2 is a more typical case. The audio is both faster and higher in pitch. Programs like BeSweet and Eac3to have PAL slowdown operations built into them to handle this. I usually rely on the sync_audio parameter of AssumeFPS if I'm in a rush. Just to clarify, this is included for explanations sake and is not a file I need help with.

I've done a bit of research on the matter through a variety of old threads and haven't come up with a good solution yet. The issue is that the typical adjustments (such as the ones made by BeSweet or Eac3to) seem to handle both pitch and tempo simultaneously. Whilst this is the typical scenario and is superior in terms of quality, that would mean that example1 would be a fraction lower in pitch than it should be as a result of this adjustment. The best solution at this point is TimeStretch, but even with tweaking some of the advanced parameters such as sequence, seekwindow and overlap it's not without issues. It does what I want but the tweaking tends to be a decision between slight varying audio desync or anomalies in the track (such as hearing a click twice, which is common with certain tempo adjustments).

I was wondering if there was a better way or new plugin in the time since some of the older threads were posted that would be able to tackle such an adjustment? Is there a specific set of settings that will make TimeStretch work more transparently?

I know there will be some degree of quality loss, but I can accept that (more than I can accept a sped-up track) provided there aren't any large defects in the resulting track. I'd like to keep this all in AVISynth where possible, but if not it's not too big of a deal. The issue (as far as I can tell) only spans a couple of seasons.

Last edited by thecoreyburton; 20th January 2017 at 12:19.
  Reply With Quote
Old 20th January 2017, 14:40   #2  |  Link
magiblot
Eurobeat Fan
 
Join Date: Sep 2014
Posts: 108
Hello, thecoreyburton.

Extending or shortening audio without artifacts is difficult, but there exists a very good approach: iZotope Radius filter in Adobe Audition.



I'll try to post some samples in a while.

EDIT: Here is your example1 slowed down. New audio lenght is 104,27% of the speeded up 25,000 fps video. I have changed the video framerate by setting it in the properties of the mkv container.

http://www.mediafire.com/file/vt6ru4...na5/sample.zip

My calculations are:



I didn't pay for Adobe Audition. If you need help obtaining it, send me a PM.

Last edited by magiblot; 20th January 2017 at 15:11. Reason: Updated picture.
magiblot is offline   Reply With Quote
Old 20th January 2017, 16:23   #3  |  Link
thecoreyburton
Guest
 
Posts: n/a
Edit: My original post is entirely irrelevant now.

That works wonders. It's a bit of work, but for the quality and consistency of the output it gives it's worth the hassle.

My only question is are you able to import the ac3 files directly without first transcoding?

Last edited by thecoreyburton; 20th January 2017 at 17:55.
  Reply With Quote
Old 20th January 2017, 19:47   #4  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
Quote:
Originally Posted by thecoreyburton View Post
My only question is are you able to import the ac3 files directly without first transcoding?
I own iZotope RX and also Sony Vegas, both of which can do speed changes with/without pitch adjustment. Neither of them read AC3 directly, but that doesn't matter much because you are, of course, going to be re-coding to the new speed, so one re-code is going to happen no matter what. You just want to avoid two encodes.

Therefore, all you need to do is convert the AC3 to uncompressed WAV (which is what most WAV files already are). There is no loss or change to the audio. You then perform the speed change on the WAV file, saving it to whatever file format you want. If you want really good audio, then rather than re-compress to AC3, you can save it as PCM (i.e., WAV). Of course the file will be larger and may not fit back onto a DVD, depending on what you did to the video.
johnmeyer is offline   Reply With Quote
Old 20th January 2017, 20:15   #5  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
@thecoreyburton... side note: I work in a broadcast environment and I apply speed-up to many files on a daily basis. Even though you may hate me, you gotta trust me when I say that we don't have any other choice. Our workflow requires a true 25 interlaced footage 50Hz encoded in XDCAM 50Mbit/s MPEG-2. We get many many files from the States in ProRes 23.976, but the best way to handle them it's the speed up.

1) Duplicated frames: if we duplicate 1 frame every 24 clean frames, it's gonna be noticeable as the camera panning will stop every bloody time and it's painful.

2) blending: blending is a kinda "fine" way to proceed, but the downside is that everything looks blurred on playback and it's kinda weird. It may be fine for some low quality shows like Love it or List it, Cheaters and so on, but definitely not for movies.

3) motion vectors: I tried to use mvtools at home via avisynth in order to create 1 frame every 24 from scratch via motocompensation and vectors prediction, and I was very confident with that, but it ended up creating some noticeable artifacts on objects moving in a "circular way" on the camera, especially on 1080i footages, so I dropped it and I never used it nor proposed it at work.

4) speed-up with pitch adjustment: that is actually really good. Since we dub everything (I mean, everything) we don't really care about speeding up the audio on the original track as it's gonna be in channels 3-4 anyway as second language. As to channels 1-2, we speed music and effects up adjusting the pitch, and the difference it's barely noticeable. As to the video, it plays really smoothly, without artifacts and it's as sharp as the original one.

In other words, "sorry" if we speed everything up, but it's the best choice we have, really. (And no, we can't air progressive footages).
FranceBB is offline   Reply With Quote
Old 20th January 2017, 22:55   #6  |  Link
magiblot
Eurobeat Fan
 
Join Date: Sep 2014
Posts: 108
Quote:
Originally Posted by thecoreyburton View Post
are you able to import
Yes, that's just what I did. However, when I had to export, I enconded to flac to avoid recompressing.

Quote:
Originally Posted by johnmeyer View Post
I own iZotope RX and also Sony Vegas, both of which can do speed changes with/without pitch adjustment.
I wonder if they work the same as the filter included with Audition? Would you mind testing with this sample (or providing me one to test with it) to compare results?
Slowed down lenght is 150% of the original one.

http://www.mediafire.com/file/n9gt78...tn/sample2.zip

Quote:
Originally Posted by FranceBB View Post
[...]
In my country we had a problem with a Japanese animation from the 90's. In first place, it was done a 24 -> 25 fps conversion like the one you described and dubbed over the high-pitched background sound by a certain TV channel. Many years later, a company adquired the rights for that series and released a DVDs with interlaced 24 -> 25 fps conversion (keeping the lenght of the footage). When they had to put the dub on it, they extended the lenght keeping the pitch with a low-end filter (like the ones thecoreyburton was using in first place), so annoying metallic artifacts could be heard. Then, since this company had the rights, TV channels should use the same video master as them. And therefore, they replaced the original dub with the one full of artifacts.

Last edited by magiblot; 20th January 2017 at 23:26.
magiblot is offline   Reply With Quote
Old 21st January 2017, 00:28   #7  |  Link
thecoreyburton
Guest
 
Posts: n/a
Quote:
Originally Posted by johnmeyer View Post
Therefore, all you need to do is convert the AC3 to uncompressed WAV.
That's how I did the test-run in the meantime. That last question wasn't a question of quality but rather one of convenience.

Quote:
Originally Posted by FranceBB View Post
I work in a broadcast environment and I apply speed-up to many files on a daily basis. ... "sorry" if we speed everything up, but it's the best choice we have, really. (And no, we can't air progressive footages).
That's alright, I've come across several similar situations and been in a few myself. Realistically, even though I'm all for the best-quality result despite how long it might take or how difficult it may be to achieve it, the worst footage and sources are still watchable. Sometimes that's the best-case scenario, even though it's not ideal. Most of the time I'm not after the "perfect" video (though I wouldn't knock back that opportunity if it was there), I'm just after making the most out of the source I've got.

Quote:
Originally Posted by magiblot View Post
Yes, that's just what I did.
Are you running CS6 like me, or Creative Cloud? Mine doesn't seem to like AC3 files for whatever reason (they're not supported in the drop down box and selecting one manually throws an error stating the obvious).

Last edited by thecoreyburton; 21st January 2017 at 00:35.
  Reply With Quote
Old 21st January 2017, 00:42   #8  |  Link
magiblot
Eurobeat Fan
 
Join Date: Sep 2014
Posts: 108
Quote:
Originally Posted by thecoreyburton View Post
Are you running CS6 like me, or Creative Cloud? Mine doesn't seem to like AC3 files for whatever reason (they're not supported in the drop down box and selecting one manually throws an error stating the obvious).
I think it's creative cloud. It gives me no problem opening ac3 files.

EDIT: It definitely is creative cloud. CC 2015, compilation 8.0.0.192.
magiblot is offline   Reply With Quote
Old 21st January 2017, 04:53   #9  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
Quote:
Originally Posted by magiblot View Post
I wonder if they work the same as the filter included with Audition? Would you mind testing with this sample (or providing me one to test with it) to compare results? Slowed down lenght is 150% of the original one.
Wow, those slowed down results don't sound too good. Let me see if I have something that can import flac files (I know they are common but I've never dealt with them). I'll post something if I can import the audio.

[edit]OK, no problem getting it into Vegas and I can go from there.

One major problem you have is that your audio is clipped. This will mess up the slow-down algorithms, something that is VERY evident on your "izotope_radius_high.flac" file. You absolutely must run the "de-clipper" in iZotope before you proceed doing anything. Better yet, of course, is to try to get a file that isn't clipped.

Last edited by johnmeyer; 21st January 2017 at 04:57. Reason: added last paragraph
johnmeyer is offline   Reply With Quote
Old 21st January 2017, 05:15   #10  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
OK, here's a zip file that contains two 150% slowdowns. One was done with iZotope RX3 Advanced, using their Radius plugin. I ran the iZotope Declipper before I ran the slowdown, and I saved this file and used it as the input to Vegas. As I mentioned in my previous post, your original is badly clipped, and if you don't first take care of that, you will get lousy results, as you found out.

I then used Vegas Pro, version 10, using its Elastique plugin.

I was getting a problem with Vegas showing clipping in its VU meters, even tough I had reduced the peaks in iZotope when doing the declipping. So I reduced the levels slightly, and as a result the Vegas result is slightly quieter than the one from iZotope. With a few more minutes I could have figured out how to avoid this, but I assumed that what you really wanted to hear was the amount of artifacting in each result.

This is a pretty significant slowdown, and to my ears the artifacts are not too bad: not much echo or flanging; very little stuttering; and only a slight increase in the sibilants.

Here you go:

Two samples

I saved this in WAV format so as not to introduce any new encoding artifacts.

Last edited by johnmeyer; 21st January 2017 at 05:16. Reason: added last sentence
johnmeyer is offline   Reply With Quote
Old 21st January 2017, 18:20   #11  |  Link
magiblot
Eurobeat Fan
 
Join Date: Sep 2014
Posts: 108
Hey, I hadn't notice that undesirable noise before, because it wasn't there when editing in Audition. I have found it was generated at the time of exporting the audio to FLAC. Using the WAV format the problem is no longer present and I can show you what it was supposed to sound like:

http://www.mediafire.com/file/wgrp60...77/sample3.zip

Quote:
Originally Posted by johnmeyer View Post
Let me see if I have something that can import flac files (I know they are common but I've never dealt with them)
Theoretically, the difference between WAV and FLAC could be considered the same between a AVI file with uncompressed YUV and a MKV container with a lossless Lagarith compressed stream: FLAC allows more compatibility with metadata and tags, and provides lossless compression. I thought there was no disadvantage on using FLAC instead of WAV, but I'll be more careful from now on, even if it was just Audition's blame for being bad at exporting to FLAC.

Now, comparing our iZotope samples, I feel like mine, which has been less processed (although I understand the clipping problem), sounds a bit better (without considering the volume). I feel this when I listen to yours after mine. On one hand, the extension method seems to work exactly the same for both iZotope Radius samples. On the other hand, Vegas' filter is slightly inferior but still much better than the dummy filter from Audition.
magiblot is offline   Reply With Quote
Old 22nd January 2017, 02:54   #12  |  Link
kuchikirukia
Registered User
 
Join Date: Oct 2014
Posts: 476
Can't eac3to do this in one command?
kuchikirukia is offline   Reply With Quote
Old 22nd January 2017, 03:19   #13  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
magiblot,
The reference FLAC encoder calculates the MD5 of the input audio as it compresses. So does the ffmpeg version of FLAC. As does the WavPack codec.
You should be able to export to wave, convert that to FLAC, convert to WavPack, convert back to FLAC and the MD5 will remain unchanged.
I mention all that because if you export to FLAC, and then export the same file to wave and convert it to FLAC and the MD5 is different, something is probably wrong. It might be a way to work out if something odd is happening to the process when exporting directly to flac.

I've never worked out how to dig out the MD5 other than get foobar2000 to show it to me, but there's probably other ways to do it.

hello_hello is offline   Reply With Quote
Old 22nd January 2017, 14:44   #14  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,890
Quote:
Originally Posted by kuchikirukia View Post
Can't eac3to do this in one command?
Like thecoreyburton explain in first post there are 2 kind of conversions:

Quote:
Example 1 is the one I need assistance with. The audio is sped up, but the pitch you'll hear is the correct pitch - meaning during the speed up process, only the tempo was changed.

Example 2 is a more typical case. The audio is both faster and higher in pitch. Programs like BeSweet and Eac3to have PAL slowdown operations built into them to handle this.
eac3to can manage Example 2 with -slowdown (using libSsrc.dll).

But with the Example 1 the output don't have the correct pitch.

To manage the Example 1 for free there are TimeStretch, but the quality is less than using commercial soft like iZotope (and others). Of course eac3to can't use that plugin.

EDIT: BTW if the free option is enough for you there are a chance to work with eac3to:

The AviSynth plugin TimeStretch are based in SoundTouch libraries and there are a command line tool (SoundStretch 1.9.2 for Windows) that can be used with eac3to:

eac3to "Example 1" -stdout.wav -simple | soundstretch stdin SLOWDOWN.wav -tempo=-4.095904
eac3to "Example 1" -stdout.wav -simple | soundstretch stdin SPEEDUP.wav -tempo=4.2708333
__________________
BeHappy, AviSynth audio transcoder.

Last edited by tebasuna51; 23rd January 2017 at 13:17. Reason: add info
tebasuna51 is offline   Reply With Quote
Old 23rd January 2017, 03:32   #15  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by hello_hello View Post
I've never worked out how to dig out the MD5 other than get foobar2000 to show it to me, but there's probably other ways to do it.
Dont know for sure if this would work (but almost certainly will),

try HashMyFiles:- http://www.nirsoft.net/utils/hash_my_files.html
Quote:
HashMyFiles can also be launched from the context menu of Windows Explorer, and display the MD5/SHA1 hashes of the selected file or folder.
OR

HashCheck Shell Extension:- http://code.kliu.org/hashcheck/

Quote:
The HashCheck Shell Extension makes it easy for anyone to calculate and verify checksums and hashes from Windows Explorer. In addition to integrating file checksumming functionality into Windows, HashCheck can also create and verify SFV files (and other forms of checksum files, such as .md5 files). It is fast and efficient, with a very light disk and memory footprint, and it is open-source.
Shows CRC-32, MD4, MD5, and SHA-1 via file Properties/Checksums. [EDIT: Checksums new item in Properties]

An audio file is just a file, should make no difference in calculating MD5, so should be same as shown by FooBar2000.

EDIT: Obviously can use for files other than audio too.
EDIT: Perhaps if audio file carries some kind of additional eg metadata, then MD5 would not match, so maybe FooBar2000 only
calculates on the actual audio, and so above FILE COMPLETE MD5 calculators would be lacking/wrong, so maybe ignore this post
__________________
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; 23rd January 2017 at 04:08.
StainlessS is offline   Reply With Quote
Old 23rd January 2017, 09:18   #16  |  Link
thecoreyburton
Guest
 
Posts: n/a
This has been very insightful! I have a different (but related) question too, actually. Is there a way to adjust the subtitle track (vobsub, in this case) by the same slowdown as the video and audio?

I'm thinking the stretch property in the MKV container for the subtitles could be the most viable solution (using the same value magiblot mentioned earlier), but would that work?; Is there a more practical way to do this at an encoding level or is that the best option for such a scenario?
  Reply With Quote
Old 24th January 2017, 02:05   #17  |  Link
magiblot
Eurobeat Fan
 
Join Date: Sep 2014
Posts: 108
Quote:
Originally Posted by thecoreyburton View Post
This has been very insightful! I have a different (but related) question too, actually. Is there a way to adjust the subtitle track (vobsub, in this case) by the same slowdown as the video and audio?
Well, the way would be converting all timestaps into seconds and apply them the conversion factor. I don't know which programs do this, though.
magiblot is offline   Reply With Quote
Old 25th January 2017, 15:47   #18  |  Link
Bloax
The speed of stupid
 
Bloax's Avatar
 
Join Date: Sep 2011
Posts: 317
Quote:
Originally Posted by magiblot View Post
Hey, I hadn't notice that undesirable noise before, because it wasn't there when editing in Audition. I have found it was generated at the time of exporting the audio to FLAC. Using the WAV format the problem is no longer present
It sounds like we're dealing with 32-bit float audio in the WAV being output and encoded as something that isn't 32-bit float.

The reason editing is done in 32-bit float is due to the fact that clipping does not exist in 32-bit float - I'm not certain of the specifics, but I would imagine that it does something similiar to using the same volume bits as 24-bit audio would, but leaves the rest as headroom for over-maximum volumes to retain the dynamics of the volume above what would normally be the maximum.
Bloax is offline   Reply With Quote
Old 21st June 2017, 15:49   #19  |  Link
srfscenar
Registered User
 
Join Date: May 2003
Posts: 492
Hi all,

for soundstretch the 23.976 -> 25 temp is 4.2708333 and the 24 -> 25 tempo is 4.1666667.
Can someone tell me please what is the tempo from 25 to 23,976 and 25 to 24?
How is it calculated?

Thanks!
__________________
" 2 minds are better than 1 "
srfscenar is offline   Reply With Quote
Old 21st June 2017, 16:20   #20  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
Code:
AssumeFPS(24, sync_audio=true).SSRC(AudioRate())
Code:
AssumeFPS(24000, 1001, sync_audio=true).SSRC(AudioRate())
can do what the Thread talk about
__________________
See My Avisynth Stuff
real.finder 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 05:50.


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