| Printable Version of Topic
Click here to view this topic in its original format |
| Unofficial VirtualDub Support Forums > Newbie Questions > Speeding Up Sections Of A Video. |
| Posted by: Virtualnoob123 Sep 25 2013, 06:28 PM |
| Hi all, Yeah, I want to increase the frame rate for a section of video, but can't seem to get any answers on how to do it. It has audio that will need speeding up too. I can speed up the hole video using Virtualdub's Video Frame Rate Control tab. And I know how to sync the audio too using the Input > Stretch > Output, but I can't seem to increase the fps for a section of video. I tried to cut the clips into section and then edit the frame rates, then tried to stick them back together with append AVI segments. That never worked either. Kept getting an error. Can anyone tell me how to do this? Thanks. |
| Posted by: Altaf Sep 25 2013, 07:58 PM |
| Example 23.97600<25.00000: http://radikal.ru/fp/9e17d9ba833a4284a78116373c731627 |
| Posted by: raffriff42 Sep 25 2013, 08:02 PM | ||
I can get it to work like this, but I recommend another way (see my Avisynth script below)
OK, now let's do it the http://avisynth.nl/index.php/Main_Page way - in fact let's do a slowdown and a speedup, with matching audio speed changes @ constant pitch, all with no temp files:
UPDATE - new change speed function http://forums.virtualdub.org/index.php?act=ST&f=4&t=22174&st=0entry95457 |
| Posted by: Virtualnoob123 Sep 25 2013, 08:11 PM | ||
I'm not sure what you're trying to tell me there, m8 |
| Posted by: Virtualnoob123 Sep 25 2013, 08:23 PM | ||||||
Ok, I downloaded that software and copied and pasted the code into a text file. I edited the the file path, saved, but I'm unsure what you mean by open Virtualdub and compress. I'm a bit of a noob, so you'll need to explain a bit more. If you mean open that avs file with Virtualdub then I get an error about line 7 column 14. Code is like this atm:
|
| Posted by: raffriff42 Sep 25 2013, 08:45 PM |
| You open "something.avs" in VirtualDub as if it was a video file. Avisynth reads the source, does the processing according to the instructions in the script, and passes the video to VirtualDub (or other Avisynth-compatible program), a frame at a time. It's called frameserving, and it's kind of hard to get your head around, I admit. It helps to read some of the introductory articles at avisynth.nl |
| Posted by: Virtualnoob123 Sep 25 2013, 08:48 PM | ||||
It seems the code is wrong somehow. I'm getting errors. Is the code correct:
I get a line 7 column 15 error with that code now. |
| Posted by: raffriff42 Sep 25 2013, 08:49 PM |
| (deleted - see my next post) |
| Posted by: Virtualnoob123 Sep 25 2013, 08:51 PM | ||
Virtualdub error Script error expected a, or ) (:\User\Gareth\Desktop\test.avs, line 7, column 15) |
| Posted by: raffriff42 Sep 25 2013, 08:53 PM |
| You didn't add quote marks around your file path, and you don't have a file extension old: V=AviSource (D:\Movie Folder\Kharg Island\Scout vs stinger noob 45fps) new: V=AviSource ("D:\Movie Folder\Kharg Island\Scout vs stinger noob 45fps.avi") |
| Posted by: Virtualnoob123 Sep 25 2013, 08:53 PM |
| Ahh, that fixe it. Ok, now I go to compression tab? |
| Posted by: raffriff42 Sep 25 2013, 08:59 PM |
| Right. Not sure what "compression tab" you mean, but just make your final video as usual. |
| Posted by: Virtualnoob123 Sep 25 2013, 09:08 PM | ||
| Ok, so now I have the code working and can save the file. I need to change the code to fit my video. It has 1859 frames and I have put the code like this:
But I get errors like the last one. I want to have normal speed up to 500 frames then from 500 to 1000 3 times faster. And from 1000 to the end of the video normal. What do I need to do to get the code to work? |
| Posted by: raffriff42 Sep 25 2013, 09:15 PM | ||
| Trim runs to the end of the video when the second number is zero, so this \ + Trim(V, 1000, 1859, 0) should be \ + Trim(V, 1000, 0) Also: delete the first UUChangeSpeed for normal speed. Also: if 1st part ends @ frame 500, next one starts @ 501
|
| Posted by: Virtualnoob123 Sep 25 2013, 09:23 PM | ||
Ok, this seems to work just fine now:
But for some reason instead of being 4 speed from 501-1000 frames it goes back to normal at around 600-650 frames. And stays normal speed to the end of the video. |
| Posted by: raffriff42 Sep 25 2013, 09:23 PM | ||||
That's because frames were removed to speed up the video. |
| Posted by: Virtualnoob123 Sep 25 2013, 09:26 PM | ||
I added that piece of code to mine like this:
And got the same resaults. Goes back to normal speed at around 600-650! |
| Posted by: raffriff42 Sep 25 2013, 09:33 PM | ||
| OK this change to the code will show what's happening with the source frames. As mentioned in the comment, when done debugging, add a "#" in front of the "ShowFrameNumber" line to disable it
|
| Posted by: Virtualnoob123 Sep 25 2013, 09:34 PM | ||||||
Well, how do I get the video to speed up from frame 501-1001 and not drop off 400 frames too early?! |
| Posted by: raffriff42 Sep 25 2013, 09:49 PM |
| Just watch the video, it works I promise you. I guess I fail at explaining. |
| Posted by: Virtualnoob123 Sep 25 2013, 09:59 PM | ||
Yes, you have solved my problem and thanks. It's just I want to stop the speeded up section on frame 1000, but it drops off at 650. Guess I just add 450 frames to the code. |
| Posted by: meowmeow Sep 27 2013, 03:17 PM |
| Thanks! Nice, nice code works with both video & audio only. And those frames which lost - they're lost while maintaining same FPS at shorter time. |
| Posted by: malky Sep 28 2013, 10:13 AM |
| Great code.Much easier solution than mine. http://forums.virtualdub.org/index.php?act=ST&f=2&t=21264&hl=virtualdub |
| Posted by: raffriff42 Sep 28 2013, 10:43 PM |
| Thanks. I should really credit http://forums.somethingawful.com/showthread.php?threadid=3486018&pagenumber=94&perpage=40#post417244438 (I think it was this one) for the idea. |