Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Nidoking
Jan 27, 2009

I fought the lava, and the lava won.

Olive Branch posted:

Noticing that since I need to do Wavsource, I drag my joined, raw footage into Audacity. And here's where I hit a snag: Audacity imports the audio file using FFmpeg codecs. The issue is that this imported audio file tends to be shorter than the actual video file. In the latest example of this error, the imported audio of an .mp4 I had joined together is a whole 2 seconds shorter than the video, so if I try to audiodub the audio .wav and video .mp4, VirtualDub and any other video player dutifully uses that wrong .wav which is missing time from the video.

Don't open video files in Audacity. If you absolutely need a separate WAV file of the audio, try opening the edited script in VirtualDub and using the "Save WAV" option to extract the audio. I've never had a problem with that.

On the other hand, why do you need to use Wavsource rather than FFAudioSource to grab the audio right from the same file? Or did you just not understand Avisynth enough to know that you could do that?

Adbot
ADBOT LOVES YOU

Olive Branch
May 26, 2010

There is no wealth like knowledge, no poverty like ignorance.

Nidoking posted:

Don't open video files in Audacity. If you absolutely need a separate WAV file of the audio, try opening the edited script in VirtualDub and using the "Save WAV" option to extract the audio. I've never had a problem with that.

On the other hand, why do you need to use Wavsource rather than FFAudioSource to grab the audio right from the same file? Or did you just not understand Avisynth enough to know that you could do that?
I didn't know you could do FFAudioSource instead of Wavsource so that helps cut a step, but I still need to have a separate audio to then edit in Audacity after recording commentary with my co-host. That's why I need to save the WAV or extract it before we comment.

So, I tried using FFAudioSource instead of WavSource in the code. The issue I'm having now is that, when I use this code...

code:
loadplugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ffms2.dll")
a=ffaudiosource("recordedfootage.mp4")
v=ffvideosource("recordedfootage.mp4",fpsnum=60000,fpsden=1000)
audiodub(v,a)
I am still getting a desync from the audio and video, namely the two seconds disappearing. Could this be a plugin issue?

Nidoking
Jan 27, 2009

I fought the lava, and the lava won.

Olive Branch posted:

code:
loadplugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ffms2.dll")
a=ffaudiosource("recordedfootage.mp4")
v=ffvideosource("recordedfootage.mp4",fpsnum=60000,fpsden=1000)
audiodub(v,a)
I am still getting a desync from the audio and video, namely the two seconds disappearing. Could this be a plugin issue?

How certain are you that the video is exactly 60 fps?

Admiral H. Curtiss
May 11, 2010

I think there are a bunch of people who can create trailing images. I know some who could do this as if they were just going out for a stroll.
Shouldn't matter, the fpsnum/fpsden parameters force the framerate to be exactly what you set by duplicating and/or dropping frames as necessary, preserving video length and relative positions of frames. In theory anyway.

Can you try extracting the audio clip manually via ffmpeg ("ffmpeg -i in.mp4 -vn -c:a copy out.m4a" or similar) and check if that matches your video length?

FrenzyTheKillbot
Jan 31, 2008

Good Hustle
Regarding desync from using Shadowplay, you might want to check out this solution that I was given when I was having the same issue with my Mirror's Edge Catalyst LP. It's kind of finnicky and annoying but it worked.

Xenoveritas posted:

Are you recording with ShadowPlay? Even if you aren't, because it works in VLC, this solution may help. Basically there's a known issue with some FFMS builds that cause it to desync audio from the video with certain MP4s - such as the ones ShadowPlay generates.

edit: Actually, Maple Leaf, you could always give that a try to deal with your audio not working issue too. Unless you figured that out already.

Maple Leaf
Aug 24, 2010

Let'en my post flyen true

FrenzyTheKillbot posted:

edit: Actually, Maple Leaf, you could always give that a try to deal with your audio not working issue too. Unless you figured that out already.

My problem was never desyncing, it was MeGUI hanging on encoding audio if I used FFAudioSource, forcing me to use wavsource instead. But thanks for keeping me in mind.

Nidoking
Jan 27, 2009

