Log in

View Full Version : MP4 muxers


Pages : 1 [2]

Kurt.noise
20th November 2024, 13:45
How do you make that mux?
1/ I took a win64 installer from there : https://gpac.io/downloads/gpac-nightly-builds/ & extract it into a folder.
2/ Then, apply this command :
mp4box.exe -add input.mkv#trackID=1:fps=24000/1001 -add audio.dts#trackID=1:lang=eng -new output.mp4

Info from audio.dts :
General
Complete name : audio.dts
Format : DTS XLL
Format/Info : Digital Theater Systems
Commercial name : DTS-HD Master Audio
File size : 51.4 MiB
Overall bit rate mode : Variable

Audio
Format : DTS XLL
Format/Info : Digital Theater Systems
Commercial name : DTS-HD Master Audio
Bit rate mode : Variable
Channel(s) : 6 channels
Channel layout : C L R Ls Rs LFE
Sampling rate : 48.0 kHz
Frame rate : 93.750 FPS (512 SPF)
Bit depth : 24 bits
Compression mode : Lossless


Info from output.mp4 :
General
Complete name : output.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/avc1)
File size : 170 MiB
Duration : 3 min 25 s
Overall bit rate mode : Variable
Overall bit rate : 6 935 kb/s
Frame rate : 23.976 FPS
Encoded date : 2024-11-20 12:35:15 UTC
Tagged date : 2024-11-20 12:35:15 UTC
Writing application : GPAC-2.5-DEV-rev707-g9c261926-master

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings : CABAC / 4 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference fra : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 3 min 25 s
Bit rate : 4 829 kb/s
Maximum bit rate : 19.2 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Variable
Frame rate : 23.976 (24000/1001) FPS
Minimum frame rate : 23.810 FPS
Maximum frame rate : 24.390 FPS
Color space : RGB
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.097
Stream size : 118 MiB (70%)
Title : Piste Vidéo
Writing library : x264 core 146 r2538 121396c
Encoding settings : cabac=1 / ref=4 / deblock=1:-1:-1 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.15 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-3 / threads=12 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=15.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=20000 / vbv_bufsize=30000 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
Language : English
Encoded date : 2024-11-20 12:35:15 UTC
Tagged date : 2024-11-20 12:35:16 UTC
Color range : Limited
Matrix coefficients : Identity
mdhd_Duration : 205202
ColorSpace_Original : YUV
Codec configuration box : avcC

Audio
ID : 2
Format : DTS
Format/Info : Digital Theater Systems
Codec ID : dtsc
Duration : 3 min 25 s
Bit rate mode : Variable
Bit rate : 2 100 kb/s
Maximum bit rate : 2 746 kb/s
Sampling rate : 48.0 kHz
Stream size : 51.4 MiB (30%)
Title : Piste Audio
Language : English
Default : Yes
Alternate group : 1
Encoded date : 2024-11-20 12:35:15 UTC
Tagged date : 2024-11-20 12:35:16 UTC


Info from input.mkv :

