View Full Version : a few algoritems to do
acro29
3rd January 2008, 16:14
Hello,
I have just recently started to use avisync seriously
and I have a quetion about encoding using avisync...
Avsp in my case.
I have a quetion is it possible to encode only a selcted range of frames in full prossesing and tell the rest to be steam-copied ?
another one I have is about encoding in x264 in two pass;
what diffrent the bitrate from the 1st pass has on the quality/size of the 2nd pass. i mean' is it okay to use crapy setting for the first pass. and high setting for the second.
for example: 1st pass (500kbps) 2nd pass (869 kbps) ?
cheers -ACro
themostestultimategenius
3rd January 2008, 16:23
It can't be done AFAIK.
The first pass should have a higher bitrate than the second pass.
Dark Shikari
3rd January 2008, 16:27
It can't be done AFAIK.
The first pass should have a higher bitrate than the second pass.No, 2pass mode definitely works with differing bitrate between the passes. A huge difference will cause issues, but what the OP described is probably fine.
acro29
3rd January 2008, 16:29
okay' I see, thenx for the help :)
unskinnyboy
3rd January 2008, 17:34
Using AviSynth, you can't just process a certain range and then have the rest direct stream copied, all in the same stream. Either process just the range using Trim(), ApplyRange() etc. OR direct stream with no filtering, but not both. I don't think the latter is what you want.
DarkT
3rd January 2008, 19:20
Isn't the whole idea of 2-pass mode is to have the encoder determine, under the restrictions given - the bitrate per each frame? If you have 1st/2nd pass carry different bitrate limitations... Will it use the full potential of the 2-pass method?
/me wonders...
Dark Shikari
3rd January 2008, 19:51
Isn't the whole idea of 2-pass mode is to have the encoder determine, under the restrictions given - the bitrate per each frame? If you have 1st/2nd pass carry different bitrate limitations... Will it use the full potential of the 2-pass method?
/me wonders...Its not as good as using the correct bitrate, but the encoder is smart enough to just divide every frame's bit cost and such by the difference in target bitrates.
DarkT
4th January 2008, 01:01
Hmmm... Sounds like a waste of time to me... I mean, 1st pass it analyzes the whole video assuming it'll have bitrate X for it's disposal, and then 2nd pass you give it Y bitrate... I don't know...
I suppose that it could improvise, and instead of giving in frame 1, X-percentage bitrate, give it x-percentage+differencepercentage...
If we take the same situation and make it a 3 pass, it just gets even wierder... To me atleast...
Sagekilla
4th January 2008, 02:11
For what you're describing, you can do the following:
Avisource("Sourcefile.avi")
source = last
start = source.Trim(0,1000)
finish = source.Trim(1000,5000)
start = start.Filter()
start ++ finish
That would only process first 1000 frames with whatever filter, followed by a direct stream copy of the next 4000 frames. I've done this before, cutting up a clip into 3 segments so I can slow down the middle segment and rejoin it into one again. Nothing complex.
unskinnyboy
4th January 2008, 02:46
For what you're describing, you can do the following:
Avisource("Sourcefile.avi")
source = last
start = source.Trim(0,1000)
finish = source.Trim(1000,5000)
start = start.Filter()
start ++ finish
That would only process first 1000 frames with whatever filter, followed by a direct stream copy of the next 4000 frames. I've done this before, cutting up a clip into 3 segments so I can slow down the middle segment and rejoin it into one again. Nothing complex.
The segment assigned to finish is absolutely not direct stream copied. AviSynth would still serve uncompressed (albeit unfiltered) video to the encoder, far cry from the real meaning of direct stream copy. Direct stream copy implies that the video is untouched which isn't possible in this scenario.
Perhaps the OP worded his case wrongly, and what you said might indeed be what he wants, but still, a technical term like this shouldn't be loosely used.
Sagekilla
4th January 2008, 05:53
Yeah, sorry used the wrong term there.. The odd thing though is I don't see how it would be possible to have a direct stream copy (i.e. completely unchanged as you mean) followed by a filtered portion and then direct stream again. Wouldn't it be mixing two different codecs together in that case? MPEG-2 + raw + MPEG-2 for example?
From the sounds of it though, he wants to encode the whole clip using x264. If that's the case, he can simply use my script using trim statements. Otherwise, if he really wanted to I think he could use VirtualDub to cut the video before the keyframe for his sequence starts, and when the GOP for however long that clip is ends, save that as an avi to be filtered, and cut out the beginning and parts using same concept.
unskinnyboy
4th January 2008, 13:52
Yeah, sorry used the wrong term there.. The odd thing though is I don't see how it would be possible to have a direct stream copy (i.e. completely unchanged as you mean) followed by a filtered portion and then direct stream again. Like I said before, not possible.
From the sounds of it though, he wants to encode the whole clip using x264. If that's the case, he can simply use my script using trim statements.Yes, that's what I am thinking now too. OP should clarify.
themostestultimategenius
4th January 2008, 15:56
No, 2pass mode definitely works with differing bitrate between the passes. A huge difference will cause issues, but what the OP described is probably fine.
Oh I see. Thanks.
acro29
4th January 2008, 16:37
Yes, thats what I wanted to do, encode the whole stream using x264, but apply fillters only on selected range of frames.
spliting it in virtualdub by keyframe sounds reasonble enough to me :D.
thenx for all the help.
foxyshadis
4th January 2008, 19:10
Using stickboy's JDL_AplyRange script will probably be much simpler than physically splitting the files in the future.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.