I fought the lava, and the lava won.
Might be worth downloading the latest FFMS2 DLL and replacing the old one with it in both cases. It may fix the desync problem and the freezing problem.

Orbs
Apr 1, 2009
~Liberation~
Hello! I recently had to reinstall Rightload due to some hardware issues and now I'm having issues with the LPix plugin. I extracted the latest version 1.5 on the site so that the libcrypto and libssl DLLs are next to the Rightload .exe, and LPix.dll, LPix.xml, and updated-cacert.pem are in the plugins folder, but when I try to upload anything I get the message: "The plugin DLL file seems to be damaged or does not exist! [Exception at Main -> Init UploadThread]

Still happened after deleting and re-extracting the plugin files. I checked every other thing I could think of- made sure my username and password were right in the options, made sure to be logged in at the same time, even disabled Kaspersky since I saw that can sometimes cause issues (though it never did until this reinstallation). Does anyone have any idea what could be causing this?

Olive Branch
May 26, 2010

There is no wealth like knowledge, no poverty like ignorance.

I haven't tried using the code yet but the FFaudiosource code has been working out in my favor for now. So thanks for that Nidoking!

Agent355
Jul 26, 2011


Vegas Pro question:

I have a running gag in my thread where i use cruddy stock transitions in the video when I need to reference something from elsewhere in the game. Since this is the final video that's going up I wanted to make a gag of it and just have like 30 seconds of transitions straight for the last reference clip in the LP. Just like, star wipe after star wipe with jump cuts and fades and all that hullaballoo. Anybody know how to get the program to do that? if I just drag transitions to the bar it doesn't really work right.

lohli
Jun 30, 2008
Not able to double check in Vegas myself right now but I think to get some of those to work you need the clips to overlap for the transition to be applicable.

Jamesman
Nov 19, 2004

"First off, let me start by saying curly light blond hair does not suit Hyomin at all. Furthermore,"
Fun Shoe

Agent355 posted:

Vegas Pro question:

I have a running gag in my thread where i use cruddy stock transitions in the video when I need to reference something from elsewhere in the game. Since this is the final video that's going up I wanted to make a gag of it and just have like 30 seconds of transitions straight for the last reference clip in the LP. Just like, star wipe after star wipe with jump cuts and fades and all that hullaballoo. Anybody know how to get the program to do that? if I just drag transitions to the bar it doesn't really work right.

Does it not work if you click the Event FX icon on the scenes themselves?

Mico
Jan 29, 2011

A billion dollars.
A long time ago I wrote an avisynth function to speed up a clip and set the properties back to the original so that you can splice it.

It's been treating me well since 2012, but I've encountered a situation where I have to do alot of speeding up in one video and it's causing audio desync and I'm not sure why or how to fix it short of guessing at the offset and tacking DelayAudio() onto the end of each clip which I can do, worst case, but its not ideal. I'm hoping if I post the code for the function someone can help me out.

code:
function SpeedUp(clip c, float s){ 
#c = clip you are speeding up, s = factor you want to speed up by (use less than one to slow down)
#please do not pass it a negative number, you cant have a negative FPS so it'll just error ouot.
#preserves samplerate, framerate of original clip so that splicing with the rest of your video still works
	newclip = c
	samplerate = c.AudioRate
	frate = float(Framerate(c)) * float(s)
	newclip = assumeFPS(newclip,frate,true)
	newclip = newclip.ChangeFPS(c, linear=false) 
#added linear=false because if you try and speed it up too much it'll error on you
	newAudio = newclip.TimeStretch(pitch=(100/s))
#pitch the audio down (or up) back to the original
	result = AudioDub(newclip,newAudio).SSRC(samplerate).Trim(0,0)
	return result
}

Nidoking
Jan 27, 2009

I fought the lava, and the lava won.
When you say "a lot of" speeding up, do you mean that you're speeding up long stretches of video, or do you mean that you're speeding up the clips by a large factor? I use a similar function for my speed changes that doesn't have as many moving parts, but doesn't work for speed-up factors more than 10. I just call it more than once if I really need to speed up the video by that much.

