Giter Site home page Giter Site logo

dolbylaboratories / dlb_mp4base Goto Github PK

View Code? Open in Web Editor NEW
247.0 29.0 65.0 6.7 MB

The Dolby MP4 streaming muxer (dlb_mp4base) is a software implementation of a muxer of fragmented or unfragmented ISO base media file format (mp4). It supports muxing of Dolby Digital (AC-3), Dolby Digital Plus (E-AC-3), and Dolby AC-4 audio formats as well as Dolby Vision.

License: BSD 3-Clause "New" or "Revised" License

C 89.38% Makefile 10.62%

dlb_mp4base's Introduction

dlb_mp4base

The Dolby MP4 streaming muxer (dlb_mp4base) is a software implementation of a muxer of fragmented or unfragmented ISO base media file format (mp4). It supports muxing of Dolby Digital (AC-3), Dolby Digital Plus (E-AC-3), and Dolby AC-4 audio formats as well as Dolby Vision.

Getting Started

These instructions will help you get a copy of the project up and running on your local machine for development and testing purposes.

Folder Structure

The "dlb_mp4base" folder consists of:

  • README.md This file.
  • doc/ Doxygen documentation of the dlb_mp4base.
  • frontend/ MP4Muxer frontend with corresponding EMA interface as source code.
  • include/ Necessary header files of the dlb_mp4base library.
  • make/ Makefiles and Visual Studio projects/solutions for building the Dolby MP4 multiplexer library with frontends and test harnesses.
  • src/ Contains the MP4 multiplexer source code.
  • test/ Test harnesses for unit and developer system tests including test signals.

Prerequisites

For Windows platform development, Visual Studio 2010 must be installed with SP1.

Building instructions

Using the makefiles (on Linux and MacOS)

After cloning the dlb_mp4base repository to your local machine, go to the appropriate directory, depending on your machine OS and architecture, such as:
"cd dlb_mp4base/make/mp4muxer<architecture>"

Then build one of the following make targets:
"make mp4muxer_release"
"make mp4muxer_debug"

Using the Visual Studio Solutions(on Windows)

From a Visual Studio 2010 command line window:
Go to a directory of your choice
"cd dlb_mp4base\make\mp4muxer\mp4muxer<architecture>"
"devenv mp4muxer_2010.sln /rebuild debug/release"

Release Notes

See the Release Notes file for details

License

This project is licensed under the BSD-3 License - see the LICENSE file for details

dlb_mp4base's People

Contributors

jtc-dolby avatar raverat avatar shaoweiguo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dlb_mp4base's Issues

Profiles

Hi

Could you please give a description of the different profiles and what the differences are between them?

Thanks

output file is 0 when using mac os binary

using

../dlb_mp4base-master/bin/mp4muxer_mac --dv-profile 7 -i 00014.track_4113.hevc -i 00014.track_4117.hevc --dv-input-es-mode split --mpeg4-comp-brand mp42,iso6,isom,msdh,dby1 -o ./out.mp4 --overwrite

does not seem to write any data on the out.mp4 file.

Need arm cpu support

My laptop is running windows 11 on ARM, which is Qualcomm Snapdragon 8cx. I tried the exe version, it did not work, please add support in future version.

Question : Adding Subtitles

Hello,

this program works great !

I'm wondering if it's possible to add an implementation for subtitles management into the final .mp4 file ?

If it's not, is there another program that would do the trick without any quality loss ?

Thanks in advance.

Regards.

mp4muxer Gives Audio Stream Incorrect Header

When using this test file:

http://media.developer.dolby.com/DolbyVision_Atmos/mp4/iOS_P5_GlassBlowing2_3840x2160%4059.94fps_15200kbps.mp4

The untouched file's metadata is:

Stream #0:0[0x1](und): Video: hevc (Main 10) (dvh1 / 0x31687664), yuv420p10le(pc), 3840x2160 [SAR 1:1 DAR 16:9], 15184 kb/s, 59.94 fps, 59.94 tbr, 60k tbn (default)

Stream #0:1[0x2](und): Audio: eac3 (ec-3 / 0x332D6365), 48000 Hz, 5.1(side), fltp, 640 kb/s (default)

My mp4muxer command:

mp4muxer -o output.mp4 -i input.hevc -i input.ec3 --dv-profile 5

After using ffmpeg or mp4demuxer to demux and mp4muxer to remux:

Stream #0:0[0x1](und): Video: hevc (Main 10) (dvhe / 0x65687664), yuv420p10le(pc), 3840x2160 [SAR 1:1 DAR 16:9], 15185 kb/s, 59.94 fps, 59.94 tbr, 60k tbn (default)

Stream #0:1[0x2](und): Audio: none (dvhe / 0x65687664), 48000 Hz, 5.1(side), 640 kb/s (default)

