PDA

View Full Version : Inserting Deleted Scenes Back in the Movie


DJ Alik
20th October 2002, 17:47
This is what I am trying to do. I am trying to encode "15 Minutes" into DivX5.02. Does anyone know of the best way to get the deleted scenes back into the movie. What I basically need is a Precise Frame by frame VOB file splitter with preview so I can I make a correct D2V project file with new files. Any help would be greately appreciated.

Acaila
20th October 2002, 18:06
No need to cut before making a .d2v file. I believe the easiest (although still not easy) way would be to just do your .d2v files as usual, and make precise frame accurate cuts in Avisynth. Use VirtualDub to find the correct frames to input in Avisynth's Trim() function.

Example:
1) Make .d2v files of the entire movie and of each part you want to insert
2) Load all of these into Avisynth using
movie=MPEG2Source("insert_movie_here.d2v")
scene1=MPEG2Source("insert_deleted_scene_1_here.d2v")
..
..
etc
Return movie+scene1+..+..
3) Open this .avs file in VDub to find the correct frame numbers where you want to insert and add the folowing lines to your .avs:
movie_part1=movie.Trim(0,1000)
movie_part2=movie.Trim(2000,3000)
movie_part3=movie.Trim(8000,8500)
Return movie_part1+scene1+movie_part2+scene2+movie_part3+..+..

I hope you get my point? :)

DJ Alik
21st October 2002, 06:05
i usually use Gordian Knot for bitrate calculations how should I calculate the bitrate in this case?

DJ Alik
21st October 2002, 06:46
what about the sound. This way sounds like i will have desynching nightmares. how do i split up the sound in the same way

Acaila
21st October 2002, 08:31
i usually use Gordian Knot for bitrate calculations how should I calculate the bitrate in this case?
You still can, in the bottom left corner just change the total number of frames to match your new framecount and GKnot will calculate the new bitrate (provided you know the new audio size). You'll have to use VDub manually to encode though.

