Help for script & Debian 9 Compile.

Started by liberodark, May 30, 2020, 09:23:48 AM

Previous topic - Next topic

liberodark

Hi,

I would like to defer the configuration of conversion from GUI to command line.



Project Export :


adm = Avidemux()
adm.loadVideo("/home/pc/Téléchargements/Move/Jurassic Park.mkv")
adm.clearSegments()
adm.addSegment(0, 0, 7596605832)
adm.markerA = 0
adm.markerB = 7596605832
adm.setPostProc(3, 3, 0)
adm.videoCodec("Copy")
adm.audioClearTracks()
adm.setSourceTrackLanguage(0,"fre")
adm.setSourceTrackLanguage(1,"eng")
adm.setSourceTrackLanguage(2,"fre")
adm.audioAddTrack(0)
adm.audioCodec(0, "Faac", "bitrate=128");
adm.audioSetDrc(0, 0)
adm.audioSetShift(0, 0, 0)
adm.audioAddTrack(1)
adm.audioCodec(1, "copy");
adm.audioSetDrc(1, 0)
adm.audioSetShift(1, 0, 0)
adm.audioAddTrack(2)
adm.audioCodec(2, "copy");
adm.audioSetDrc(2, 0)
adm.audioSetShift(2, 0, 0)
adm.setContainer("MP4V2", "optimize=0", "add_itunes_metadata=0")


My command line :


video_codec="Copy"
audio_codec="Faac"
audio_bitrate="128"
output_format="MP4V2"
avidemux3_cli --video-codec "$video_codec" --audio-codec "$audio_codec" --audio-bitrate "$audio_bitrate" --load "$file" --output-format "$output_format" --save "${file%.*}.mp4" --quit


Have make many tests but in GUI my conversion is work better than bash.
And i not found correct command line.
Have read the doc but nothing...
I want to manage to do the same conversion in cli.
If you have information about what I miss on the command line?

Best Regards

eumagga0x2a

First of all, it is better to use the MP4 muxer in a current Avidemux build instead of the legacy MP4v2 one. Additionally, Faac is maybe the fastest but quality-wise the worst of available AAC encoders.

In your project, you re-encode the first audio track leaving the two others in copy mode. Is it done intentionally?

Regarding the command line, the option "--audio-bitrate" doesn't exist. It is just that 128 kbit/s is the default value for Faac.

The "--load" option should also come first as preceding options may be discarded by a subsequent loading of a video.

Generally, I'd suggest putting the codec and audio track configuration into a project script file while leaving out file load and segment layout and execute the script by the "--run" option after the input has been loaded by "--load".

QuoteHave make many tests but in GUI my conversion is work better than bash.

In which sense? Hardware acceleration and some filters are not available in the CLI version, but you are not using in your example anything which would not work on command line.

liberodark

Ok and that is better ?


video_codec="Copy"
audio_codec="LavAAC"
output_format="MP4"
avidemux3_cli --load "$file" --video-codec "$video_codec" --audio-codec "$audio_codec" --set-audio-language 0 --output-format "$output_format" --save "${file%.*}.mp4" --quit

eumagga0x2a

"--set-audio-language" requires two arguments, you probably should set language also for audio tracks 1 and 2, not just for 0. You should use Avidemux built from the current git master for the best experience with the MP4 muxer (to be clear, timestamp rounding was broken, resulting in timing jitter, and fixed in the late autumn, and time base handling was greatly improved during the winter).

liberodark

Have 2.7.4
But i need to compile 2.7.4 for Debian 9 too

eumagga0x2a

2.7.4 is very old.