code:
function ChangeSpeed(clip c, float rate)
{
  orig = FrameRate(c)
  newvid = AssumeFPS(c, orig * rate)
  return ChangeFPS(newvid, c).AudioDub(c.TimeStretch(tempo=100*rate))
}
There may also be a problem with the floating point math that isn't quite exact, and over very long portions of video, the difference is noticeable. You might just have to apply the function over smaller portions and splice them back together afterward.

Mico
Jan 29, 2011

A billion dollars.
When I say I'm doing alot of speedup, I mean in the sense that I'm calling the function numerous times. I call it about 8 times in this script, normally I only do it once or twice, which is where I suspect the problem is. If I do it once or twice, its probably still desynchronizing but not enough for anyone to notice.

Like this

code:
import("02Club_Jupiter.avs")
#-----
ib=Trim(162091,163323)
js=Trim(163323,186224)
j=ib++speedup(js,16)
k=Trim(186224,203709)
ls=Trim(203709,225509)
l=SpeedUp(ls,16)
m=Trim(225509,254254)
ns=Trim(254254,277746)
n=SpeedUp(ns,16)
o=Trim(277746,289744)
ps=Trim(289744,315547)
p=SpeedUp(ps,16)
q=Trim(315547,331470)
rs=Trim(331470,358731)
r=SpeedUp(rs,16)
s=Trim(358731,373062)
ts=Trim(373062 ,399916)
t=SpeedUp(ts,16)
u=Trim(399916,0)
j++k++l++m++n++o++p++q++r++s++t++u
Trim(81056,0)
ConvertToYV12()
Fadein(30).Fadeout(30)

Nidoking
Jan 27, 2009

I fought the lava, and the lava won.
Well, that doesn't make sense. You're calling the function separately on each clip, so if there's any desync, it must be in the input. That script is doubling up frames at the joins, but I doubt it would be noticeable in the end product. What happens if you just output, say, t at the end instead of splicing all of the parts together? Is it still desynced?

Mico
Jan 29, 2011

A billion dollars.
Since t's a speedup it's hard to tell. When I returned u, it's still desynced.

I went back to my source script that I'm calling from the import, which is stitching together several fraps files and adding a timer on top, noticed the desync was there, too. It's all aligned splices so I don't think that should be happening.

I've found a simple workaround, which is just tacking .DelayAudio(.-5) onto the import, but at least I've ruled out the speedup function as the cause.

Nidoking
Jan 27, 2009

I fought the lava, and the lava won.

Mico posted:

Since t's a speedup it's hard to tell. When I returned u, it's still desynced.

I went back to my source script that I'm calling from the import, which is stitching together several fraps files and adding a timer on top, noticed the desync was there, too. It's all aligned splices so I don't think that should be happening.

I've found a simple workaround, which is just tacking .DelayAudio(.-5) onto the import, but at least I've ruled out the speedup function as the cause.

If you're stitching together Fraps files, you might want to try unaligned splices. That could be your problem.

Mico
Jan 29, 2011

A billion dollars.

Nidoking posted:

If you're stitching together Fraps files, you might want to try unaligned splices. That could be your problem.

Turns out, exactly *one* of the 5 fraps files i'm stitching together that happened to be the bulk of this script (they're separate recording sessions) is just messed up and the audio is offset, so :ms:

When I fix it upstream in the source script everything falls into place.

Orbs
Apr 1, 2009
~Liberation~
Well, trying to get Rightload to work was a bust, and Baldurk had no idea wtf either, so I'm going to try ShareX for image uploading. Clicking the ShareX uploader on LPix leads to a page that gives some code, but... where do I put this code? What other settings do I need to fiddle with to get it to work? Clicking the "custom image uploaders" link there just leads to a massive Github page that doesn't explain anything.

Polsy
Mar 23, 2007

The documentation is over here now but what you're really looking for is this, which is where you put the code (copy the text and import->from clipboard is easiest)

Polsy fucked around with this message at 23:57 on Oct 16, 2019

Orbs
Apr 1, 2009
~Liberation~

Polsy posted:

The documentation is over here now but what you're really looking for is this, which is where you put the code (copy the text and import->from clipboard is easiest)


Got it, thank you!

Captain Capitalism
Jul 28, 2009

Hello everyone,

I posted a video in the sandcastle, but people and I noticed that the first half of the video has the commentary a half second or so early. After that, commentary seems on track.

