Zarxrax
02-27-2013, 05:38 PM
I am going to go over the process of what is typically involved in the creation of an AMV Hell or AMV Minis.
The process has changed greatly over the years, and I am always trying to figure out ways to further automate and streamline the entire process. The following represents what I am doing for AMV Hell 6.

The entries
First of all, the process begins by allowing people to send me their videos and video info.
Originally, this had been handled by email. But email ended up being rather inefficient and confusing at times. With gmail, conversations often got all mixed up. Messages from different people may end up in the same conversation threads, or replies from someone could end up in a separate conversation than their original message. It was just really hard to track everything accurately.
To help make things more straightforward, I set up a system whereby users can enter their video data into a simple form, and then it gets made into a private forum thread. This has a number of good advantages, mainly:
- each video is separated out into its own thread
- conversation with the creator about that specific video stays in one place
- video information is in a consistent format
- it can easily be shared with other people, such as someone who has been appointed to be a judge


Processing the videos
Once I have viewed the videos, and managed to figure out which ones are going to be used in the final project, the next step is processing the videos to make sure that they are all in a consistent format and to fix up any glaring technical problems. For this, I primarily use Avisynth, specifically with the AvsPmod editor.
To begin with, all of the videos are gathered into a single folder. Then, I run an AvsPmod macro that I have created (basically a python script) which generates an AVS script for each video file.

AMV_Minis Batch.py

import os

# Get the directory containing source files
dirname = avsp.GetDirectory()

if dirname:
# Generate each of the avisynth scripts
for filename in os.listdir(dirname):
fullname = os.path.join(dirname, filename)
nospacefilename = filename.replace(' ', '_')
nospacefullname = os.path.join(dirname, nospacefilename)
if os.path.isfile(fullname):
# Get the extension-based template string
srctxt = avsp.GetSourceString(fullname)
# Create the script string
scripttxt = srctxt + '\n' + 'minis(resize=1, cropp=0, deint=1)'
# Write the script text to a file
f = open(nospacefullname + '.avs', 'w')
f.write(scripttxt)
f.close()

The scripts that are generated are fairly simple, they just contain 2 lines. One to import the video file, and another that is a special avisynth function I have created to do all of the heavy processing.

amvminis.avsi
#resize: 0 = none; 1 = auto (default); 2 = 640x480; 3 = 848x480;
#cropp: 0 = none (default); 1 = auto
#deint: 0 = none; 1 = tfm (default); 2 = tdeint

function minis(clip c, int "resize", int "cropp", int "deint")
{
resize = default(resize, 1)
cropp = default(cropp, 0)
deint = default(deint, 1)
video = c.ConvertToYV12()
video = (deint==1) ? video.tfm() : video
video = (deint==2) ? video.tdeint(mode=2,type=3) : video
video = (cropp==1) ? video.AutoCrop(0) : video
video = (resize==1 && float(video.width) / float(video.height) < 1.4) ? video.spline36resize(640,480) : video
video = (resize==1 && float(video.width) / float(video.height) >= 1.4) ? video.spline36resize(848,480) : video
video = (resize==2) ? video.spline36resize(640,480) : video
video = (resize==3) ? video.spline36resize(848,480) : video
video = (video.framerate>=29.9 && video.framerate<=30.0) ? video.Tdecimate().ChangeFPS("ntsc_film") : video.ChangeFPS("ntsc_film")
video = video.SSRC(48000)
video = (video.width == 640) ? video.AddBorders(104,0,104,0) : video
return video
}
Now this function does a number of useful things. It resizes all of the videos to 848x480 while trying to guess if it should be 4:3 or 16:9 (based on the original resolution). If it guesses wrong, I can manually override the choice. There is also an option to automatically crop off black borders. This is especially useful because for some reason, a ton of people send me files where the ENTIRE video is encapsulated by huge borders on all sides, or they send me a 16:9 letter boxed video which shouldnt be letterboxed. The function also tries to remove any interlacing, and it makes sure the framerate is set to 23.976. It also set the audio to a sample rate of 48000hz.
For the most part, this function takes care of everything for me, but I still need to open every script and visually check it, to see whether I need to change the aspect ratio or crop.

Also at this stage, this is where I may discover that a file is unusable for some technical reason. Generally, I can't load MOV or DV files. Sometimes WMV files fail in a weird way where the frames get out of sync with the audio. 95% of WMV files work, but there are always a couple that might give me problems. Please dont send me MOV, DV, or WMV files.
I also sometimes find that someone has exported their video with 6 channel audio. That will cause it to fail as well.
At this point in the stage, it can sometimes be too late for someone to fix their video, because I am already getting everything put together. Its important that you subscribe to the entries forum so you can get email notifications when I reply to your threads. Otherwise you may never find out that I had a problem with your video at the last minute.

