News:

--

Main Menu

2.6 r8171 CLI --output-format MP4

Started by Spellbinder, September 05, 2012, 08:42:48 AM

Previous topic - Next topic

Spellbinder

Hi there!

I was trying to merge two MP4 files into one with 2.6 r8171 CLI. This is the command that I used:

avidemux_cli.exe --nogui --autoindex --force-unpack --load "JOIN\h264_aac_join CD1.mp4" --append "JOIN\h264_aac_join CD2.mp4" --audio-codec copy --video-codec copy --output-format MP4 --audio-map --save "JOINED\h264_aac_join.mp4"

This is what Mediainfo says about the files that I want to merge:

General
Complete name                            : INFO\h264_aac_join CD1.mp4
Format                                   : MPEG-4
Format profile                           : Base Media / Version 2
Codec ID                                 : mp42

This is what Mediainfo says about the resulting file:

General
Complete name                            : INFO\h264_aac_join.mp4
Format                                   : AVI
Format/Info                              : Audio Video Interleave

As you can see it did not make a MP4 container, but did a AVI container instead.

Did I do something wrong? Is the feature "MP4" not yet implemented in r8171 or is this a BUG?

Thanks in advance!


Jan Gruuthuse

#1
You can replace avidemux_cli.exe by avidemux.exe (GUI), see if this gets you any further.

If not (linux Tinyppy example, something similar should work with windows, no idea what option to choose, don't have windows)
Load a same type source video in avidemux GUI
make settings for Output Format MP4v2
Save the project file
Edit project file
Remove references to loaded video and markers, remove bolded:
Quoteadm = Avidemux()
adm.loadVideo("/media/DataB_SATA3/ndrHD.ts")
adm.clearSegments()
adm.addSegment(0, 0, 54300000)
adm.markerA = 0
adm.markerB = 54300000
Insert --run SetMP4.py before --save "JOINED\h264_aac_join.mp4, and run from command line.

No idea if you can use --audio-map : build audio map (MP3 VBR)
If you indicate to copy both video and audio (not re-encode)
avidemux -? is not showing this option:
Command line possible arguments :
    --nogui, Run in silent mode  ( no arg )
    --slave, run as slave, master is on port arg  (one arg )
    --run, load and run a script  (one arg )
    --save-jpg, save a jpeg  (one arg )
    --begin, set start frame  (one arg )
    --end, set end frame  (one arg )
    --save-raw-audio, save audio as-is   (one arg )
    --save-uncompressed-audio, save uncompressed audio  (one arg )
    --load, load video or workbench  (one arg )
    --load-workbench, load workbench file  (one arg )
    --append, append video  (one arg )
    --save, save avi  (one arg )
    --force-b-frame, Force detection of bframe in next loaded file  ( no arg )
    --force-alt-h264, Force use of alternate read mode for h264  ( no arg )
    --audio-delay, set audio time shift in ms (+ or -)  (one arg )
    --audio-codec, set audio codec (MP2/MP3/AC3/NONE (WAV PCM)/TWOLAME/COPY)  (one arg )
    --video-codec, set video codec (Divx/Xvid/FFmpeg4/VCD/SVCD/DVD/XVCD/XSVCD/COPY)  (one arg )
    --video-conf, set video codec conf (cq=q|cbr=br|2pass=size)[,mbr=br][,matrix=(0|1|2|3)]  (one arg )
    --reuse-2pass-log, reuse 2pass logfile if it exists  ( no arg )
    --autosplit, split every N MBytes  (one arg )
    --info, show information about loaded video and audio streams  ( no arg )
    --output-format, set output format (AVI|OGM|ES|PS|AVI_DUAL|AVI_UNP|...)  (one arg )
    --rebuild-index, rebuild index with correct frame type  ( no arg )
    --var, set var (--var myvar=3)  (one arg )
    --help, print this  ( no arg )
    --quit, exit avidemux  ( no arg )
    --probePat, Probe for PAT//PMT..  (one arg )Cleaning up

Spellbinder

Thanks for your quick reply. But your solution is not possible for me. My goal is to use this in a automated batch process. Therefore I want to use the CLI client.

mean

The simplest is to do it with the ui, and save a py project file
Remove everything except
adm = Avidemux()
adm.setContainer("MP4", "muxerType=0", "useAlternateMp3Tag=True")

or
adm = Avidemux()
adm.setContainer("MP4V2", "optimize=0", "add_itunes_metadata=0")

then
avidemux3_cli blah blah --run  yourproject.py --save foobar.mp4

Spellbinder


Spellbinder

#5
I cheered too early:

I am now using:

avidemux_cli.exe --nogui --autoindex --force-unpack --load "JOIN\h264_aac_join CD1.mp4" --append "JOIN\h264_aac_join CD2.mp4" --audio-codec copy --video-codec copy --audio-map --run merge.py ---save "JOINED\h264_aac_join.mp4"

with merge.py

adm = Avidemux()
adm.setContainer("MP4V2", "optimize=0", "add_itunes_metadata=0")

But with some AVI files I get the following message:

"Video does not have enough timing information. Are you copying from AVI?"

This did not happen with my previous method.

How can I fix this?


mean

I fixed --output-format yesterday, so if you update you can use it

mean

BTW,, the error message is right
It means the avi does not provide timing informations, so avidemux tries to guess the missingones, but sometimes it cannot

Spellbinder