I recorded post commentary, so is there a way to see what went wrong and fix it? I'd remove a tiny bit from my commentary but this might cause an issue later on in the video.

nine-gear crow
Aug 10, 2013

Captain Capitalism posted:

Hello everyone,

I posted a video in the sandcastle, but people and I noticed that the first half of the video has the commentary a half second or so early. After that, commentary seems on track.

I recorded post commentary, so is there a way to see what went wrong and fix it? I'd remove a tiny bit from my commentary but this might cause an issue later on in the video.

It could be an issue with variable frame rates in the video footage. There’s a program called Handbrake that should be listed in the OP. Try running the footage through that with an output setting of a constant 30 FPS and see if that smooths out the desynch. There should be a tutorial or two online that can help you through it. It seems complex to a first time user but it’s actually fairly easy once you get going.

Captain Capitalism
Jul 28, 2009

nine-gear crow posted:

It could be an issue with variable frame rates in the video footage. There’s a program called Handbrake that should be listed in the OP. Try running the footage through that with an output setting of a constant 30 FPS and see if that smooths out the desynch. There should be a tutorial or two online that can help you through it. It seems complex to a first time user but it’s actually fairly easy once you get going.

Thank you, I'll give that a try. I have a feeling this could also be due to me pausing the recording a few times. The second video I recorded all at once and I'm not seeing the same issues.

Nidoking
Jan 27, 2009

I fought the lava, and the lava won.

Captain Capitalism posted:

Thank you, I'll give that a try. I have a feeling this could also be due to me pausing the recording a few times. The second video I recorded all at once and I'm not seeing the same issues.

That... is what will happen if you pause recording yet try to keep it all in the same audio track. Next time, if you absolutely have to pause in the middle of recording, find a time when you don't have to pause and start over. If you absolutely, positively, undeniably have to record the second half of your commentary while keeping the first half, try capturing in a completely different track so you can synchronize the halves separately.

Captain Capitalism
Jul 28, 2009

Ok, got another question, and this one is a headscratcher for me.