Once the scripts are generated, and I have visually inspected each one, I have a batch script that I run on all of the AVS files to normalize the audio. I use replaygain technology which seems to do an excellent job at keeping the audio levels the same across videos.

wavegain.bat
@echo off
::AVSGain: apply Replaygain to AVS files

if %1X==X goto ALL

:LOOP
for %%I in (%1) do (
echo Applying replaygain to %%I
echo.>>%%~fsI
"F:\AMV Minis\COMMON\wavi.exe" %%I - | "F:\AMV Minis\COMMON\wavegain2.exe" --gain 5 - -e echo AmplifydB^(%%TRACK_GAIN%%^) ^>^> %%~fsI
)
SHIFT
@if %1X==X goto END
@goto LOOP

:ALL
for /f "delims=" %%I in ('dir *.avs /b') do (
echo Applying replaygain to %%I
echo.>>%%~fsI
"F:\AMV Minis\COMMON\wavi.exe" %%I - | "F:\AMV Minis\COMMON\wavegain2.exe" --gain 5 - -e echo AmplifydB^(%%TRACK_GAIN%%^) ^>^> %%~fsI
)

:END
This batch script basically pipes the audio from each avs script into a commandline app called wavegain2, which calculates the amount of audio adjustment that needs to occur, and then writes a line into the avs script to adjust by that amount.

Once that is done, next I use virtualdub to batch encode all of the AVS scripts to AVI files using the UTvideo lossless codec.
And that finishes up that part!

Continued in next post...

Zarxrax
02-27-2013, 05:38 PM
Editing/Compiling
Now at this point, I import everything into Adobe Premiere Pro.
And to start off with, its important to get the videos in a good random order. If the videos are simply sorted by filenames, then videos using the same anime, or by the same creator tend to get lumped together. So in order to randomize the order, I have created an autohotkey script to help me.
Premiere pro has a field on each media item called "description" which you can sort by. So, I made the following script simply type 4 random letters into the description field for each file. Then when I sort by that field, everything is essentially random.

PremiereRandomizer.ahk
InputBox, numberOfTimes, How Many?, After hitting OK Please left click in the field to fill
KeyWait, LButton, D
Loop %numberOfTimes%
{
Random, rand1, 65, 90
Random, rand2, 65, 90
Random, rand3, 65, 90
Random, rand4, 65, 90
Send {ASC %rand1%}
Send {ASC %rand2%}
Send {ASC %rand3%}
Send {ASC %rand4%}
Send {Enter}
}

Once the files are sorted in a random order, I simply select them all and drag them onto the timeline. This creates a good base to start from, but I still need to go in and make a lot of manual adjustments to the order. Its important to have a strong start and finish, as well as to make sure the best videos get distributed well rather than getting lumped in one spot. I also have to make sure that similar stuff doesn't get clumped together, such as multiple videos with the same anime, or to make sure that there aren't several videos in a row without any music. I also have to make sure that any running gags or videos that depend on a previous video get distributed correctly.
Also at this stage, I may need to make small edits to videos, such as trimming off blank space at the end, or cutting a video down to a shorter length.

Next, I have to insert the transition between each clip.
This used to be a time consuming and mind-numbingly repetitive task, but I have recently come up with some autohotkey scripts to automate the insertion of the transitions. I basically use two different scripts for this, the first one inserts the transitions between the clips, and then the second one extends the in and out points of the transitions so that they overlap the clips a bit.
TransitionInsert.ahk
InputBox, numberOfTimes, How Many Transitions?, Make sure the transition is opened in the source monitor and the timeline marker is before the place the first transition needs to go
WinWaitActive, Adobe Premiere Pro
Sleep 300
Loop %numberOfTimes%
{
Send +{Numpad3}
Send {PgDn}
Send +{Numpad2}
Send {,}
}
TransitionExtend.ahk
InputBox, numberOfTimes, How Many Transitions?, Make sure only the transition track is selected, and the timeline marker is at the beginning of the first transition and press T to open the trim editor then click in the trim window. It will begin as soon as you click
KeyWait, LButton, D
Loop %numberOfTimes%
{
Sleep 100
Send !+{Left}
Send !+{Left}
Sleep 100
Send {PgDn}
Sleep 100
Send !+{Right}
Send !+{Right}
Sleep 100
Send {PgDn}
}