The resulting file after using mp4muxer has audio that is unplayable because of the incorrect header.

Video height mismatch

I ran into following error:
I found, my video (HDR stream) is too big and reencoded it.
After reencoding Mediainfo reported no differences (the two /old and new/ stream's Mediainfo report was identical).
I muxed the new one with mp4base and Mediainfo reported:

Height : 2 176 pixels
Original height : 2 160 pixels
Display aspect ratio : 16:9
Original display aspect ratio : 16:9

The hieght was correct using the original video stream, and there was no "Original display aspect ratio" in Mediainfo report.

After making an mkv using the reencoded stream, the height not changed as Mediainfo reported.

I think the bug is in mp4base.

Cannot build mp4muxer.

I cannot build mp4muxer for linux_amd64 target. I get the following error

[CCDEP:cc] ../../../../dlb_mp4base/src/util/io_file.c
[CC:cc] ../../../../dlb_mp4base/src/util/io_file.c
In file included from ../../../../dlb_mp4base/include/utils.h:42,
from ../../../../dlb_mp4base/src/util/io_file.c:31:
../../../../dlb_mp4base/include/msg_log.h:102:1: warning: "/*" within comment
../../../../dlb_mp4base/src/util/io_file.c: In function ‘file_open’:
../../../../dlb_mp4base/src/util/io_file.c:72: warning: pointer targets in passing argument 1 of ‘fopen’ differ in signedness
/usr/include/stdio.h:271: note: expected ‘const char * restrict’ but argument is of type ‘const int8_t *’
../../../../dlb_mp4base/src/util/io_file.c:72: warning: pointer targets in passing argument 1 of ‘fopen’ differ in signedness
/usr/include/stdio.h:271: note: expected ‘const char * restrict’ but argument is of type ‘const int8_t *’
../../../../dlb_mp4base/src/util/io_file.c:72: warning: pointer targets in passing argument 1 of ‘fopen’ differ in signedness
/usr/include/stdio.h:271: note: expected ‘const char * restrict’ but argument is of type ‘const int8_t *’
../../../../dlb_mp4base/src/util/io_file.c:84: warning: pointer targets in passing argument 1 of ‘strrchr’ differ in signedness
/usr/include/string.h:262: note: expected ‘const char *’ but argument is of type ‘const int8_t *’
../../../../dlb_mp4base/src/util/io_file.c:86: warning: pointer targets in passing argument 1 of ‘strrchr’ differ in signedness
/usr/include/string.h:262: note: expected ‘const char *’ but argument is of type ‘const int8_t *’
../../../../dlb_mp4base/src/util/io_file.c:92: error: invalid operands to binary - (have ‘char *’ and ‘const int8_t *’)
../../../../dlb_mp4base/src/util/io_file.c:94: warning: pointer targets in passing argument 1 of ‘__builtin_strncpy’ differ in signedness
../../../../dlb_mp4base/src/util/io_file.c:94: note: expected ‘char *’ but argument is of type ‘int8_t *’
../../../../dlb_mp4base/src/util/io_file.c:94: warning: pointer targets in passing argument 2 of ‘__builtin_strncpy’ differ in signedness
../../../../dlb_mp4base/src/util/io_file.c:94: note: expected ‘const char *’ but argument is of type ‘const int8_t *’
../../../../dlb_mp4base/src/util/io_file.c:110: error: invalid operands to binary - (have ‘char *’ and ‘const int8_t *’)
../../../../dlb_mp4base/src/util/io_file.c:113: warning: pointer targets in passing argument 1 of ‘__builtin_strncpy’ differ in signedness
../../../../dlb_mp4base/src/util/io_file.c:113: note: expected ‘char *’ but argument is of type ‘int8_t *’
../../../../dlb_mp4base/src/util/io_file.c:115: warning: pointer targets in passing argument 1 of ‘__builtin_strncpy’ differ in signedness
../../../../dlb_mp4base/src/util/io_file.c:115: note: expected ‘char *’ but argument is of type ‘int8_t *’
../../../../dlb_mp4base/src/util/io_file.c:115: warning: pointer targets in passing argument 2 of ‘__builtin_strncpy’ differ in signedness
../../../../dlb_mp4base/src/util/io_file.c:115: note: expected ‘const char *’ but argument is of type ‘const int8_t *’
../../../../dlb_mp4base/src/util/io_file.c:122: warning: pointer targets in passing argument 1 of ‘__builtin_strncpy’ differ in signedness
../../../../dlb_mp4base/src/util/io_file.c:122: note: expected ‘char *’ but argument is of type ‘int8_t *’
make[1]: *** [obj/libmp4base_release/io_file.o] Error 1
make: *** [../../../../dlb_mp4base/make/libmp4base/linux_amd64/libmp4base_release.a] Error 2

Single layer dv

Hi, is possible to make single layer from 2 separated track?
Thanks, Roberto.

Request for Windows x64 executable binary

The prebuilt mp4muxer.exe for Windows won't run on Windows 10 64-bit architecture because the app is 16-bit? Can you upgrade to 64-bit architecture? Below is the error that pops up.

Pop-up error message
Unsupported 16-Bit Application
The program or feature "??\C:\tools\mp4muxer\mp4muxer.exe" canot start or run due to incompatibility with 64-bit versions of Windows. Please contact the software vendor to ask if a 64-bit Windows compatible version is available."

Command-line error message
This version of C:\tools\mp4muxer\mp4muxer.exe is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher.

is there any way to include subtitles?

when i using the command

./mp4muxer_mac -o "Liaison.mp4" -i out/out_2.ec3 -i out/out_1.h265 -i out/out_3.data

i get

ERROR! Input ES type: dat, extension not supported

Edit:
this is the command i'm using to demux
./mp4demuxer_mac --input-file Liaison.mp4 --output-folder out

Authoring HEVC files with hvc1 codec ID

Muxing any h265 elementary streams results in the final output track to have a codec ID of hev1 and not hvc1

This goes against Apple's HLS and QuickTime spec, and hence the final file doesn't play in QuickTime.

(I am trying to mux an HDR10 HEVC file with it's Atmos track)

MUX OCCURS, BUT FILE SIZE IS 0KB

Hi, I followed the process and when I muxed my .h264 with my .ec3, the resulting .mp4 file is 0KB. This is an 8K 3D 360 video, which is approximately 8GB. 8192x8192 are the dimensions. I'm wondering if the video resolution is beyond what is currently supported?

Thank You!

SORTA_KINDA

Perhaps add profiles in documentation?

#8 is still open for some reason, related issue.

It may be pertinent to add listing of profiles in the readme documentation. e.g

Dolby Vision
bitstream
profile ID
BL signal
crosscompatibility
ID
Dolby Vision
bitstream
profile string
BL/EL codec BL:EL Video usability
information (VUI)
4 2 dvhe.04 10-bit HEVC 1:¼ • Base layer:
1, 1, 1,0,0
• Enhancement
layer:
2,2,2,1,0
5 0 dvhe.05 10-bit HEVC N/A Base layer:
2,2,2,1,0
7 6 dvhe.07 10-bit HEVC 1:¼ for UHD • Base layer:
16,9,9,0,2
• Enhancement
layer:
16,9,9,0,2
1:1 for FHD • Base layer:
16,9,9,0,2
• Enhancement
layer:
16,9,9,0,2
8 1 hev1.08 10-bit HEVC N/A Base layer:
16,9,9,0,0
8 2 hev1.08 10-bit HEVC N/A Base layer:
1, 1, 1,0,0
9 2 avc3.09 8-bit AVC N/A Base layer:
1, 1, 1,0,0

Black screen on iOS/ATV even dvh1flag

When converting dvhe->dvh1, mp4muxer leads to black screen on iOS/ATV.
File produced by mp4box and mp4mux(bento4) will be fine.
Someone send me this:

'hvc1' stores all parameter sets inside the MP4 container below the sample description boxes. 
'hev1' stores all parameter sets in band (inside the HEVC stream).

The parameter sets are essentially mandatory metadata necessary to decode the streams.

So you have two slightly different ways of muxing HEVC into MP4.

I'd choose based on the play out and transport scenario.

Your player or your transport specification may require one or the other.

dvh1flag doesn't work

using the option --dvh1flag returns an error on mp4muxer 1.1.0 saying the option doesn't exist, even though it's in the help dialogue.

--dvh1flag = Set the elementray stream index to set HEVC track's sample entry name to 'dvh1', default sample entry box name is 'dvhe' for non-cross compatible stream.

Error parsing command line: Unknown option: --dvh1flag Error parsing command line!

SC miss-match

Hi

When I run the command line I get the error "sc miss-match"

Do you have any idea what may be causing this?

eac3 not supported

Hello everybody,

Don't know if this is the tools fault or if I've done something wrong.

Whenever I want to import mux a .h265 file with a Dolby Digital Plus audio track (.eac3; extracted through MKVExtract) I get the error:

ERROR! Input ES type: eac3, extension not supported

According to the ReadMe, Dolby Digital Plus is supported. When i change the filename form .eac3 to .ac3 it works.
So there is at least a workaround but why is this even needed?

Audio delay

Hi! Is it possible to create a new argument for audio delay? TY

Cannot build mp4muxer

I get the following error when building for linux_amd64:

will@ubuntu-server:~/dlb_mp4base/make/mp4muxer/linux_amd64$ make mp4muxer_release
[CCDEP:cc] ../../../../dlb_mp4base/frontend/mp4_muxer_app.c
make: cc: No such file or directory
make: *** [Makefile:118: obj/mp4muxer_release/mp4_muxer_app.o] Error 127

(Windows) Error on input with unicode filenames

I have a file with the following name on my file system (Windows 10 x64):

Ghost in the Shell Stand Alone Complex - 2x26 - IN Return to Patriotism; ENDLESS∞GIG_Track01.h264

mp4muxer.exe generates an error for being unable to open the input file, and notice that the Unicode character (U+221E) has been replaced with 8:

$ mp4muxer -o mp4\test.mp4 -i "Ghost in the Shell Stand Alone Complex - 2x26 - IN Return to Patriotism; ENDLESS∞GIG_Track01.h264"
ERROR! Can't open input file: Ghost in the Shell Stand Alone Complex - 2x26 - IN Return to Patriotism; ENDLESS8GIG_Track01.h264
Error parsing command line!

Explorer, CMD, and any other application I have capable of reading this file have no issues with it or displaying the correct Unicode filename.

Long duration hevc file not muxing

Hevc file with long duration like 1hr or more not muxing and output file is 0bytes and mp4muxer.exe running where read disk activity occur for few seconds but no write disk activity.
For hevc clips like 2min duration it works fine.
Kindly solve the error, thanks.

Changing HDR metadata

Is it possible to have a script to change the HDR metadata?
Something like this:
-colorprim bt2020 -transfer smpte-st-2084 -colormatrix bt2020nc -masterdisplay G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(40000000,50) -maxcll 0,0
NVHSP can do this for HDR10, but it doesnt work for this.

Thanks!

--hvc1flag ERROR

Comand --hvc1flag
libmp4v2: Open: open(C:\Users\info\Desktop\3\3.mp4) failed (src/mp4file.cpp,371)
ERROR: cannot open input (-4)

Help Regarding dlp_mp4base

Hey Developers,

I have a question , Please tell me how to run this program/project on Alpine Linux.
I am really wanted to test this out.

Thanks In Advance…

Muxing including mp4 metadata appreciated

It'd be nice to to include some typical mp4 metadata. Especially
• chapters marks/time stamps
• ID3 tags (title, author, etc.)
in order to provide the same UX with video files muxed with FFMPEG/FFMETADATA (well, for the time being until there's more AC-4 support in FFMEPG as currently the 'raw' option in 6.1).
Alternative: being able to use a h64/265 video in a mp4 container that already includes that sort of metadata and forwards it unaltered.
Thanks.

Command hangs and output file is almost empty

Hello,

I have an issue with remuxing BL + EL video streams into a single Dolby Vision stream, I have tried with both the Windows and Linux binaries, they read the whole source files but never writes into the output file, and the command never exits I have to kill it. Tried with different profiles also.

Command:
./mp4muxer_64bits.exe --overwrite --dv-profile 4 --input-file 00014.track_4113.hevc --input-file 00014.track_4117.hevc --output-file F:\Ready.Player.One.2018.2160p.UHD.BluRay.HDR.HEVC.mp4

Output file:
output.zip

Input files
Base Layer:

General
Complete name                            : F:\Ready Player One\00014.track_4113.hevc
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
File size                                : 61.6 GiB

Video
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Commercial name                          : HDR10
Format profile                           : Main [email protected]@High
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 (24000/1001) fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : BT.2020
Mastering display luminance              : min: 0.0050 cd/m2, max: 4000 cd/m2
Maximum Content Light Level              : 725 cd/m2
Maximum Frame-Average Light Level        : 162 cd/m2

Enhancement Layer;

General
Complete name                            : F:\Ready Player One\00014.track_4117.hevc
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
File size                                : 65.5 MiB

Video
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Commercial name                          : HDR10
Format profile                           : Main [email protected]@High
Width                                    : 1 920 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 23.976 (24000/1001) fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0 (Type 2)
Bit depth                                : 10 bits
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : BT.2020
Mastering display luminance              : min: 0.0050 cd/m2, max: 4000 cd/m2

Audio:

General
Complete name                            : F:\Ready Player One\00014.track_4355.ac3
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
File size                                : 384 MiB
Duration                                 : 2h 19mn
Overall bit rate mode                    : Constant
Overall bit rate                         : 384 Kbps

Audio
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Duration                                 : 2h 19mn
Bit rate mode                            : Constant
Bit rate                                 : 384 Kbps
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 KHz
Frame rate                               : 31.250 fps (1536 SPF)
Bit depth                                : 16 bits
Compression mode                         : Lossy
Stream size                              : 384 MiB (100%)
Service kind                             : Complete Main

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.