VideoHelp Forum
+ Reply to Thread
Results 1 to 2 of 2
  1. Hello everyone. I need to add a logo.jpg and subtitle text to multiple videos ~ 400. And the way i need it to be is like when doing

    Avidemux > Video > filter > add logo
    i can then adjust position and transparancy. But it does not save untill i open another video..... And i cant seem to find a way to add subtitle like this

    [Attachment 79076 - Click to enlarge]

    Are there other softwares out there that could help me achieve this. Or is it possible to do batch/multiple videos all at once if i want the same logo and position for all videos. And the same subtitle text for all videos.
    Quote Quote  
  2. I lost an hour after reading your post... but I was curious myself... so now I at least understand the basics of it.

    Avidemux seems to require Sub Station Alpha subtitles. I know very little about them, so I used Subtitle Edit to create a single line SSA subtitle with a 5 hour duration. It looks like this (a text file with an ssa extension).

    [Script Info]
    ; This is a Sub Station Alpha v4 script.
    ScriptType: v4.00
    Collisions: Normal
    PlayDepth: 0
    [V4 Styles]
    Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding
    Style: Default,Arial,12.0,65535,65535,0,0,0,0,3,1,1,2,10,10,10,0,1
    Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
    Dialogue: Marked=0,0:00:00.00,5:00:00.00,*Default,NTP,0000,0000,0000,,This is the subtitle
    Avidemux batch encoding requires a python script and even the example on the Avidemux wiki was either outdated or wrong. I have just enough understanding of python to figure it out though.

    You need to configure a single encode with your desired filtering and encoder settings etc and save it as a project (File/Project Script/Save As Project). That script will contain the configuration info you'll need to copy to the template script below, replacing the contents between the Project Start and Project End lines. I'm on Linux but you'll need to change the relevant bits according to your file paths anyway. They're highlighted. This script will convert any files with an MKV extension in the specified folder. Unfortunately python enforces an infuriating indentation in scripts, so after you've pasted the relevant parts from the script you saved, you'll have to adjust the indentation to match the script below. When you're done the script needs to be saved with a py extension, and from there you can use the "File/Project Script" menu to run it for batch encoding, assuming it works, of course.

    After you've setup your project and saved it as a script there'll be a lot more individual settings for the x264 encoder, and probably other encoders too, and also settings for the audio configuration etc, but for this example I only kept the basic stuff.

    #PY  <- Needed to identify #
    # Convert files with an MKV extension in /media/NVME1/
    gui = Gui()
    adm = Avidemux()
    ext = "mkv"
    inputFolder = "/media/NVME1/"
    outputFolder = "/media/NVME2/"
    list = get_folder_content(inputFolder, ext)
    if(list is None): raise gui.displayError("File error", "Cannot load file")
    for i in list: convert(i)
    def convert(filein):
        if not adm.loadVideo(filein):
            raise gui.displayError("File error", "Cannot load file")
        # ---------- Project Start ------------
        adm.videoCodec("x264", "useAdvancedConfiguration=False", "general.params=CRF=20", "general.preset=medium", \
          "general.tuning=film", "general.profile=high")
        adm.addVideoFilter("addLogo", "x=45", "y=45", "alpha=255", "logoImageFile=/media/NVME1/Google.png", "fade=0", \
        adm.addVideoFilter("ssa", "font_scale=1.000000", "line_spacing=0.100000", \
          "subtitleFile=/media/NVME1/subtitle.ssa", "fontDirectory=/usr/share/fonts/truetype/", \
          "extractEmbeddedFonts=1", "topMargin=0", "bottomMargin=0", "displayAspectRatio=0")
        adm.setContainer("MKV", "forceAspectRatio=False", "displayWidth=1280", "displayAspectRatio=2", \
          "addColourInfo=False", "colMatrixCoeff=2", "colRange=0", "colTransfer=2", "colPrimaries=2")
        # ---------- Project End ------------
    + filein + ".converted.mkv")
    [Attachment 79173 - Click to enlarge]
    Last edited by hello_hello; 16th May 2024 at 19:09.
    Quote Quote  

Similar Threads

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