News:

--

Main Menu

Recent posts

#51
Avidemux Wiki / Re: How can I batch cut first ...
Last post by eumagga0x2a - May 30, 2025, 10:03:04 PM
Using internal Python-like scripting in Avidemux, you could do the following:

#PY  <- Needed to identify #
#
ui = Gui()
adm = Avidemux()
ed = Editor()
ext = "mp4"
outputs = ["MKV","MP4","MOV"]
sep = "/"
nbsek = 120
#
# Function to process an individual video
#
def convert(filein,outdir,outidx):
    if not adm.loadVideo(filein):
        ui.displayError("Oops","cannot load "+filein)
        return 0

    offset = nbsek * 1000 * 1000

    if ed.getVideoDuration() < offset:
        ui.displayError("Input too short", "Duration is shorter than " + str(int(nbsek)) + " seconds, skipping \"" + filein + "\"")
        return 0

    adm.markerA = offset

    adm.videoCodec("Copy")
    nbTracks = adm.audioTracksCount()
    if nbTracks > 0:
        adm.audioClearTracks()
        for track in range(nbTracks):
            adm.audioAddTrack(track)
            adm.audioCodec(track, "Copy")
    filename = (splitext(filein))[0]
    if outidx == 0:
        adm.setContainer("MKV", "forceAspectRatio=False", "displayWidth=1280", "displayAspectRatio=2", "addColourInfo=False", "colMatrixCoeff=2", "colRange=0", "colTransfer=2", "colPrimaries=2")
        filename += ".mkv"
    elif outidx == 1:
        adm.setContainer("MP4", "muxerType=0", "optimize=1", "forceAspectRatio=False", "aspectRatio=1", "displayWidth=1280", "rotation=0", "clockfreq=0")
        filename += ".mp4"
    elif outidx == 2:
        adm.setContainer("MOV", "muxerType=0", "optimize=1", "forceAspectRatio=False", "aspectRatio=1", "displayWidth=1280", "rotation=0", "clockfreq=0")
        filename += ".mov"
    else:
        ui.displayError("Error", "Invalid output preset index \"" + str(outidx) + "\"")
        return 0
    filename = basename(filename)
    return adm.save(outdir + sep + filename)
#
# Main
#
# -------- select extension, output format and offset --------
extensions = ["avi","m2ts","mkv","mov","mp4","mpg","ts","vob","webm"]
mxExt = len(extensions)

menuExt = DFMenu("Select extension:")
for entry in range(0, mxExt):
    menuExt.addItem(extensions[entry])

mxOut = len(outputs)

menuOut = DFMenu("Select output format:")
for entry in range(0, mxOut):
    menuOut.addItem(outputs[entry])

dialOffset = DFInteger("Select output start in seconds:", 0, 600)
dialOffset.value = nbsek

dia = DialogFactory("Configuration")
dia.addControl(menuExt)
dia.addControl(menuOut)
dia.addControl(dialOffset)
if not dia.show():
    return

idxExt = menuExt.index

if idxExt < 0 or idxExt >= mxExt:
    ui.displayError("Oops", "Internal error: invalid menu index")
    return

ext = extensions[idxExt]

idxOut = menuOut.index

if idxOut < 0 or idxOut >= mxOut:
    ui.displayError("Oops", "Internal error: invalid menu index")
    return

nbsek = dialOffset.value

# -------- select input directory --------
inputFolder = ui.dirSelect("Select source folder")
if inputFolder is None:
    ui.displayError("Error", "No source folder selected")
    return

# -------- read content --------
list = get_folder_content(inputFolder, ext)
if list is None:
    ui.displayError("Oops", "No " + ext + " files found in \"" + inputFolder + "\"")
    return

# -------- select output directory --------
outputFolder = ui.dirSelect("Select output folder")
if outputFolder is None:
    ui.displayError("Error", "No output folder selected")
    return

if(inputFolder == outputFolder):
    ui.displayError("Error","Output folder cannot be the same as the input one")
    return

# -------- process --------
total = 0
counter = 0

for i in list:
    total += 1
    counter += convert(i, outputFolder, idxOut)

if not counter:
    ui.displayInfo("Warning", "No files converted")
    return

if counter == 1:
    ui.displayInfo("Finished", "One file out of " + str(total) + " converted")
    return