(Very old code-wise, I am aware that we didn't make a release since then.)

liberodark

#6
You have github link or source link ?

have found this : https://github.com/mean00/avidemux2 is a good repo ?

Ok have fixe sound and video issue with this :

video_codec="h264"
audio_codec="LavAAC"
output_format="MP4"
avidemux3_cli --load "$file" --output-format "$output_format" --video-codec "$video_codec" --audio-codec "$audio_codec" --save "${file%.*}.mp4" --quit


But have error on build :

run : bash bootStrap.bash --deb --with-cli


-- Found GNU Make

-- Configuring FFmpeg
CMake Error at /home/admin/avidemux2/cmake/admFFmpegBuild_helpers.cmake:282 (MESSAGE):
  configure returned <1>
Call Stack (most recent call first):
  /home/admin/avidemux2/cmake/admFFmpegBuild_native.cmake:57 (ADM_FF_BUILD_UNIX_STYLE)
  /home/admin/avidemux2/cmake/admFFmpegBuild.cmake:16 (include)
  CMakeLists.txt:94 (include)


CMake Error at /home/admin/avidemux2/cmake/admFFmpegBuild_helpers.cmake:283 (MESSAGE):
  configure output is <nasm/yasm not found or too old.  Use --disable-x86asm
  for a crippled build.

 

  If you think configure made a mistake, make sure you are using the latest

  version from Git.  If the latest version fails, report the problem to the

  mailing list or IRC #ffmpeg on irc.freenode.net.

  Include the log file "ffbuild/config.log" produced by configure as this
  will help

  solve the problem.

  >
Call Stack (most recent call first):
  /home/admin/avidemux2/cmake/admFFmpegBuild_native.cmake:57 (ADM_FF_BUILD_UNIX_STYLE)
  /home/admin/avidemux2/cmake/admFFmpegBuild.cmake:16 (include)
  CMakeLists.txt:94 (include)


CMake Error at /home/admin/avidemux2/cmake/admFFmpegBuild_helpers.cmake:284 (MESSAGE):
  An error occured
Call Stack (most recent call first):
  /home/admin/avidemux2/cmake/admFFmpegBuild_native.cmake:57 (ADM_FF_BUILD_UNIX_STYLE)
  /home/admin/avidemux2/cmake/admFFmpegBuild.cmake:16 (include)
  CMakeLists.txt:94 (include)


-- Configuring incomplete, errors occurred!
See also "/home/admin/avidemux2/buildCore/CMakeFiles/CMakeOutput.log".
** Failed at cmakeZ**

eumagga0x2a

Quote from: liberodark on May 30, 2020, 12:16:40 PM
have found this : https://github.com/mean00/avidemux2 is a good repo ?

Yes, it is the official one.

QuoteOk have fixe sound and video issue with this :

video_codec="h264"
audio_codec="LavAAC"
output_format="MP4"
avidemux3_cli --load "$file" --output-format "$output_format" --video-codec "$video_codec" --audio-codec "$audio_codec" --save "${file%.*}.mp4" --quit

"h264" is invalid. What sort of sound and video issue did you experience?

Anyway, it is pretty pointless to try to troubleshoot 2.7.4.

QuoteBut have error on build :

run : bash bootStrap.bash --deb --with-cli

Omit "--with-*", it is the default. You must install build dependencies first. If you can't use https://github.com/mean00/avidemux2/blob/master/createDebFromSourceUbuntu.bash directly, install them manually.

liberodark

The sound and video issue is not in my PC.
Is in Streama a web mediacenter only accept to play mp4.

Now is fix have improve audio quality too with (FDK_AAC) :


video_codec="h264"
audio_codec="FDK_AAC"
output_format="MP4"
avidemux3_cli --load "$file" --output-format "$output_format" --video-codec "$video_codec" --audio-codec "$audio_codec" --save "${file%.*}.mp4" --quit

eumagga0x2a

As stated above, "h264" is invalid as encoder name.

For doing anything MP4, please use the current git.

liberodark

#10
Im try to build from git now !

What is list of compatible encoder ?


On build have this error :


CMake Error at CMakeLists.txt:214 (ADD_SUBDIRECTORY):
  The source directory

    /home/admin/avidemux2/avidemux/qt4/i18n

  does not contain a CMakeLists.txt file.



**************************
***  Optional Library  ***
***      Summary       ***
**************************
*** Video Encoder      ***
    NVENC          No
*** Miscellaneous      ***
    gettext        Yes
    SDL            No
    XVideo         Yes
    OpenGL         Yes
**************************
***   Release Build    ***
**************************

-- Packager=deb, valid choices= {deb,rpm,tgz,none}

-- Configuring incomplete, errors occurred!
See also "/home/admin/avidemux2/buildQt5/CMakeFiles/CMakeOutput.log".
** Failed at cmakeZ**


But only need cli version not gui

eumagga0x2a

If you have no other choice but re-encode the video, then to encode as H.264 you would use "x264" for encoding in software.

Depending on your hardware and graphics driver, it might be possible to use a hardware accelerated encoder with the GUI version instead.

liberodark

#12
Have two deb created is avidemux3-core-2.7.5-200530-runtime and avidemux3-core-2.7.5-200530-dev

but not have avidemux cli ...

Im trying other compile : bash bootStrap.bash --deb --without-qt --with-cli

eumagga0x2a

Quote from: liberodark on May 30, 2020, 01:19:10 PM
On build have this error :


CMake Error at CMakeLists.txt:214 (ADD_SUBDIRECTORY):
  The source directory

    /home/admin/avidemux2/avidemux/qt4/i18n

  does not contain a CMakeLists.txt file.

You've skipped https://avidemux.org/smif/index.php/topic,18371.msg87089.html#msg87089

QuoteBut only need cli version not gui

I don't know whether this is a good idea as you would lose a lot of plugins, but "--without-qt" should do the trick.

liberodark

Is for a server not for computer.
Just have cli