General
Unique ID : 194964996866116433750323166388027802333 (0x92ACE47EA0A15008964FF4FED95642DD)
Complete name : input.mkv
Format : Matroska
Format version : Version 4
File size : 170 MiB
Duration : 3 min 25 s
Overall bit rate mode : Variable
Overall bit rate : 6 931 kb/s
Frame rate : 23.976 FPS
Encoded date : 2015-04-06 09:49:53 UTC
Writing application : mkvmerge v6.9.1 ('Blue Panther') 64bit built on Apr 18 2014 18:23:38
Writing library : libebml v1.3.0 + libmatroska v1.4.1

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.1
Format settings : CABAC / 4 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference fra : 4 frames
Codec ID : V_MPEG4/ISO/AVC
Duration : 3 min 25 s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 23.976 (24000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Writing library : x264 core 146 r2538 121396c
Encoding settings : cabac=1 / ref=4 / deblock=1:-1:-1 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.15 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-3 / threads=12 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=15.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=20000 / vbv_bufsize=30000 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
Language : English
Default : Yes
Forced : No

Audio
ID : 2
Format : DTS XLL
Format/Info : Digital Theater Systems
Commercial name : DTS-HD Master Audio
Codec ID : A_DTS
Duration : 3 min 25 s
Bit rate mode : Variable
Channel(s) : 6 channels
Channel layout : C L R Ls Rs LFE
Sampling rate : 48.0 kHz
Frame rate : 93.750 FPS (512 SPF)
Bit depth : 24 bits
Compression mode : Lossless
Language : English
Default : Yes
Forced : No

All ffmpeg libraries from the installer are required in this case.

tebasuna51
20th November 2024, 14:17
1/ I took a win64 installer from there : https://gpac.io/downloads/gpac-nightly-builds/ & extract it into a folder.

Maybe we need the full gpac package instead the standalone MP4Box.exe

EDIT: like you say in the edited post

LigH
20th November 2024, 17:12
If MP4Box built by M-AB-S is unable to multiplex dts, I wonder if that requires a specific configuration parameter or an additional patch to enable it.

In my MP4Box.exe I can find "DTS", "DTS-HD", "Coherent Acoustics" etc. being mentioned.

PS: It seems that MP4Box.exe is not able to print out a list of supported codecs; instead, gpac.exe from the same build does report some list. In my case:

dstc [O]: DTS Coherent Acoustics and Digital Surround Audio (audio/dts)
dtsh [O]: DTS-HD High Resolution Audio and DTS-Master Audio (audio/dts)
dstl [O]: DTS-HD Substream containing only XLLAudio (audio/dts)
dtse [O]: DTS Express low bit rate Audio (audio/dts)
dtsx [O]: DTS-X UHD Audio Profile 2 (audio/dts)
dtsy [O]: DTS-X UHD Audio Profile 3 (audio/dts)

Apparently, all the DTS formats are only supported for output, means demultiplexing, but not multiplexing...

PPS: Did you notice the typos in the FourCC's? gpac issue 3044 (https://github.com/gpac/gpac/issues/3044) reported

And ... it's gone. At least the typos. Quick response.

RBO
20th November 2024, 20:04
Discovering this discussion thanks to @LigH bug report :thanks:

I think VC-1 is supported now. Let us know (https://github.com/gpac/gpac/issues) politely if you see any issue.

By the way we've also been working on a GUI (https://gui.gpac.io) to help people visualize the processing pipeline. It includes the capability to add "templates". I had planned to post about it specifically, but let me know about your needs (in a specific topic if it makes more sense).

LigH
20th November 2024, 20:10
Hello there :)

The typos got fixed quickly. Still open: The question why DTS is only supported as output in a self-compiled MP4Box, while it works in your distributed version as input too.

SeeMoreDigital
20th November 2024, 20:34
By the way we've also been working on a GUI (https://gui.gpac.io) to help people visualize the processing pipeline. It includes the capability to add "templates". I had planned to post about it specifically, but let me know about your needs (in a specific topic if it makes more sense).Oh wow... That should help people like me ;)

filler56789
20th November 2024, 21:05
BTW I can understand the lack of interest for this old, obsolete and not-free codec when can use AAC for lossy compression or ALAC and FLAC for lossless audio with better compression ratio and free use.

DTS's D.C.A. is not more obsolete or less useful than the ultra-low-bitrate audio codecs from the 3GP era. GPAC's lack of interest is purely a matter of (bad) taste, there is no "technicality" involved.

I think VC-1 is supported now. Let us know (https://github.com/gpac/gpac/issues) politely if you see any issue.

Well, do not expect any "politeness" from me while you all don't buy and swallow some deciliters of HONESTY.
It's fine to say you will not do this or that because you don't want to do this or that.
But it's very bad to pretend that your non-activity is caused by "lack of time" or because "oh the real world issues (*) keep me busy 24x7" :rolleyes:

(*) Hello Archie ;)

RBO
21st November 2024, 00:17
Still open: The question why DTS is only supported as output in a self-compiled MP4Box, while it works in your distributed version as input too.

Maybe a difference in FFmpeg support? What does "ffmpeg -codecs | grep -i dts" (or equivalent) give?

GeoffreyA
21st November 2024, 06:32
New to MP4Box but noticed that there is no way to set a global title field or omit tagged date. Is that correct?

LigH
21st November 2024, 10:52
Maybe a difference in FFmpeg support? What does "ffmpeg -codecs | grep -i dts" (or equivalent) give?

Does MP4Box (as part of GPAC) depend on ffmpeg? That would surprise me. Anyway:

ffmpeg -codecs
DEAILS dts DCA (DTS Coherent Acoustics) (decoders: dca) (encoders: dca)

ffmpeg -formats
DE dts raw DTS
D dtshd raw DTS-HD

ffmpeg -muxers
E dts raw DTS

ffmpeg -demuxers
D dts raw DTS
D dtshd raw DTS-HD

RBO
21st November 2024, 11:40
set a global title field

Usually people use -tags title="..."

omit tagged date

If you set a tag to null then it is removed, see https://wiki.gpac.io/MP4Box/mp4box-other-opts/.

Does MP4Box (as part of GPAC) depend on ffmpeg?

It does (optionally) since GPAC 1.0 in 2020. We rewrote the core of GPAC to reuse the same framework ("filters") that you see in the new 'gpac' app. Add -graph to your command-line to see the MP4Box processing graph.

Now MP4Box can leverage other libraries. FFmpeg is a kind of last-resort fallback.

To come back to your case, I would expect to see:

dtsc [ODE]: DTS Coherent Acoustics and Digital Surround Audio (audio/dts)
dtsh [O]: DTS-HD High Resolution Audio and DTS-Master Audio (audio/dts)
dtsl [O]: DTS-HD Substream containing only XLLAudio (audio/dts)
dtse [O]: DTS Express low bit rate Audio (audio/dts)
dtsx [O]: DTS-X UHD Audio Profile 2 (audio/dts)
dtsy [O]: DTS-X UHD Audio Profile 3 (audio/dts)


This is on Windows, correct?

LigH
21st November 2024, 11:53
Yes, Windows. Building from sources in an MSYS2/MinGW environment with GCC 14.2.

Does it require to configure with a special parameter to include ffmpeg support?

RBO
21st November 2024, 13:36
No. It really seems GPAC doesn't see the DTS codec in FFmpeg. I propose to reproduce your media-autobuild_suite build, let me know if you use specific options.

LigH
21st November 2024, 13:48
This archive (https://github.com/user-attachments/files/17603157/build.zip) contains a few relevant files, mainly media-autobuild_suite.ini (configured for many codecs with additional separate executables besides ffmpeg which gets built as static EXE with a custom set of libraries) and ffmpeg_options.txt; may be way too much for your needs, you can probably safely disable many codecs to run your test, the dca codec is part of libavcodec (the ffmpeg core) anyway, does not depend on additional libraries.

I would recommend to configure M-AB-S from scratch, select only static build, GPL, minimal set for ffmpeg; disable most codecs except GPAC/MP4Box, and enable building of separate codecs besides ffmpeg.

The resulting binaries are not installed in the Windows\System and not in the MSYS2 base environment but in local directories.

GeoffreyA
22nd November 2024, 09:10
Usually people use -tags title="..."

Thanks. It worked.

RBO
22nd November 2024, 14:21
M-AB-S builds GPAC before FFmpeg. So obviously GPAC can't rely on FFmpeg in these builds.

Second remark: M-AB-S seems to rely on libgpac_static only (code (https://github.com/m-ab-s/media-autobuild_suite/blob/7e35fbd5eecc22cb706c6a1e9ee39b806edd67ed/build/media-suite_compile.sh#L1574)). Does this script aims at building static binaries whenever possible?

FYI the build failed for me because ccache said there are too many files in the FFmpeg build. Retrying the build from a root folder. It takes a lot of time because I have continuous network issues and the system continuous updates dozens of git repos when relaunched.

LigH
22nd November 2024, 14:29
M-AB-S builds GPAC before FFmpeg. So obviously GPAC can't rely on FFmpeg in these builds.

Good to know, will tell the maintainers about it, so they can possibly rearrange.

Second remark: M-AB-S seems to rely on libgpac_static only (code (https://github.com/m-ab-s/media-autobuild_suite/blob/7e35fbd5eecc22cb706c6a1e9ee39b806edd67ed/build/media-suite_compile.sh#L1574)). Does this script aims at building static binaries whenever possible?

Not always. You can try to build ffmpeg with shared DLLs as well. Some other separate tools may prefer static building "always" if there used to be linking issues when trying to run a dynamic-link build in the past. Needs to be answered by the maintainers.

FYI the build failed for me because ccache said there are too many files in the FFmpeg build. Retrying the build from a root folder. It takes a lot of time because I have continuous network issues and the system continuous updates dozens of git repos when relaunched.

Very useful information. I know there is an issue with a "too long command line" when building ffmpeg with dynamic linking and a lot of enabled optional modules (that was the reason why I recommended to you to configure from scratch with a minimal ffmpeg with GPL license), and knowing that ccache may be the bottleneck here should help greatly solving it.

PS: See M-AB-S issue 2801 (https://github.com/m-ab-s/media-autobuild_suite/issues/2801).

filler56789
22nd November 2024, 16:27
F.W.I.W., I downloaded the latest GPAC-installer available at videohelp dot com,
and saw that it uses the (lib)av libraries...
BUT it cannot do everything that the (lib)av DLLs are capable of doing...
which raises the question:
¿what is the point, then? :rolleyes:

In comparison, the L-Smash muxer.exe rev1477 18a9ed2 filesize is only 569 kB. :cool:
And obviously, it does not depend on the FFmpeg stuff.

Bottom line is, something very-wrong cannot be right.

RBO
22nd November 2024, 18:59
BUT it cannot do everything that the (lib)av DLLs are capable of doing...

Ah. What can't it do?

the L-Smash muxer.exe rev1477 18a9ed2 filesize is only 569 kB

MP4Box built with with "--isomedia-only --static-bin --strip" is the closest comparable I think. It weighs around 1MB and handles network, multithreading, configurable cache, etc. Do you need something smaller? What's your need?