Once that's done, all that is left is inserting the opening and the credits.
Now the credits are probably the most time consuming part of the whole ordeal, though I have worked out a method to at least partially automate it.
I begin by using a firefox extension called DownThemAll to download each entry form to an html file on my computer. Then, I have a small program I wrote which can scan each file and extract the credits data, and then write it into a text file which I can then import into a spreadsheet or something. At that point, I have to go through and put them in the same order as the videos appear in.

Finally, the video is exported, and watched to check for any problems. I search for any glitches in the videos, or places where I might need to rearrange some videos. Usually I will have to watch the video at least 2-3 times in order to make sure everything is good to go. Another very time consuming part of the process, especially on the AMV Hells. This doesn't bother me much with AMV Minis, since they are so short.


But in a nutshell, there you have it. This is the process that I go through with every AMV Hell or AMV Minis currently.

Sir Fluffykins
02-27-2013, 05:56 PM
http://media.tumblr.com/tumblr_m1lo0bQ9B91r7tmhe.png

Amazing!


848x480

Guess this means AMVHell 6 won't be HD then?

Haar
02-27-2013, 06:00 PM
People still use WMV?


Guess this means AMVHell 6 won't be HD then?

we confirmed that on like the second page of the rough cut thread.

Zarxrax
02-27-2013, 06:31 PM
I finally got the search function working. This should help bigtime when making the credits.

adzman
02-27-2013, 06:37 PM
Next, I have to insert the transition between each clip.
I hate this part. Lots of repetitive mouse motion and keystrokes. I've been trying to work out a way to automate this, but I am still trying to figure it out.

Yeah, I felt that was the worst part of compiling the Jojo's Fab Adventures clips, and it was only 15 minutes long. :/

Haar
02-27-2013, 06:42 PM
Doing transitions has never really bothered me too much. Now, when I tried to manually keep audio balanced....

mattroks101
02-27-2013, 07:50 PM
Huh... That's interesting. For me, it was always just "Throw all the clips in and add transitions". It's interesting to see your thought out approach.

N.P.C.C.
02-27-2013, 08:23 PM
Note to self: Try not to botch the submission sheets anymore...

Haar
02-27-2013, 09:58 PM
Note to self: Try not to botch the submission sheets anymore...

Did you really think he wasn't doing anything with those?

N.P.C.C.
02-27-2013, 10:12 PM
Did you really think he wasn't doing anything with those?

No, but i underestimated how much i halted the process by messing them up 2 or three times.

Zarxrax
02-28-2013, 03:09 PM
Aaaaaand, I have now discovered a way to automate inserting the transitions. At least partially.
I'll add it into the first post once I have written the script for it.

Zarxrax
03-01-2013, 11:59 PM
Woohoo, I worked out a way to automatically (partially automatically) grab the credits text for me. This should save me considerable time going forward.
Though, I still have to manually check each thread for those people who initially write the wrong data in >.>

hero0901
03-02-2013, 07:31 AM
Please dont send me MOV, DV, or WMV files.



How about MKV is it acceptable?

Zarxrax
03-03-2013, 02:22 AM
Yes, anything that loads fine through ffms2 is ok.

hero0901
03-03-2013, 02:29 AM
Ok. So when will we make another AMV?

SuperLoliSentai
03-03-2013, 02:41 AM
Ok. So when will we make another AMV?

you could always do clips for the amv hell tennis thread :)

hero0901
03-03-2013, 02:45 AM
you could always do clips for the amv hell tennis thread :)

oh yeah tnx... The AMV HELL Tennis is not done yet?

SuperLoliSentai
03-03-2013, 02:49 AM
oh yeah tnx... The AMV HELL Tennis is not done yet?

not as long as I am bored!

hero0901
03-03-2013, 02:49 AM
not as long as I am bored!

OK! because I have so many clips that I wanna post.

Haar
03-03-2013, 03:05 AM
OK! because I have so many clips that I wanna post.
Can't you just use the magic of creativity to make your own video compilation?

hero0901
03-03-2013, 04:40 AM
Can't you just use the magic of creativity to make your own video compilation?

i want AMV HELL to be the main of my clips... so i can see if my clip is accepted ^^

i could make my own but... im lazy to do that ^^

Haar
03-03-2013, 04:54 AM
i could make my own but... im lazy to do that ^^
Make a brief opening sequence, slap 20 clips into Sony Vegas. make some credits, and call it a day like I did.

hero0901
03-03-2013, 05:16 AM
Make a brief opening sequence, slap 20 clips into Sony Vegas. make some credits, and call it a day like I did.

ok then... ill do that ^^