VideoHelp Forum




+ Reply to Thread
Results 1 to 2 of 2
  1. Member
    Join Date
    Apr 2005
    Location
    SouthNJ USA
    Search Comp PM
    I'm using xvid4psp to convert a group of mkv's into mp4's.
    I think the problem has to do with xvid4psp automatically changing the framerate from source 29.9 to 23.9.
    I've found a long way to remedy the problem by editing the avisynth script but its a hastle.

    This is what i do:
    1. open all files in xvid4psp
    2. Set each individual sub file
    3. save each avisynth .avs file
    4. copy the temp directory to another temp folder (program auto deletes cache)
    5. close all files, xfer back cache
    6. out of each avs file delete the "changefps(23..9)"
    7. encode and everything is ohk

    What doesn't exactly make sense is the "changefps" command doesn't show up until i open the avs into the program.
    Is there any way i can save myself time? Thanks for your help guys.
    Quote Quote  
  2. Member
    Join Date
    Jan 2009
    Location
    United States
    Search Comp PM
    Well, you could do it with command line and batch scripts.

    1. Download x264.
    2. Download mp4box (can also use mp4creator)
    3. Download eac3to
    4. Create the following scripts (modify to your need):

    avs_generation.bat (modify paths to match your setup) - this will create the same avs script for all .mkv in directory (each with name of .mkv file)
    Code:
    FOR %%A IN (*.mkv) DO (
      ECHO import("C:\Program Files\Winnydows\XviD4PSP5\dlls\AviSynth\functions\AudioFunctions.avs"^)
      ECHO import("C:\Program Files\Winnydows\XviD4PSP5\dlls\AviSynth\functions\VideoFunctions.avs"^)
      ECHO loadplugin("C:\Program Files\Winnydows:\XviD4PSP5\apps\DGMPGDec\DGDecode.dll"^)
      ECHO loadplugin("C:\Program Files\Winnydows:\XviD4PSP5\dlls\AviSynth\plugins\vsfilter.dll"^)
      ECHO loadplugin("C:\Program Files\Winnydows:\XviD4PSP5\dlls\AviSynth\plugins\ffms2.dll"^)
      ECHO FFMPEGSource2("%%A"^)
      ECHO Add any filters that you are trying to use here (just copy avs generated by XVID4PSP and add ECHO before each line and ^ before closing parentheses, make sure to include import functions above)
      ECHO TextSub("%%A.srt"^) <--- Use Vobsub("%%A.idx") if you are trying hardsub DVD bitmaps
    )> %%~nA.avs
    x264_encode.bat - this will encode all .avs file in directory with the same settings
    Code:
    setlocal
    set x264="Path\To\x264.exe"
    set mp4box="Path\To\mp4box.exe"
    set eac3to="Path\To\eac3to.exe"
    
    FOR %%A IN (*.avs) DO (
    %x264% -crf 18 --sar 1:1 -o %%~nA.264 %%A
    %eac3to% %%~nA.mkv %%~nA.ac3
    %mp4box% -add %%~nA.ac3 -add %%~nA.264 -fps 29.97 %%~nA.mp4
    )
    The encoding with x264 here is pretty basic. It will use the default profile at CRF 18 which is usually considered transparent (visually identical to original) and define the pixels to be square. If you want a more efficient stream, you can run x264 --fullhelp to get a list of the switches and settings that can be used (higher encoding efficiency means longer encode times). MeWiki is a good source for understanding the x264 settings.

    I normally mux video and audio separately, but there are ways to do this all within the avisynth script (FFMPEGSource2 can be used with atrack=-1 to include audio). I will leave that to others to help you with since I don't do it and cannot tell you the proper way to do it. You can also look to see how XVID4PSP does it and copy that in the avs script.[IMG]chrome://dictionarytip/skin/dtipIconHover.png[/IMG]
    Quote Quote  



Similar Threads

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