what about the sound. This way sounds like i will have desynching nightmares. how do i split up the sound in the same wayI'm not sure, either get an audio editor (Sound Forge or so) and split it up there, or try to use Avisynth's audio filters (which I've never used before).

The only other way (which Manono reminded me of) is to just encode each scene completely and cut and glue them back together afterwards. But in that case you'll have keyframe nightmares.

Either way it's going to be quite difficult to get this right.

DJ Alik
21st October 2002, 08:52
Here's my avs file that i made. Does it look right to you?

LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec.dll")
# SOURCE
movie=mpeg2source("D:\15_MINUTES\VIDEO_TS\movie.d2v")
scene1=mpeg2source("D:\15_MINUTES\VIDEO_TS\deleted1.d2v")
scene2=mpeg2source("D:\15_MINUTES\VIDEO_TS\deleted2.d2v")
scene3=mpeg2source("D:\15_MINUTES\VIDEO_TS\deleted3.d2v")
scene4=mpeg2source("D:\15_MINUTES\VIDEO_TS\deleted4.d2v")
scene5=mpeg2source("D:\15_MINUTES\VIDEO_TS\deleted5.d2v")
scene6=mpeg2source("D:\15_MINUTES\VIDEO_TS\deleted6.d2v")
return movie+scene1+scene2+scene3+scene4+scene5+scene6
#
# TRIM
#trim(startframe,endframe)
movie_part1=movie.Trim(0,13444)
deleted1=scene1.Trim(163560,166482)
movie_part2=movie.Trim(13445,38210)
deleted2=scene2.Trim(166484,167937)
movie_part3=movie.Trim(38211,52422)
deleted3=scene3.Trim(167980,169470)
movie_part4=movie.Trim(52423,124400)
deleted4=scene4.Trim(169480,171086)
movie_part5=movie.Trim(125568,140608)
deleted5=scene5.Trim(171094,176953)
movie_part6=movie.Trim(140723,144086)
deleted6=scene6.Trim(177179,179715)
movie_part7=movie.Trim(144503,163542)
return movie_part1+deleted1+movie_part2+deleted2+movie_part3+deleted3+movie_part4+deleted4+movie_part5+deleted5+movie_part6+deleted6+movie_part7
#
# CROPPING
crop(11,55,698,366)
#
# RESIZING
BicubicResize(696,308,0,0.5)
#




Another question. Now when I open this file in VDub it shows the deleted scenes at the end of the movie and the trimming is not previewed at all. Is there anyway to preview the final location of the files before encoding it?

hakko504
21st October 2002, 09:27
The first return makes avisynth forget everything after it. Also, do you really need to add the trim to every deleted scene? If the .d2v's are created correctly you should be able to use this script:LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec.dll")
# SOURCE
movie=mpeg2source("D:\15_MINUTES\VIDEO_TS\movie.d2v")
scene1=mpeg2source("D:\15_MINUTES\VIDEO_TS\deleted1.d2v")
scene2=mpeg2source("D:\15_MINUTES\VIDEO_TS\deleted2.d2v")
scene3=mpeg2source("D:\15_MINUTES\VIDEO_TS\deleted3.d2v")
scene4=mpeg2source("D:\15_MINUTES\VIDEO_TS\deleted4.d2v")
scene5=mpeg2source("D:\15_MINUTES\VIDEO_TS\deleted5.d2v")
scene6=mpeg2source("D:\15_MINUTES\VIDEO_TS\deleted6.d2v")
#
# TRIM
#trim(startframe,endframe)
movie_part1=movie.Trim(0,13444)
movie_part2=movie.Trim(13445,38210)
movie_part3=movie.Trim(38211,52422)
movie_part4=movie.Trim(52423,124400)
movie_part5=movie.Trim(125568,140608)
movie_part6=movie.Trim(140723,144086)
movie_part7=movie.Trim(144503,163542)
total=movie_part1+scene1+movie_part2+scene2+movie_part3+scene3+ \
movie_part4+scene4+movie_part5+scene5+movie_part6+scene6+movie_part7
#
# CROPPING
total.crop(11,55,698,366)
#
# RESIZING
BicubicResize(696,308,0,0.5)
#
About the audio: Current version of AVIsynth only supports Wav audio so if you wants AC3 (5.1) sound then you have problems. Sh0dan has promised to release an 2.5alpha of AVIsynth in the near future that might work, but I wouldn't bet on it. Together with an AVIsynth version of BeSweet it would definitely solve a lot of problems when dealing with audio.

If you can live with 2channel audio the you can use WAVsource and AudioDub to get the audio correct.The script would look like this:LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec.dll")
# SOURCE
movie=mpeg2source("D:\15_MINUTES\VIDEO_TS\movie.d2v")
movie_sound=WavSource("D:\15_MINUTES\VIDEO_TS\movie.wav")
movie=AudioDub(movie,movie_sound)
scene1=mpeg2source("D:\15_MINUTES\VIDEO_TS\deleted1.d2v")
scene1_sound=WavSource("D:\15_MINUTES\VIDEO_TS\deleted1.wav")
scene1=AudioDub(scene1,scene1_sound)
scene2=mpeg2source("D:\15_MINUTES\VIDEO_TS\deleted2.d2v")
scene2_sound=WavSource("D:\15_MINUTES\VIDEO_TS\deleted2.wav")
scene2=AudioDub(scene2,scene2_sound)
scene3=mpeg2source("D:\15_MINUTES\VIDEO_TS\deleted3.d2v")
scene3_sound=WavSource("D:\15_MINUTES\VIDEO_TS\deleted3.wav")
scene3=AudioDub(scene3,scene3_sound)
scene4=mpeg2source("D:\15_MINUTES\VIDEO_TS\deleted4.d2v")
scene4_sound=WavSource("D:\15_MINUTES\VIDEO_TS\deleted4.wav")
scene4=AudioDub(scene4,scene4_sound)
scene5=mpeg2source("D:\15_MINUTES\VIDEO_TS\deleted5.d2v")
scene5_sound=WavSource("D:\15_MINUTES\VIDEO_TS\deleted5.wav")
scene5=AudioDub(scene5,scene5_sound)
scene6=mpeg2source("D:\15_MINUTES\VIDEO_TS\deleted6.d2v")
scene6_sound=WavSource("D:\15_MINUTES\VIDEO_TS\deleted6.wav")
scene6=AudioDub(scene6,scene6_sound)
#
# TRIM
#trim(startframe,endframe)
movie_part1=movie.Trim(0,13444)
movie_part2=movie.Trim(13445,38210)
movie_part3=movie.Trim(38211,52422)
movie_part4=movie.Trim(52423,124400)
movie_part5=movie.Trim(125568,140608)
movie_part6=movie.Trim(140723,144086)
movie_part7=movie.Trim(144503,163542)
total=movie_part1+scene1+movie_part2+scene2+movie_part3+scene3+ \
movie_part4+scene4+movie_part5+scene5+movie_part6+scene6+movie_part7
#
# CROPPING
total.crop(11,55,698,366)
#
# RESIZING
BicubicResize(696,308,0,0.5)
#

DJ Alik
21st October 2002, 13:36
Yes, I do need to trim each scene otherwise i would have a bunch of black frames (as much as 10-15) in the middle of my movie

hakko504
21st October 2002, 13:45
In that case, create 6 .avs files like this:LoadPlugin("C:\PROGRA~1\GORDIA~1\mpeg2dec.dll")
mpeg2source("D:\15_MINUTES\VIDEO_TS\deleted1.d2v")and check the trim values with VD. then modify the AudioDub lines to read:scene1=AudioDub(scene1,scene1_sound).trim(start_frame,end_frame)

DJ Alik
21st October 2002, 23:56
didn't quite follow your last post. How do i put those 6 avs files back together? just using append or what?

DJ Alik
23rd October 2002, 04:52
No replys in 2 days :( . I am also wondering, maybe i should use AllignedSplice instead of Unalligned? Still can't trim all parts of the movie and the scenes. I got the movie to trim with untrimmed extras but it looks pretty bad and the sound is offsynch.

DJ Alik
24th October 2002, 15:16
still no replys :confused: Come on people. There must be some Avs geniouses out there. Help me out here pretty please.

Acaila
24th October 2002, 15:32
To call an .avs file from within another .avs file you can use the following:
Part1=Import("C:\<Filename>.avs")
You can do that for all six.

This will store the result of that .avs file in a variable, in this example called "Part1".

I know it works for video-only, as to how it works with audio I have no idea.

DJ Alik
24th October 2002, 16:26
Thank you. I will try it and will let you know how it works out

DJ Alik
31st October 2002, 08:33
I am getting some desynch in audio. I think this is because i didn't set the delay in besweet gui to what it's supposed to be. I am gonna redo all the waves and try again