please can u help a cat?
however
consider, as example, this mkv file:
https://www.swisstransfer.com/d/35a45ca1-5123-460b-8d40-d295429aafe0
In Avidemux --> File -->Open --> c:\example.mkv
and then
from menu "File" --> "Project Script" --> "Save as Project" --> c:\example.py
This is the example.py opened with the notepad:
but now please consider only this line:Code:#PY <- Needed to identify # #--automatically built-- adm = Avidemux() if not adm.loadVideo("C:/example.mkv"): raise("Cannot load C:/example.mkv") adm.clearSegments() adm.addSegment(0, 120000, 4720000) adm.markerA = 0 adm.markerB = 4720000 adm.setHDRConfig(1, 1, 1, 1, 0) adm.videoCodec("Copy") adm.audioClearTracks() adm.setSourceTrackLanguage(0,"und") adm.setSourceTrackLanguage(1,"und") if adm.audioTotalTracksCount() <= 0: raise("Cannot add audio track 0, total tracks: " + str(adm.audioTotalTracksCount())) adm.audioAddTrack(0) adm.audioCodec(0, "copy") adm.audioSetDrc2(0, 0, 1, 0.001, 0.2, 1, 2, -12) adm.audioSetEq(0, 0, 0, 0, 0, 880, 5000) adm.audioSetChannelGains(0, 0, 0, 0, 0, 0, 0, 0, 0, 0) adm.audioSetChannelDelays(0, 0, 0, 0, 0, 0, 0, 0, 0, 0) adm.audioSetChannelRemap(0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8) adm.audioSetShift(0, 0, 0) if adm.audioTotalTracksCount() <= 1: raise("Cannot add audio track 1, total tracks: " + str(adm.audioTotalTracksCount())) adm.audioAddTrack(1) adm.audioCodec(1, "copy") adm.audioSetDrc2(1, 0, 1, 0.001, 0.2, 1, 2, -12) adm.audioSetEq(1, 0, 0, 0, 0, 880, 5000) adm.audioSetChannelGains(1, 0, 0, 0, 0, 0, 0, 0, 0, 0) adm.audioSetChannelDelays(1, 0, 0, 0, 0, 0, 0, 0, 0, 0) adm.audioSetChannelRemap(1, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8) adm.audioSetShift(1, 0, 0) adm.setContainer("MKV", "forceAspectRatio=False", "displayWidth=1280", "displayAspectRatio=2", "addColourInfo=False", "colMatrixCoeff=2", "colRange=0", "colTransfer=2", "colPrimaries=2")
so this value (4720000) is the "duration" of entire clip from start to end in Avidemux.Code:adm.markerB = 4720000
I wonder: is there a way to get this value with a batch procedure, but without having - every time for a single file - manually open Avidemux and --> "Open file" -->"Save project" --> open in notepad and get the value?
I mean: is there a way, with a batch, to automatic get the value (in this case is 4720000)
so the final result is:
?Code:4720000
OR
eventually: is there a way to execute in commandline something like:
[and save the project in a .py file] ?Code:avidemux.exe --load c:\example.mkv
My target is simple to get:
and not other.Code:4720000
thanks
+ Reply to Thread
Results 1 to 5 of 5
-
-
Just use ffprobe. It will get the duration in seconds:
Code:ffprobe.exe -v quiet -show_entries stream=duration -of default=noprint_wrappers=1:nokey=1 -select_streams v:0 %1 >duration.txt set /p duration=<duration.txt ffmpeg... b:v=DESIRED_STREAM_SIZE_IN_BYTES*8/%duration%...
-
mmm thanks but if I do, on c:\example.mkv
Code:rem if exist c:\duration.txt del c:\duration.txt rem ffprobe.exe -show_entries stream=duration -of default=noprint_wrappers=1:nokey=1 -select_streams v:0 "c:\example.mkv">c:\duration.txt rem
Code:N/A
thanks -
It appears you video stream has no time codes. Try using "format=duration" instead of "stream=duration".
-
Code:
if exist "%cd%\duration3.txt" del "%cd%\duration3.txt" ffprobe64bit2022.exe -v error -select_streams v:0 -show_entries format=duration -print_format default=nokey=1:noprint_wrappers=1 "c:\Volumes\tmp_whatsapp.avs\tmp_whatsapp.avi">"%cd%\duration3.txt" fart.exe -q "%cd%\duration3.txt" . --remove set /p AviDemuxDur=<duration3.txt
but please keep in mind the brain-cat-limited
so that usingCode:fart.exe -q "%cd%\duration3.txt" . --remove
Code:26560000
Code:26.560000
Similar Threads
-
Avidemux
By kelvin in forum Newbie / General discussionsReplies: 17Last Post: 11th May 2021, 14:27 -
Avidemux audio conversion question
By sycor in forum AudioReplies: 2Last Post: 28th Feb 2021, 16:15 -
Help is needed in avidemux
By D33 in forum Newbie / General discussionsReplies: 2Last Post: 30th Jul 2019, 10:15 -
Avidemux question
By ro2124 in forum Newbie / General discussionsReplies: 3Last Post: 17th Sep 2018, 00:19 -
Question about using Avidemux
By CM120884 in forum EditingReplies: 2Last Post: 11th Aug 2018, 04:18