VideoHelp Forum




+ Reply to Thread
Results 1 to 8 of 8
  1. I have recently been authoring a small program to auto-create avisynth code to splice together multiple video files that have each had the first and last few frames trimmed off of them. My avisynth abilities are only in the beginner state, however, and I am having problems with just the simple splicing. I have been using Virtual Mod to double check on everything.

    Basically I have multiple files that are in an h.264 format and I have been using DirectShowSource to load them. When I attempt to splice some of them however it causes some strange problems. One most demonstrative example that I have witnessed was just doing a test with 3 files. The videos for the beginning and last one played and rendered just fine, but the middle one was stuck on the first frame. Noticeably, the sound spliced correctly for all three.

    Thank You for any help you all might be able to give me, or any threads/articles you might be able to link me to.

    My avisynth version I think is the most up-to-date one.

    Thank You
    Quote Quote  
  2. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Post your Avisynth script.
    Quote Quote  
  3. Because I had been continuing to tweak everything, I did not have the same script as the example I had stated earlier.

    So I used my little program I had made to generate a small script which seems to be messed up. Sadly though parts of it work part of the time, and it was just confusing.

    I left the trim part in there in hopes of hitting two birds with one stone, as it seems to offset the audio a little leaving blank spots at the end of each subclip. Though that question does not necessarily have to be answered in this post.

    Code:
    clip=DirectShowSource("C:\Users\Adam\Videos\The_Fan_Film\VID00002.AVI")
    smallclip=DirectShowSource("C:\Users\Adam\Videos\The_Fan_Film\VID00003.AVI")
    smallclip=trim(smallclip,5,FrameCount(smallclip)-5,true)
    clip=clip++smallclip
    smallclip=DirectShowSource("C:\Users\Adam\Videos\The_Fan_Film\VID00004.AVI")
    smallclip=trim(smallclip,5,FrameCount(smallclip)-5,true)
    clip=clip++smallclip
    smallclip=DirectShowSource("C:\Users\Adam\Videos\The_Fan_Film\VID00008.AVI")
    smallclip=trim(smallclip,5,FrameCount(smallclip)-5,true)
    clip=clip++smallclip
    Return clip
    Currently clips 1,3, and 4 all play with sound, but the 2nd clip does not load the video.

    Because it seems to work in certain situations I think it may just be a rendering problem. As I said before I'm using VirtualMod to test this.
    Quote Quote  
  4. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    If the audio is VBR use
    EnsureVBRMP3sync()
    which does what it says. Otherwise you lose sync when doing any Trims or joins.

    You don't need "true" in the Trims, that's the default.

    Currently clips 1,3, and 4 all play with sound, but the 2nd clip does not load the video.
    I don't know which clips you mean here.

    You might try ffmpegsource2() instead of DirectShowSource.

    Though if you have ffdshow, it pretty much amounts to the same thing.
    Quote Quote  
  5. I don't know if the audio is VBR, but I will check.

    I meant that 2.avi, 4.avi, and 8.avi all played the video, whereas 3.avi did not.

    I had ffdshow installed, but I am not sure if everything is enabled correctly.

    And just now I installed the ffms2 plugin and put it into avisynth's directly. I also have the haali media splitter installed. For some reason though, even with the LoadPlugin, it is not recognizing the FFmpegSource2() function. I tried out FFvideoSource() and that at least loads (I've yet to know if my person problem would still be encountered). Do you know why it's not recognizing the function?

    Do I need to have ffdshow or Haali Media Splitter configured any special way or anything?

    Thank You for your assistance.
    Quote Quote  
  6. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by legocrazy1 View Post
    And just now I installed the ffms2 plugin and put it into avisynth's directly. I also have the haali media splitter installed. For some reason though, even with the LoadPlugin, it is not recognizing the FFmpegSource2() function. I tried out FFvideoSource() and that at least loads (I've yet to know if my person problem would still be encountered). Do you know why it's not recognizing the function?
    You also need to put ffms2.avsi in the plugins folder.
    FFmpegSource2 is actually a script function in ffms2.avsi which calls FFVideoSource and FFAudioSource as appropriate.
    Quote Quote  
  7. While away from an internet connection I was able to write the code with just the video/audio sources as separate, but I now have the FFmpegSource2 working properly also. So thank you very much. Everything is now working just fine.

    So if I'm going to be working with other avi formats, or other film formats in general, am I going to have to change which plugin it uses every time?
    Quote Quote  
  8. Member AlanHK's Avatar
    Join Date
    Apr 2006
    Location
    Hong Kong
    Search Comp PM
    Originally Posted by legocrazy1 View Post
    While away from an internet connection I was able to write the code with just the video/audio sources as separate, but I now have the FFmpegSource2 working properly also. So thank you very much. Everything is now working just fine.

    So if I'm going to be working with other avi formats, or other film formats in general, am I going to have to change which plugin it uses every time?
    There are several specialised "Source" filters.

    See http://avisynth.org/mediawiki/Importing_media
    Often several filters can open a media file, but there may be advantages in choosing one over the other -- as you've seen.

    DirectShowSource() can open most files, using your Windows codecs. But it can be inaccurate as to seeking to an exact frame. So take care when trimming.
    ffmeg2source can also open almost everything and is very robust. You'll notice it builds an index file the first time it is called on a file, once that's done it's pretty quick and accurate. So this might be a good choice if you wanted to choose one for your batch files to generate.

    AviSource() is the simplest though and I always try that first. Sometimes it doesn't give all the audio to the end of a video, so I first check that the audio and video length are the same (to within a second), using the Info command in VDub.
    Last edited by AlanHK; 14th Jul 2010 at 02:24.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!