ui.displayInfo("Finished", str(counter) + " files out of " + str(total) + " converted")

Save it as a text file with ".py" as extension. You might need to replace the value of sep with "\\" if you use Windows instead of *nix operating systems.

Avidemux will automatically seek to the last keyframe before the specified time offset (default value: 120 seconds = 2 minutes) when exporting the video. If you need more output formats than MKV, MP4 and MOV, you will need to extend the script accordingly. Please keep in mind that most output formats have some limitations regarding compatibility with particular video and audio codecs.
#52
Avidemux Wiki / How can I batch cut first minu...
Last post by Willoo - May 30, 2025, 11:32:15 AM
Hello

I would like to cut first 2 minute of multiple video files and keep the rest of those video without reencoding (using copy only)
How can I do that easily?

Thank you
#53
Main version 2.6 / Re: Save Selection As JPEG - Q...
Last post by FeRD_NYC - May 29, 2025, 04:05:11 PM
You know, not for nothing, but if the concern with adding a PNG-export feature is wanting to avoid growing avidemux's already-considerable number of menu options, there is a way to avoid that: The "Save as Image" submenu's painfully out-of-date "Save as BMP" option could be replaced with a "Save selection as PNG" feature, and avidemux would have exactly the same number of menu options it had before.  ;)
#54
Main version 2.6 / Re: swsResize problem
Last post by FeRD_NYC - May 29, 2025, 03:44:30 PM
Some time between almost-a-decade-ago and 2.8.2, this was fixed! swResize now successfully re-loads stored dimensions, when modifying an existing filter. Yay.
#55
Main version 2.6 / Re: select video track?
Last post by FeRD_NYC - May 29, 2025, 03:31:00 PM
For most video formats, you can probably use Handbrake to first extract the single video track (the one you want to edit with avidemux) from the multi-track file. It's an excellent transcoder / remuxer.
#56
Windows / Re: Avidemux can´t open my HEV...
Last post by a.dester - May 27, 2025, 09:41:33 AM
I want to share a similar problem, maybe the same of @misterr.

Avidemunx 2.8.2r250526 (Win x64) seems unable to open my Hikvision DVR HEVC recordings.
I attach admlog file and Mediainfo stream properties export file for further analysis.

Just for information, both VLC and integrated Windows media player open the file successfully.
#57
Main version 2.6 / Re: Avidemux 2.8.2 development
Last post by eumagga0x2a - May 26, 2025, 10:08:56 PM
Quote from: tropolite on May 14, 2025, 10:56:52 AMIs Windows version of Avidemux no longer being updated? I haven't seen any update since Dec '24.

Official native Windows nightly builds (built using Microsoft Visual Studio) from https://avidemux.org/nightly/vsWin64/ are back to being functional again starting with 250526. The only known new limitation: uninstall via Windows Settings does not work, at least on Windows 11, which is an upstream Qt installer bug. Use the link to the uninstaller in the start menu or navigate in Windows Explorer to Avidemux install directory and run the uninstaller from there.

The service of providing also official cross-compiled builds https://avidemux.org/nightly/win64 may or may not resume in the future.

Work on integration of important pull requests still stalled, hoping for more time to breathe later in June.
#58
Unix-Like (Linux/Bsd/...) / Re: 250516 nightly Intel av1 e...
Last post by eumagga0x2a - May 25, 2025, 01:08:05 PM
Will probably need to buy recent Intel hardware to be able to assess this problem and other known libva-related problems not existing on older Intel GPUs up to and including the 6th gen.
#59
Unix-Like (Linux/Bsd/...) / Re: 250323 nightly resize+av1 ...
Last post by eumagga0x2a - May 25, 2025, 12:03:07 PM
Quote from: upwithav1 on May 25, 2025, 09:10:03 AMI can confirm 250524 nightly completes libaom av1 + resize with no errors

Thank you for verifying the fix.

Quote from: upwithav1 on May 25, 2025, 09:10:03 AMintel av1 still not working

Fully expected, no changes in that area.
#60
Unix-Like (Linux/Bsd/...) / Re: 250516 nightly Intel av1 e...
Last post by upwithav1 - May 25, 2025, 09:16:22 AM
250524 nightly, Intel av1 still not working (first frame only in resulting file). Maybe focus was on fixing libaom preview first, anyway just reporting.

https://paste.debian.net/hidden/3ad9f243/