One of the great things I've found when working with Virtualdub is that I can take a segment from a preexisting AVI, slow it down, and then reattach it to the file. And I can do it without needing to reencode anything or compromise the quality.
I haven't found a method for doing this with x264 however and that's really the only barrier between moving to that codec for most of my purposes.
Doing it with Virtualdub,
1. I take my cut segment (started at a keyframe and with Direct Stream Copy from the original AVI) and set it to Direct Stream Copy
2. Set the Audio->Interleaving->Delay Audio Track by and set it for a really high number like 9999999ms (so that the slow motion clip won't have mismatched fullspeed audio but will still be compatible with the normal speed clip's audio)
3. Go to Video->Frame Rate
4. Enter the new frame rate in Change Frame Rate to (fps).
5. Under Frame Rate Conversion, change Convert to FPS to the original frame rate (duplicates frames so that the slow motion clip has the same frames per second as the original source)
6. Append the two together with Direct Stream Copy
The result is very smooth as you can have the normal speed clip and then a silent slow motion segment right afterwards. I've also used it to give the slow motion clip audio from a different segment of the original.
What I'm missing in the x264 editors I've tried is step 5. Most of them seem to have no problem slowing the clip down but the way Virtualdub can duplicate frames under the Frame Rate Conversion seems to be somewhat unique.
Is there an x264 editor that can slow a clip down but keep it compatible with the source's frame rate for appending later? Even if I have to slow an x264 clip down in Avidemux and then open it in another program to pad its frame rate that would be just fine with me. Can you pad the frame rate in Avidemux? What I really want to avoid is reencoding anything as I'm just further degrading the quality.
Any ideas?
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 16 of 16
Thread
-
-
AviSynth:
AssumeFPS() #same as VirtualDub's Source Rate Adjustment
ChangeFPS() #same as VirtualDub's Frame Rate Conversion -
What I really want to avoid is reencoding anything
But if you re-encode , one option is to use a frame interpolating script (to generate new frames) instead of frame duplicating. e.g. mflowfps, smoothfps,etc... You will get smoother results, but often there are artifacts in the new frames -
Some SmoothFPS() examples: https://forum.videohelp.com/topic303037.html#1534640
-
I'm thinking you can do this with MKVs by splitting your video into 2 MKVs, then adjusting the playback framerate in the 2nd MKV, then appending it to the first one. Not sure if it'll work in most players, though, and I can't test it out at the moment. If it does, you'll be free of the need to re-encode.
You could even re-encode just the 2nd MKV so as to do interpolation in Avisynth, then rejoin it to the first. It might in fact be better to do this, if concatenation only works well with identical framerates. -
Thanks for the heads up on the reencodes. I've been grappling with avisynth to get my footing and it's been rocky trying to replicate virtualdub behavior (understandable given they're different animals).
I'll try messing with different fps rates in appended MKVs in both mkvtoolnix and Avidemux and let you know if either work. -
I tried experiments with both the same and different frame rates, with and without audio. With the frame rates the same (but duplicate frames in the slow motion one, like the OP's original post) everything played as expected. Each clip in their entirety, one after the other.
I tried again today with different frame rates. Some interesting things happened. I appended three segments, A (25 fps), B (12.5 fps, the same clip slowed by simply flagging the slower frame rate), and C (25 fps, actually clip A again). Without audio all three clips played in their entirety, one after the other. With audio (the second clip's audio was unchanged so it was only half as long as the video) MPC played the full first clip, half the second clip at the slower speed, the remainder of the second clip really fast, then finally the third clip. Apparently it was keeping the audio continuous and adjusting the video to match. VLC did the opposite. It played the first clip normally, then the second clip in its entirety (half speed) but the audio cut out half way though, then the final clip normally again. -
Hmm, so the audio needs to be re-synced/keyed to the clip with adjusted framerate, I take it. I'm assuming everything will be fine if the audio is correctly dubbed.
Thanks for the experimentation, jagabo. Now we know it mostly works on software players (two major ones, anyway). -
Originally Posted by creamyhorror
Originally Posted by creamyhorror -
Wow, thanks or the experimentation! I don't really have a problem redubbing the slow motion audio so this is something I think I can really make work.
As a point of education, should I take this to mean that mkv's flag individual keyframes with the frame rate for the following segment? Or is there some kind of flag that can be set mid-clip that defines the frame rate for all that follows until another flag is encountered?
This is all pretty fascinating to me and I have to say I'm impressed by matroska's versatility to allow for frame rate flexibility in this instance. If it has a defined flexibility in this case, there are some interesting possibilities for non-destructive compilations from a variety of sources. -
What's happening is that you're basically appending separate video streams together, and the player just plays them in sequence. So it's not really switching frame rate mid-sequence (which is more like what VFR, variable framerate, does). Theoretically, IIRC, even videos of different resolution can be appended, but in the real world I think it messes up players.
When doing this you should test it on the player/system you want to play it on, because I suspect it may not work everywhere (whether due to the player or the Matroska splitter).
Another thing to note is that video segments appended like this can't have the same SPS-id, but I'm not exactly sure how unique an SPS-id is (repeating the same clip would definitely be repeating SPS-ids...). Got to ask Doom9 folks, probably. -
Yeah. It doesn't really matter if the container supports mixed frame rates. I wouldn't count on players handling it properly.
-
Similar Threads
-
I have a problem with mp4 files in virtualdub, slow motion audio.
By barbur in forum Newbie / General discussionsReplies: 5Last Post: 12th Feb 2012, 14:16 -
Slow motion at least 1 minute long clips?
By owen bryan in forum Newbie / General discussionsReplies: 4Last Post: 27th Nov 2010, 22:08 -
Slow x264 WHY???
By mbloch in forum Video ConversionReplies: 1Last Post: 1st Aug 2010, 16:33 -
I can't cut clips from mp4 x264 HD.
By Torresinho in forum EditingReplies: 4Last Post: 14th Feb 2010, 18:45 -
How Do I Put A Custom, Created Slow Motion Clip Back In? (Virtualdub)
By WishMaker in forum EditingReplies: 8Last Post: 24th Oct 2007, 12:14