VideoHelp Forum




+ Reply to Thread
Results 1 to 10 of 10
  1. Hello. I'd like to change parameters of multiple AVI files at once to make them playable.
    My current workflow on single file:
    1. MPEG4Modifier - packed bitstream unpack
    2. MPEG4Modifier change user data (Writing library from something like DivX503b2682p to XviD0069
    3. Visual AVI FourCC Changer (https://sourceforge.net/projects/vsfccchanger/) - change fourCC - this works for all files

    And I know I can do steps 1 and 3, e.g with FFMPEG with stream copy, but I'm not sure how to automatize step 2

    this command did not change writing library:
    Code:
    ffmpeg -i input.avi -vtag XVID -bsf:v mpeg4_unpack_bframes -c:v copy -c:a copy output.avi
    Quote Quote  
  2. Originally Posted by SmurfRecorder View Post
    Hello. I'd like to change parameters of multiple AVI files at once to make them playable.
    My current workflow on single file:
    1. MPEG4Modifier - packed bitstream unpack
    2. MPEG4Modifier change user data (Writing library from something like DivX503b2682p to XviD0069
    3. Visual AVI FourCC Changer (https://sourceforge.net/projects/vsfccchanger/) - change fourCC - this works for all files

    And I know I can do steps 1 and 3, e.g with FFMPEG with stream copy, but I'm not sure how to automatize step 2

    this command did not change writing library:
    Code:
    ffmpeg -i input.avi -vtag XVID -bsf:v mpeg4_unpack_bframes -c:v copy -c:a copy output.avi
    Try instead this single commandline:
    Code:
    ffmpeg -i source.avi -c copy -bsf:v mpeg4_unpack_bframes -vtag FMP4 source_fixed.avi
    Quote Quote  
  3. But this just change fourCC not "writing library"
    after that command ffmpeg Mediainfo shows:
    Code:
    Codec ID                                 : FMP4
    Writing library                          : DivX 2682
    when editing with MPEG4Modifier I get
    Code:
    Writing library                          : XviD 69
    And this file works correctly for me
    Quote Quote  
  4. Originally Posted by SmurfRecorder View Post
    But this just change fourCC not "writing library"
    after that command ffmpeg Mediainfo shows:
    Code:
    Codec ID                                 : FMP4
    Writing library                          : DivX 2682
    OK, but this file is playable or not?

    when editing with MPEG4Modifier I get
    Code:
    Writing library                          : XviD 69
    And this file works correctly for me
    The “writing library” is just an information tag and should not affect the video's playback
    Quote Quote  
  5. Unfortunately the file is unplayable until I change writing library... This is LG Oled 4k TV bought about 2021.
    Quote Quote  
  6. I worked on this & part of the problem is the .avi container.
    It has limits on what can be written to in it's metadata.
    I was never able to get the metadata to accept "Writing library".
    What I got was "Writing application" in MediaInfo.

    Give this code a try:
    Code:
    ffmpeg -i input.avi -flags +bitexact -fflags +bitexact -map_metadata -1 -metadata:g "ISFT=XviD 69" -metadata:g "encoding_tool=XviD 69" -metadata title="movie name" -c copy output.avi
    Quote Quote  
  7. Sorry, it doesn’t work, but thanks anyway Xvid and Avi is very annoing format

    I also noticed that some files have doubled entries for writing library. Second is invisible for MediaInfo but TV refuses to play...
    I don't know what (and why) LG TV manufacturer did to their software...

    MPEG4Modifier is the only fix that works, but unfortunately CLI version has very limited arguments
    Image
    [Attachment 92676 - Click to enlarge]
    Last edited by SmurfRecorder; 13th Jun 2026 at 13:38.
    Quote Quote  
  8. Another approach:
    Try simply remuxing the AVI video into an MP4.
    Code:
    ffmpeg -i input.avi  -c copy output.mp4
    Does the MP4 video play on your LG TV?
    Quote Quote  
  9. Tried both MP4 and MKV. Both don't play when remuxed with DIVX writing library.
    But if I mod file with MPEG4Modifier then remux, both formats play
    Quote Quote  
  10. I finally found the way to batch change that writing library:
    I made my first AutoHotkey script to control MPEG4 Modifier GUI
    (with with a little help from AI and with AHK documentation)

    mpeg4mod_run.ahk - for AutoHotkey v2
    Code:
    ;---------run MPEG4 Modifier to unpack packed bitstream and remove Writing Library user data ----------------
    ;    usage:
    ;    AutoHotkey64.exe MPEG4Modifier_batch input_file.avi output_file.avi codec_code
    ;    run this with batch file inside loop
    ;-------------------------------------------------------------------------------------
    MPEG4Modifier_exe:="D:\Prg\MPEG4Modifier.exe"
    
    inp_file := A_Args[1]
    out_file := inp_file . "_xvid"
    if A_Args.Length >= 2
        out_file := A_Args[2]
    
    codec_code := "XviD0069"
    if A_Args.Length >= 3
        codec_code := A_Args[3]  
        
    mouse_spd:=10   
    if A_Args.Length >= 4 
        mouse_spd:=A_Args[4]
    
    SendMode "Event"
    SetTitleMatchMode "RegEx"
    
    ;---------control exist function--------------
    ControlExist(Control, WinTitle:="", WinText:="", ExcludeTitle:="", ExcludeText:=""){
        try 
            return ControlGetHwnd(Control, WinTitle, WinText, ExcludeTitle, ExcludeText)
        catch 
            return false
    }
    
    MouseMoveToControl(control, window, speed := 20) {
          ControlGetPos(&x, &y, &w, &h, control, window)
          MouseMove(x + w/2, y + h/2, speed)
    }
    
    ;--------close all running windows of MPEG4Modifier------------
    for hwnd in WinGetList("MPEG4 Modifier")
        WinClose("ahk_id " hwnd)
    
    
    
    ;only argument supported y MPEG4Modifier is input file
    Run(MPEG4Modifier_exe ' "' inp_file '"')
    
    WinWaitActive("MPEG4 Modifier")
    
    ;------- wait until loading finish or close when error ------------
    Loop {
        ; --- ERROR ---
        if WinWait("Error",, 0.03) { 
            msg := WinGetText("Error")
            FileAppend( msg, out_file ".ERROR.txt")
            MouseMoveToControl("OK", "Error", mouse_spd)
            Sleep 150
            ControlClick("OK", "Error")
            WinClose("MPEG4 Modifier")
            ExitApp
        }
        ; --- LOADING ---
        if WinWait(" - Loading",, 0.03) {
            WinWaitClose(" - Loading")
            break
        }
    
        Sleep 1
    }
    
    
    
    ;BlockInput("MouseMove")
    ;SetControlDelay 250
    
    Sleep(200)
    
    
    ;---check video info------
    MouseMoveToControl("Video Info", "MPEG4 Modifier",mouse_spd)
    
    ControlClick("Video Info", "MPEG4 Modifier")
    WinWaitActive("Video Information")
    Sleep(200)
    txt := WinGetText("Video Information")
    if InStr(txt, "Packed bitstream:  Yes") 
        packed:=true
    else 
        packed:=false
    WinClose("Video Information")
    WinWaitClose("Video Information")
    Sleep(200)
    
     
    ;---------checkbox to unpack user data------------------
    if ControlExist("Unpack", "MPEG4 Modifier"){
        MouseMoveToControl("Unpack", "MPEG4 Modifier",mouse_spd)
        if  packed==true
            ControlSetChecked(1, "Unpack", "MPEG4 Modifier")
        else
            ControlSetChecked(0, "Pack", "MPEG4 Modifier")
    }
    Sleep(200)
    ;---------disable auto user-data------------------
    if ControlExist("Auto", "MPEG4 Modifier") {
        MouseMoveToControl("Auto", "MPEG4 Modifier",mouse_spd)
        ControlSetChecked(0, "Auto", "MPEG4 Modifier")
    }
    Sleep(200)
    
    list:=""
    ;----- find listbox with codec user data ----------
    for i in WinGetControls("MPEG4 Modifier")
        if InStr(i, "LISTBOX",false) {
            list := i
            break
        }
    xvid_found:=false 
    ;----- remove all writing library user data codes ----------
    if ControlExist(list, "MPEG4 Modifier") {
        items := ControlGetItems(list, "MPEG4 Modifier")
        count := items.Length
        Loop count {
            guiIndex := count - A_Index + 1
            text := items[guiIndex]
            ControlChooseIndex(guiIndex, list, "MPEG4 Modifier")
            if RegExMatch(text, "i)divx") {
                MouseMoveToControl("i)^\s*\-\s*$", "MPEG4 Modifier", mouse_spd)
                ControlClick("i)^\s*\-\s*$", "MPEG4 Modifier")
            }
            if RegExMatch(text, "i)xvid") 
                xvid_found:=true
           sleep(100)
        }
    }
    ;---------------
    if xvid_found==true 
        goto xvid_found_skip
    ;---------------
    
    MouseMoveToControl("i)^\s*\+\s*$", "MPEG4 Modifier",mouse_spd)
    ControlClick("i)^\s*\+\s*$", "MPEG4 Modifier")
    WinWaitActive("Add User Data")
    
    ; ------  set codec writing library to xvid -----------
    codec_code := "XviD0069"
    
    editCtrl := ""
    for c in WinGetControls("Add User Data"){
        if InStr(c, "WindowsForms10.EDIT"){
            editCtrl := c
            break
            }
    }
    
    ControlSetText(codec_code, editCtrl, "Add User Data")
    MouseMoveToControl("OK", "Add User Data",mouse_spd)
    sleep (500)
    ControlClick("OK", "Add User Data")
    WinWaitClose("Add User Data")
    ;---------------
    xvid_found_skip:
    ;---------------
    
    ; --------delete output file if exists (move to trash-----------
    if FileExist(out_file){
      FileRecycle(out_file)
      }
    
    
    ; ------ save output file -------------
    MouseMoveToControl("Save","MPEG4 Modifier",mouse_spd)
    ControlClick("Save","MPEG4 Modifier")
    WinWaitActive("Destination Video")
    MouseMoveToControl("Button2","Destination Video",mouse_spd)
    ControlSetText('"' . out_file . '"', "Edit1", "Destination Video")
    
    sleep(500)
    
    ;button2 should be Save button (check with WindowSpy.ahk)
    ControlClick("Button2","Destination Video") 
    ;------- wait until loading finish ------------
    WinWait("i) - Saving")
    WinWaitClose("i) - Saving")
    sleep 200
    
    WinClose("MPEG4 Modifier")
    sleep 200
    and batch run with
    mpeg4mod_batch.bat

    Code:
    @echo off
    chcp 65001 >nul
    REM (Attention! don't end paths with backslash, eg C:\dir not C:\dir\ )-
    REM --- source dir ---
    set "SRC=E:\videos"
    rem set "SRC=%~dp0"
    
    REM --- dest dir--
    set "DST=R:" 
    rem set "SRC=%~dp0"
    
    REM --- set codec code - xvid/divx writing library--
    set "CODE=XviD0069"
    
    REM --- AutoHotkey v2 ---
    set "AHK=D:\ahk\AutoHotkey64.exe"
    REM --- AutoHotkey mouse move speed ---
    set "SPD=10"
    
    for %%F in ("%SRC%\*.avi" "%SRC%\*.divx") do (
        echo %%F
        echo  "%DST%\%%~nF.avi"
       "%AHK%" mpeg4mod_run.ahk "%%~fF" "%DST%\%%~nF.avi" "%CODE%" "%SPD%
    )
    
    echo ok
    pause
    Then use Visual Avi FourCC (https://sourceforge.net/projects/vsfccchanger/) changer which has batch processing support and change to XVID.
    And all files plays fine (unless they are not encoded with GMC)
    Last edited by SmurfRecorder; 20th Jun 2026 at 08:34.
    Quote Quote  



Similar Threads

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