Hello guest, if you like this forum, why don't you register? https://fanrestore.com/member.php?action=register (December 14, 2021) x


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Working concept syncing different audio sources
#11
Thanks Smile
It seems i´ve to get used to a new program (avisynth or virtualdub), as i´ve never worked with either of them but they seem to be quite popular among project users.
Reply
Thanks given by:
#12
Virtualdub is an editing software, and you can use it "as is"; avisynth is a frame server and works with virtualdub and other softwares (http://avisynth.nl/index.php/FAQ_frameserving); the former is quite easy to use, but the latter is much more powerful, but quite difficult to master... Wink
Reply
Thanks given by: SIUse
#13
(2021-10-14, 07:46 PM)zoidberg Wrote: It's much easier to sync in avisynth, import both sources (using frame accurate source filters) and stack them either horizontally or vertically. This way you're only working in one vdub window with one timeline

Which video plugins do you recommend for frame accurate? FFMS seems to crap out every once in a while with MKVs.
Reply
Thanks given by:
#14
I use ffVideoSource(), if that fails LWlibavVideoSource(), then LSMASHVideoSource() and then last resort DirectShowSource. If it's still crapping out you might want to re-encode the video to something else, won't make any difference to you as you are only using it as a visual guide.
Reply
Thanks given by:
#15
(2022-06-20, 07:01 PM)alleycat Wrote: I use ffVideoSource(), if that fails LWlibavVideoSource(), then LSMASHVideoSource() and then last resort DirectShowSource. If it's still crapping out you might want to re-encode the video to something else, won't make any difference to you as you are only using it as a visual guide.

Yea, something non-264 might be better for frame accuracy, but I'm not sure what. I also have MagicYUV which I use to capture, but not really sure if that'd be any better? Occasionally it seems like the higher res source like the BD video has some frames get "stuck" when moving back and forth. For instance, if a ball was rolling across the frame from left to right, when it should be in the center itd appear back on the left for a couple frames. Reloading the video (F2) in Virtualdub seems to fix this but it sucks it happens.
Reply
Thanks given by:
#16
I use ffvideosource mainly because I can't get any of the newer source filters to work, but I've never had any trouble with frame accuracy so long as the file is in an MKV container and AVC. For MPEG2 stuff with pulldown and such I may use DGDecode, but it's been a while since I've done anything like that so I can't be sure.

It helps if files are on separate HDDs so that the drives don't have to scan like crazy constantly, but if you're finding that it stutters or repeats frames add showframenumber() to see if you can rule out decoder error. If you're still having problems then Alleycat's suggestion of creating a low-res proxy file is the best solution, something like lagarith
Reply
Thanks given by:
#17
@bronan I often find with blu ray footage, once decoded with something like ffvideosource, that it can be slow at times for me to move through the video. Moving forward frames is usually ok but moving backwards can take longer, I'll press the back key say 5 times and nothing happens, then after a brief freeze it moves back 5 frames. Storing the file on an SSD instead of traditional hard drive helped me as did increasing the RAM. But that issue never happens with uncompressed AVI or prores files. Like zoidberg says, try lagarith with say a resize to 50%.

@zoidberg I'm trying to horizontal stack method on a current project - is there a way to incorporate other commands into that script? I can load video A and video B and stack them, but I'm struggling to include other amends in the same script, such as TFM, TDecimate, delete frames, duplicate frames etc. I've tried adding an extra set of () around everything but it gives me errors when importing into VDub. As a workaround I made one script for the DVD, one script for the blu and a third script to import the first two scripts and stack them - that works but has a new problem - I'm getting phantom frame differences. I'll load it into Vdub, one source is say two frames out, delete those frames and reload, then the same source is two frames off the opposite way etc. Very weird. Using two instances of Vdub seems to be fine it only seems to happen when I stack.
Reply
Thanks given by:
#18
I think you both may be onto something there, because the video that has the issue is on my server. I'm going to try moving it over to a local SSD and see if it helps the matter.

@alleycat Can you post your script? Its hard to judge why your stacking isn't working without seeing it.

I'm actually working on some new functions to make it even easier to sync two videos. I will post it when I finish my current project as I'm still working out some kinks.
Reply
Thanks given by: alleycat
#19
@alleycat,

It's possible to combine multiple calls into a single line, as opposed to over a number of lines:

Code:
source("source").tfm.tdecimate.pointresize(720,480).showframenumber.trim(start,end)

In this instance you would only use parentheses to adjust filter parameters like edit points or options within filters like resizing, field order etc. An example script would be

Code:
a=source("bluray").pointresize(720,480)
b=source("laserdisc").tfm.tdecimate
stackvertical(a,b)

For stack to work the two clips' heights or widths must be the same. If you wanted to edit the laserdisc to the bluray and export the audio in Vdub the script may look like this:

Code:
source("laserdisc").tfm.tdecimate.showframenumber
a=trim(start,end)+trim(start,end)#as many edits as necessary
b=source("bluray").pointresize(720,480)
stackvertical(a,b)

With edits I tend to create a separate edit script and import into another script which merges the two clips, however I don't get problems with phantom frames so YMMV
Reply
Thanks given by: alleycat
#20
OK here is where my syncing script is now:

Code:
#helper functions to cut and insert frames
function Insert(clip c, int frameNumber, int framesToInsert)
{
    blankClip = BlankClip(c, framesToInsert)
   
    c2 = frameNumber == 0 ? Eval("""
        return blankClip + c
    """) : Eval("""
        return Trim(c, 0, frameNumber - 1) + blankClip + Trim(c, frameNumber, c.FrameCount)
     """)
     
     return c2
}

function Remove(clip c, int frameNumber, int framesToDelete)
{
    c2 = frameNumber == 0 ? Eval("""
        return Trim(c, frameNumber + framesToDelete, c.FrameCount)
    """) : Eval("""
        return Trim(c, 0, frameNumber - 1) + Trim(c, frameNumber + framesToDelete, c.FrameCount)
    """)
   
    return c2
}

#our video sources
bd = FFVideoSource("c:\bd.mkv")
\.Spline36Resize(720, 480)

ld = FFMS2("c:\ld.mkv", atrack=-1)

#output side by side for syncing
StackHorizontal(bd, ld)

This script assumes your LD has already been processed and converted to 23.976. Load it using VirtualDub, and start playing the movie (Spacebar to Play/Stop, arrow keys to move forward and back frames) . You will probably have to do an initial adjustment to get them in line, then when they go off you either insert or remove frames to keep it in sync. Edit and save your script, then press F2 in Virtualdub to reload the changes.

Now to see what a fully edited movie looks like. The ld line just keeps growing as we work our way through the movie inserting and cutting frames. The first paramter is the frame number where you want to insert or cut, and the second is how many frames. It's important to keep the edits in the order they appear in the movie or you will cause problems with frame numbers.

Code:
ld = FFMS2("c:\ld.mkv", atrack=-1)
\.Insert(0, 20)
\.Insert(3950, 2)
\.Remove(4060, 1)
\.Insert(4213, 1)
\.Remove(4259, 3)
\.Insert(4377, 1)
\.Insert(10526, 1)
\.Remove(10907, 1)
\.Insert(21753, 1)
\.Insert(32159, 1)
\.Insert(50933, 1)
\.Insert(51744, 2)
\.Insert(75552, 1)
\.Insert(78435, 11)
\.Insert(100831, 2)
\.Insert(118562, 1)
\.Insert(120211, 1)
\.Insert(128171, 1)
\.Insert(130930, 2)
\.Remove(136412, 1)
\.Insert(137144, 1)

When you are ready to export your synced track, comment out the StackHorizontal, and just leave "ld". Then in Virtualdub, go to File -> Save Audio. You will probably still want to go back and patch any sections of inserted frames, so as I'm adding the edits, I also make a note of the timecode to make it quick to find them in Reaper.
Reply
Thanks given by: PDB , alleycat , axeyou


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Help] How to apply delay to a whole video file, not just the video or audio streams? Red41804 7 2,254 2024-02-12, 11:03 AM
Last Post: Hitcher
Music [Help] Detect whether 2.0 Audio is Dual Mono or Stereo GjRedo 2 1,302 2023-12-09, 08:35 PM
Last Post: Doctor M
Question [Help] Slow down or speed up Audio for projects bendermac 18 7,397 2023-08-25, 01:59 AM
Last Post: Falcon
  [Help] 2 VHS Audio Captures to remove faults. CSchmidlapp 16 11,494 2023-07-03, 12:15 AM
Last Post: wongfeihung
  [Help] Identify and Repair an Audio Artifact axeyou 2 1,438 2023-06-14, 08:59 AM
Last Post: axeyou
  [Help] Automatically Sync The Audio From Another Source? Endocryne 1 1,825 2022-10-09, 09:47 AM
Last Post: Serums
  [Help] Audio Delay - What does what bendermac 1 1,670 2021-12-10, 12:37 PM
Last Post: resolution
  Need help choosing audio mixing software. Doctor M 5 3,375 2021-07-19, 03:51 AM
Last Post: Doctor M
  Should audio last (almost) as long as video? pipefan413 13 8,690 2021-04-07, 12:57 PM
Last Post: pipefan413
  [Help] Tools for syncing subtitles to video NeonBible 6 3,807 2021-03-27, 10:48 AM
Last Post: BusterD

Forum Jump:


Users browsing this thread: 2 Guest(s)