I have a video, and I had to edit some of it, so I used avisynth. that worked great, I have an .avs file and when I play it back everything looks good. Now, how do I get that .avs file into an .avi (or any format) I can upload to youtube? I can load it up in Virtualdub (which I've used for all my other videos) but I get an error when I try to save as .avi. I tried looking this up online but nothing useful is there. What should I do?

Geemer
Nov 4, 2010



Captain Capitalism posted:

Ok, got another question, and this one is a headscratcher for me.

I have a video, and I had to edit some of it, so I used avisynth. that worked great, I have an .avs file and when I play it back everything looks good. Now, how do I get that .avs file into an .avi (or any format) I can upload to youtube? I can load it up in Virtualdub (which I've used for all my other videos) but I get an error when I try to save as .avi. I tried looking this up online but nothing useful is there. What should I do?

Mainly follow this guide. https://salp.fandom.com/wiki/Encoding_with_MeGUI

Commander Keene
Dec 21, 2016

Faster than the others



What is the exact error you're getting?

Captain Capitalism
Jul 28, 2009

Commander Keene posted:

What is the exact error you're getting?

Commander Keene
Dec 21, 2016

Faster than the others



Can you post your .avs file here? Might be there's a script error.

Nidoking
Jan 27, 2009

I fought the lava, and the lava won.
That doesn't look like a script error - it's already in processing, which means that it parsed the entire script, but there was a runtime error when it tried to fetch a frame. That could still be something wrong in the script, but it could also be a corrupted source video or a problem with the DLL that's importing the video. Options off the top of my head are looking for an updated FFMS2 DLL, or removing all edits from the script and just importing the video and exporting it directly. If that works, you can export to a lossless AVI, then apply the same edits to that.

What happens if you load the AVS in VirtualDub, cue it up to frame 320 or so, and just hit play? I would expect the same issue to crop up, and that will be a faster way of debugging it. Also, do still post the script here, since that will be useful information.

Captain Capitalism
Jul 28, 2009

I encoded it with MeGUI, but it's not perfect. Here's the script I used:

code:
video=AviSource("alttpr_inverted_part2_final.avi")
image=ImageSource("whoops.png", pixel_type="RGB32", end=180, fps=60)
image=ConvertToYV12(image)
image=image.LanczosResize(1280,720)
image=audiodub(image, blankclip(video, length=180))
video=video.Trim(0, 82928)+image.Trim(0,180)+video.Trim(111987,0)
return video
The script itself is working, I can load it up in a video player and see everything just fine. And if I skip ahead in VirtualDub it works, but when it reaches the edited portion of the video, it gives me the error too. If I hit play again it continues on like nothing happened. I'd rather encode it with Virtualdub because I think I'll get a better quality.

Nidoking
Jan 27, 2009

I fought the lava, and the lava won.
Just at a glance, there's no need to image.Trim because you've already set both the video and audio tracks of that clip to 180 frames. The Trim could be causing problems because you're trying to trim 181 frames from a 180-frame clip, but I doubt that's it. You might also want to try using ++ instead of +, since part of the audio from the blankclip could be overlapping the original video. I don't think those are likely to be causing the error, though.

One thing you might try is, instead of concatenating all of your clips together, try exporting each part (video.Trim(0, 82928), image, and video.Trim(111987, 0)) to separate files and see whether that works. If it does, look at the File Properties for each one in VirtualDub and make sure they all match. Sometimes, really weird stuff happens. You may be able to try things like resizing your whoops.png to 1280x720 in a graphics program to avoid having to resize in Avisynth, or something like that. Just tossing ideas out there.

LordHippoman
May 30, 2013

I, frankly, want this smug Jagen to be my avatar on all forms of social media immediately.
Hey, sorry if this is a silly question, but I can't seem to find the old image format guide and I was curious.

Would .jpg or .png be preferable for a game like the DS Pokemon titles, where it's sprite based but with some mild 3D background elements?

Artix
Apr 26, 2010

He's finally back,
to kick some tail!
And this time,
he's goin' to jail!
Probably jpg but that seems like one of the edge cases where you just kinda have to try both and see.

Araxxor
Oct 20, 2012

My disdain for you all knows no bounds.

LordHippoman posted:

Hey, sorry if this is a silly question, but I can't seem to find the old image format guide and I was curious.

Would .jpg or .png be preferable for a game like the DS Pokemon titles, where it's sprite based but with some mild 3D background elements?

I'd recommend .pngs. The DS' Pokemon games don't really have a high enough resolution to warrant using .jpgs.

LordHippoman
May 30, 2013

I, frankly, want this smug Jagen to be my avatar on all forms of social media immediately.
Thanks for the suggestions. I ran a test with both and the results looked like this:



PNG Version



JPG Version

The artifacting on the JPG version seems pretty rough, so I think I'm going to have to go with PNGs on this one. That said, I'm having some trouble getting the crop settings right.



The images are 256x394 before I double them in size for readability, and I'm trying to make a setting for top/bottom screen only, which I know I can do. Unfortunately, I've forgotten how, and I can't seem to get them to crop at all. Does anyone see some kind of obvious mistake I'm making here? I've tried fiddling with the X and Y positions, but still no luck.

ChaosArgate
Oct 10, 2012

Why does everyone think I'm going to get in trouble?

Uncheck the resample option, its blurring your screenshots. Also I'm not sure if this will work, but maybe setting the height to 192 instead of the y-pos will get you what you want?

Adbot
ADBOT LOVES YOU

Crosspeice
Aug 9, 2013

I use jpgs since they're smaller and I use a lot of images regardless, but pngs are preferable.

To get different screens, you'll just have to pixel count to get the best results, but it means you can crop for top screen, bottom screen, or both. Examples of what I output:





The difference being I record at the size I output, so I don't make my images double size, and I have the screens side by side for easier readability, but yours look just fine.

The reason you're getting nothing is because you want the x and y positions to be where the top left of your image starts, since you're using that as your central point, and then how much to the right and down your image is cropped (positive), or left and up (negative). So since you have 0,0 for your x and y, just have the width and height as 256 and 192. Double height to get both screens and once, and then change y to 192 and keep the width and height the same if you solely want the bottom screen. Graph plotting, hell yeah.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply