Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- This is probably not going to be relevant to almost anyone, but just in case someone tries to put together a similar video I will try to explain how I did it.
- The chat log video:
- This is a pretty jury rigged method, but I couldn't find any better way to do it. I wrote a java program to replay IRC logs with accurate delays between messages, and I then set it to be 25 times faster than normal. This let me record the full 50 hour or so chat log in "only" 2 hours by just recording the program at 50fps and 512x384 resolution in XSplit, so that it would be easily compatible with the stream videos I was working with. After the log finishes replaying and you have a sped up video of the whole thing, it's easy enough to use Avisynth script to get it back to a real-time log.
- The Java source code I wrote is at http://pastebin.com/bfWeUDdd
- If the timestamps in your log don't start like "(6:56:01" it will not parse the time correctly by default. The program also assumes you are using a 12-hour system.
- The Avisynth scripts:
- Before we can get into the actual script we will encode, we need to check to make sure the videos can be opened with FFMpegSource and note the total number of frames in each video, because we need that information in order to keep all the videos synced. This is the script I use to do both of those things: http://pastebin.com/Xt3rLjsQ
- LoadCPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ffms2.dll")
- #The first line is just loading the FFmpegSource plugin for Avisynth, since that is what can handle the xsplit/justin.tv files. You will need to download the plugin and throw it into your Avisynth plugins folder if you don't have it. In general, FFMS2 will be able to handle anything you throw at it and be frame accurate.
- Bite = FFmpegSource2("C:\Users\Administrator\Sharkstream\Bite06.flv", vtrack = -1, atrack = -1, fpsnum = 25)
- #This is assigning the video file we want to the variable “Bite”. We want to pass the argument “fpsnum=25” because xsplit is not great about keeping accurate fps metadata. Replace “25” with whatever fps your video is, by default Xsplit will record it at 25.
- Bite = Bite.FFInfo(vfrtime = false)
- #This is a debugging function to give us frame numbers when we play the Avisynth script in Media Player Classic (or any other media player that will open avisynth scripts.)
- Bite
- #This just returns “Bite” to the media player, making it play the video. You can just drag and drop an .avs script onto Media Player Classic to have it play. If it works, you will have some text in the top left of your video telling you some useful information. Total frame number is the most important, note it down somewhere for use in the real script.
- Sometimes a file will not work with FFmpegSource2, and you will get some red error text saying something like “CAVIStreamSynth: System exception – Access Violation at [memory address], reading from [memory address]”. When this happens, it means you need to remux the .flv file to an .mp4 in order for FFMS2 to stop having a fit. You can extract the streams from a .flv with FLV Extract from http://moitah.net/ and then use MeGUI's MP4 Muxer (hotkey: ctrl+5) to put the files extracted from the FLV into an MP4 (you will get a .264 and .aac file if it's an Xsplit video, if you don't need audio from the video you only need the .264 and not the .aac.)
- Once you make sure all your videos work with FFMS2 and you have the total frame numbers of each noted, you can move on to the real script which will be used to encode the video in MeGUI. This is the script I used for part 5: http://pastebin.com/226PXftV
- SetMemoryMax(2048)
- ##You probably don't need to use this, but in theory this will let Avisynth use more memory without crashing.
- LoadCPlugin("C:\Program Files (x86)\AviSynth 2.5\plugins\ffms2.dll")
- ##Loading in ffms2 again
- Bite = FFmpegSource2("C:\Users\Administrator\Sharkstream\Bite05.flv", vtrack = -1, atrack = -1, fpsnum = 25)
- #180136
- ##Bite's video has the sound track I want to use, so syncing will be based on it. 180136 is the number of frames the video is.
- Seal = FFVideoSource("C:\Users\Administrator\Sharkstream\Seal05.flv", fpsnum = 25).Trim(10087,179805)
- ##No other videos but Bite's will be using sound, so I can just use FFVideoSource for them. 10087 is the frame that Seal05.flv stopped on in the previous part, so it will start there and then continue on for 180136 frames in order to stay in sync with Bite. Seal05.flv is only 179805 frames though, so another video must be added on for the 10418 more frames needed. This one is an .mp4 because it was one of the videos that would not work without remuxing.
- Seal = Seal + FFVideoSource("C:\Users\Administrator\Sharkstream\Seal06.mp4", fpsnum = 25).Trim(0,10418)
- #169718
- ##This number is me noting down how many frames are actually being used from Seal05.flv
- Octary = FFVideoSource("C:\Users\Administrator\Sharkstream\Octary05.flv", fpsnum = 25, width=512,height=384).Trim(6428,180136)
- Octary = Octary + FFVideoSource("C:\Users\Administrator\Sharkstream\Octary06.mp4", fpsnum = 25, width=512,height=384).Trim(0,6428)
- #173708
- ##There is one difference here from Seal's. Octary's videos are all 400x300, and need to be resized to 512x384 so they can be stacked properly.
- ChatLog = FFVideoSource("C:\Users\Administrator\Sharkstream\ChatLog.flv", fpsnum = 50).AssumeFPS(2)
- ##fpsnum=50 will make Avisynth understand that the real framerate of the file is 50 (Xsplit's metadata will say the framerate is 1000 for some reason), and .AssumeFPS(2) will slow down the video to only play 2 frames per second, resulting in a 25 times longer video, which will make it the length we want, since it was 25 times faster before.
- ChatLog = ChatLog.ChangeFPS(25).Trim(720912, 901048)
- ##This will duplicate frames to make the framerate 25 without speeding up the video. This is done so that it can be combined with all the other videos properly.
- toprow=StackHorizontal(Bite,Seal)
- botrow=StackHorizontal(Octary,ChatLog)
- combined=stackvertical(toprow,botrow)
- ##This puts Bite and Seal into one row, Octary and the ChatLog into another, and then stacks them on top of eachother.
- combined
- ##Returns the full combined video. Try playing the .avs file in Media Player Classic to make sure it works when you're done.
- The MeGUI encoding:
- The encoding settings don't matter a whole lot since youtube will just encode it again, so just try to use settings that won't make you lose too much quality. The presets I use for encoding the Shark Stream are x264: x264goods and Nero AAC: gooduns224 that can be exported from http://www.wupload.com/file/2653871522/meguipresets.zip
- Throw your finished .avs script into the “Avisynth Script” field and then you can hit AutoEncode (select No Target Size in the menu that pops up and then hit Queue) to queue up encoding the audio and video and then muxing them. Once you have gotten the jobs queued up in the Queue tab, you will have to close MeGUI and then reopen it before starting the encoding, in order to make MeGUI stop using the memory it grabbed for queuing. If you don't do this and you are using long videos or a lot of videos, it is likely that MeGUI will crash on you due to using over 1.5GB of memory.
Add Comment
Please, Sign In to add comment