Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: isidroco on June 22, 2018, 03:52:49 AM

Title: Can't use avidemux_cli command line or batch
Post by: isidroco on June 22, 2018, 03:52:49 AM
I need to extract audio using this command (in windows):
c:\DVD\Avidemux\avidemux_cli.exe h:\VIDEOS\x.avi --save-raw-audio h:\VIDEOS\x.mp3
which (incorrectly) generates a 768 bytes file

Command works correctly if x.avi is located in Avidemux folder:
c:\DVD\Avidemux\avidemux_cli.exe x.avi --save-raw-audio x.mp3

Final messages of wrong run are:

[A_saveAudioCopy] 03:27:59-046 duration 00:00:37,404
[saveAudio]Duration:1795.393536 ms
[saveAudio]Samples:1795393 ms
[A_saveAudioCommon] 03:27:59-062
wanted 1795393 samples, goto 0 samples, written 1152 bytes
*
* Automation ended*
End of program..
*
[save] 03:27:59-109 Saving prefs to C:\Documents and Settings\z\Datos de programa\avidemux\confi
g3.tmp
[destroy] 03:27:59-109 Destroying preview
[deleteAll] 03:27:59-109 [Editor] Deleting all videos
[lavc] Destroyed
[close] 03:27:59-109 [Avi] Closing...
[~ADM_aviAudioAccess] 03:27:59-109 Deleting audio track from avi
[close] 03:27:59-109 [Avi] Closing...
[~ADM_edAudioTrackFromVideo] 03:27:59-109 Destroying edAudio from video track 0 at 1a205b8
[cleanup] 03:27:59-109 Deleting post proc
[deleteAll] 03:27:59-125 [Editor] Deleting all videos
Normal exit
[abortExitHandler] 03:27:59-125 already done, nothing to do

Title: Re: Can't use avidemux_cli command line or batch
Post by: Jan Gruuthuse on June 22, 2018, 05:18:03 AM
Due to command line restrictions, path I believe?
Think path and file needs to be quoted (string).
c:\DVD\Avidemux\avidemux_cli.exe "h:\VIDEOS\x.avi" --save-raw-audio "h:\VIDEOS\x.mp3"
Title: Re: Can't use avidemux_cli command line or batch
Post by: isidroco on June 23, 2018, 12:55:49 AM
After some experiments, this works:
c:\DVD\Avidemux\avidemux_cli.exe --load x.avi --save-raw-audio h:\VIDEOS\16_VIDEOS_USA_2016\w\x.mp3

this doesn't:
c:\DVD\Avidemux\avidemux_cli.exe --load c:\DVD\Aviemux\x.avi --save-raw-audio h:\VIDEOS\16_VIDEOS_USA_2016\w\x.mp3

* Quotes are only necessary if spaces are present on path/filename and in my example gives same result adding them or not.
* Please notice that x.avi is placed on Avidemux directory, if path is specified it stops working even in same place as before.
Couldn't make it work outside avidemux dir.
Title: Re: Can't use avidemux_cli command line or batch
Post by: Jan Gruuthuse on June 23, 2018, 06:41:46 AM
Quote from: isidroco on June 23, 2018, 12:55:49 AM
this doesn't:
c:\DVD\Avidemux\avidemux_cli.exe --load c:\DVD\Aviemux\x.avi --save-raw-audio h:\VIDEOS\16_VIDEOS_USA_2016\w\x.mp3
If this was copy/paste then it can't work: typo

- command path should include path to avidemux exe's, can be called from anywhere within windows.
- probably more issues going on, like user (windows) restrictions where you can write or not on your system drive, ...
Title: Re: Can't use avidemux_cli command line or batch
Post by: isidroco on June 23, 2018, 01:56:26 PM
Jan, Thanks for your input. Unfortunately I misstyped here. Command when doesn't work generates a 768bytes empty mp3 instead of the correct +1mb file. It's not a permissions problem because file is generated, and I'm using win XP in a FAT32 partition with full access to all folders (FAT32 doesn't have permissions).
Will try in another win7 pc.
Title: Re: Can't use avidemux_cli command line or batch
Post by: Jan Gruuthuse on June 23, 2018, 04:13:36 PM
OK try
- with GUI: replace avidemux_cli.exe with avidemux.exe perhaps more info will pop-up.
- in batch file place echo in front of instruction line perhaps something will show on command prompt?
echo c:\DVD\Avidemux\avidemux_cli.exe  --load x.avi --save-raw-audio x.mp3

fat32 has 2GB size limitation
Title: Re: Can't use avidemux_cli command line or batch
Post by: isidroco on June 23, 2018, 06:52:08 PM
All my experiments are done out of batch. (Command line).
Can confirm that problem does NOT occur on win7 x32. Unfortunately I need this working on xp,  :(

System and avidemux drive is fat32, rest of units are ntfs. But as I said: imposible to be permission problem here.

Attached w7/xp log files from individual experiment, and my batch to extract audio from all videos on a folder which works on win7 and not on winxp due to avidemux bug.

PS: REM on line 111 must be removed

PS2: Annoyance, process is stopped to ask Y/N here (is there a way to skip and answer NO on these cases?):
* Question *
* This video contains B-frames, but presentation time stamps (PTS) are either missing or monotonically increasing. Avidemux can try to reconstruct correct PTS by decoding the entire video. This may take a lot of time. Proceed? *
**
Yes or No (Y/y or N/n) :

Title: Re: Can't use avidemux_cli command line or batch
Post by: Jan Gruuthuse on June 24, 2018, 04:49:47 AM
Quote from: isidroco on June 23, 2018, 06:52:08 PM
PS2: Annoyance, process is stopped to ask Y/N here (is there a way to skip and answer NO on these cases?):
* Question *
* This video contains B-frames, but presentation time stamps (PTS) are either missing or monotonically increasing. Avidemux can try to reconstruct correct PTS by decoding the entire video. This may take a lot of time. Proceed? *
**
Yes or No (Y/y or N/n) :
Is this now because you're using the avidmux.exe GUI? Was only meant for for testing. Switch back to avidemux_cli.exe.

Otherwise redirection from a file. Like a reply: Yes or No or Enter (https://avidemux.org/smif/index.php/topic,17727.msg80633.html#msg80633)
Title: Re: Can't use avidemux_cli command line or batch
Post by: Jan Gruuthuse on June 24, 2018, 05:33:56 AM
- 32-bit is (maybe) no longer supported
- XP is EOL and no longer supported
Title: Re: Can't use avidemux_cli command line or batch
Post by: eumagga0x2a on June 24, 2018, 09:08:43 AM
At the first glance, the problem seems to be located in the AVI (OpenDml) demuxer.

32 bit is supported, Windows XP is not (cannot even test), but Mean might have a VM somewhere and, more importantly, knowledge of its quirks and limitations. A sample would be nice anyway.
Title: Re: Can't use avidemux_cli command line or batch
Post by: eumagga0x2a on June 24, 2018, 10:14:28 AM
Maybe it is related to https://github.com/mean00/avidemux2/blob/master/avidemux_plugins/ADM_demuxers/OpenDml/ADM_odml_audio.cpp#L117 (https://github.com/mean00/avidemux2/blob/master/avidemux_plugins/ADM_demuxers/OpenDml/ADM_odml_audio.cpp#L117) ("r" vs "rb" mode for fopen), maybe not. Difficult to tell with nothing but a smartphone.