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: 
 
 Of course, you should already know how to do this as you've done similar things before.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 
 
 duration.txt is: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 
 how can it be?Code:N/A 
 thanks
- 
	It appears you video stream has no time codes. Try using "format=duration" instead of "stream=duration". 
- 
	ah wowCode: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 usingso for example i getCode:fart.exe -q "%cd%\duration3.txt" . --remove fromCode:26560000 is a vulgarity but however seems to worksCode:26.560000   
Similar Threads
- 
  AvidemuxBy kelvin in forum Newbie / General discussionsReplies: 17Last Post: 11th May 2021, 15:27
- 
  Avidemux audio conversion questionBy sycor in forum AudioReplies: 2Last Post: 28th Feb 2021, 17:15
- 
  Help is needed in avidemuxBy D33 in forum Newbie / General discussionsReplies: 2Last Post: 30th Jul 2019, 11:15
- 
  Avidemux questionBy ro2124 in forum Newbie / General discussionsReplies: 3Last Post: 17th Sep 2018, 01:19
- 
  Question about using AvidemuxBy CM120884 in forum EditingReplies: 2Last Post: 11th Aug 2018, 05:18


 
		
		 View Profile
				View Profile
			 View Forum Posts
				View Forum Posts
			 Private Message
				Private Message
			 
 
			
			

 Quote
 Quote 
 
			
			
