axiomatic-systems / bento4 Goto Github PK
View Code? Open in Web Editor NEWFull-featured MP4 format, MPEG DASH, HLS, CMAF SDK and tools
Home Page: http://www.bento4.com
Full-featured MP4 format, MPEG DASH, HLS, CMAF SDK and tools
Home Page: http://www.bento4.com
Trying to build Bento4 library to use in Android project.
My platform is: Ubuntu 14.04 x86-64
Android NDK is: android-ndk-r10c
Bento4 source: last commit of master branch
According to build instruction I run build command from directory Build/Targets/arm-android-linux. Build command is: scons -u build_config=Release target=arm-android-linux
Script doesn't found ndk toolchain, because it tries to locate it in linux-x86 but I have linux-x86_64 platform. I fix scrip to find proper toolchain but build command failed with this build log:
********* Configuring Build Target = arm-android-linux / Release ********
Building for Android:
ANDROID_HOST_SYSTEM = linux-x86_64
ANDROID_TOOLCHAIN = arm-linux-androideabi-4.6
ANDROID_PLATFORM = android-4
ANDROID_ARCH = arm
scons: done reading SConscript files.
scons: Building targets ...
scons: building associated VariantDir targets: Build/Targets/arm-android-linux
arm-linux-androideabi-g++ -o Build/Targets/arm-android-linux/Release/C++/Apps/Aac2Mp4/Aac2Mp4.o -c -fno-exceptions -fno-rtti -Wall -D_REENTRANT -O3 -I/home/grinch/Android/android-ndk-r10c/sources/cxx-stl/system/include --sysroot /home/grinch/Android/android-ndk-r10c/platforms/android-4/arch-arm -msoft-float -fpic -mthumb-interwork -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -D_REENTRANT -DANDROID -DNPT_CONFIG_HAVE_SYSTEM_LOG_CONFIG -ISource/Config -ISource/C++/Core -ISource/C++/Crypto -ISource/C++/MetaData -ISource/C++/System/StdC -ISource/C++/System/Posix -ISource/C++/Codecs Source/C++/Apps/Aac2Mp4/Aac2Mp4.cpp
arm-linux-androideabi-g++ -o Build/Targets/arm-android-linux/Release/C++/Apps/AvcInfo/AvcInfo.o -c -fno-exceptions -fno-rtti -Wall -D_REENTRANT -O3 -I/home/grinch/Android/android-ndk-r10c/sources/cxx-stl/system/include --sysroot /home/grinch/Android/android-ndk-r10c/platforms/android-4/arch-arm -msoft-float -fpic -mthumb-interwork -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -D_REENTRANT -DANDROID -DNPT_CONFIG_HAVE_SYSTEM_LOG_CONFIG -ISource/Config -ISource/C++/Core -ISource/C++/Crypto -ISource/C++/MetaData -ISource/C++/System/StdC -ISource/C++/System/Posix -ISource/C++/Codecs Source/C++/Apps/AvcInfo/AvcInfo.cpp
Source/C++/Apps/AvcInfo/AvcInfo.cpp: In function 'int main(int, char)':
Source/C++/Apps/AvcInfo/AvcInfo.cpp:125:76: error: no matching function for call to 'AP4_FileByteStream::AP4_FileByteStream(char const&, AP4_FileByteStream::Mode)'
Source/C++/Apps/AvcInfo/AvcInfo.cpp:125:76: note: candidates are:
Source/C++/Core/Ap4FileByteStream.h:65:5: note: AP4_FileByteStream::AP4_FileByteStream(AP4_ByteStream_)
Source/C++/Core/Ap4FileByteStream.h:65:5: note: candidate expects 1 argument, 2 provided
Source/C++/Core/Ap4FileByteStream.h:42:7: note: AP4_FileByteStream::AP4_FileByteStream(const AP4_FileByteStream&)
Source/C++/Core/Ap4FileByteStream.h:42:7: note: candidate expects 1 argument, 2 provided
Source/C++/Apps/AvcInfo/AvcInfo.cpp:126:14: error: expected type-specifier before 'AP4_Exception'
Source/C++/Apps/AvcInfo/AvcInfo.cpp:126:14: error: exception handling disabled, use -fexceptions to enable
scons: *_* [Build/Targets/arm-android-linux/Release/C++/Apps/AvcInfo/AvcInfo.o] Error 1
scons: building terminated because of errors.
Please help to build your library to use in Android. Thanks.
so the command line utilities are building under emscripten. I plan on distributing them through node package manager (npm) so people can use them without having a C++ compiler installed, only Node.js. I have a little bit of cleaning up to do around command line argument handling, but then we'll be able to publish them.
I'm currently writing up documentation on Mozilla Developer Network for working with MSE using Bento4. The first step is to write everything recommending users build bento4 from source. Then, change the recommendation to the JavaScript versions once built. Finally, a stretch goal would be to make web applications where a user can use a file picker to import a file, and print the results of mp4dump or mp4info to the DOM.
I was going to put the relevant files for NPM in this repo in a subsequent PR. Using this issue to track the work.
We have an AAC-HE coded video (with implicit SBR) but we cannot get mp4-dash.py to handle it correctly. Despite all of our attempts using a variety of methods, it creates a DASH MPD reporting AAC-LC and a sample rate of 24000 (rather than 48000). Is there any special process required to DASH an AAC-HE audio codec?
The original file is here: http://living.tv/mob/test_3840_main_he.mp4
Please advise.
Would really appreciate it if you can advise of a working soluton or method.
Richard.
Hi, I use Bento4 to extract atoms from mp4 and inject those atoms into new mp4 file and I found the following issue.
When I try to extract udta/meta atom with sub atom in the mdat atom (ie. hdlr, ilist, etc... see attached png file) Bento4 stop the parsing at the mdat level (why not ...) and claim as expected that the atom ise is for example 144 bytes. But when I do the 'moov->AddChild(udta->Clone());' in the output file there is an issue because the MP4 output file, the metaatom has only a size of 12 bytes and by the way all subboxes are not there !!!
here is the pseudo-code I used to extract the atom (note that in the real code all return are checked with 'AP4_FAILED' and no error is found .... )
AP4_Atom extract(...) {
AP4_ByteStream input = NULL;
AP4_Result result = AP4_FileByteStream::Create(input_name.c_str(), AP4_FileByteStream::STREAM_MODE_READ, input);
if (AP4_FAILED(result)) {
return NULL;
}
// parse the atoms
AP4_AtomParent top_level;
AP4_Atom atom;
AP4_AtomFactory& atom_factory = AP4_DefaultAtomFactory::Instance;
while (atom_factory.CreateAtomFromStream(input, atom) == AP4_SUCCESS) {
top_level.AddChild(atom);
}
atom = top_level.FindChild("moov/udta");
if (atom == NULL)
{
return NULL;
}
result = atom->Detach();
input->Release();
return atom;
}
and the pseudo-code use to insert
void insert(AP4_Atom atom)
{
AP4_Movie movie = new AP4_Movie(civox->media_timescale);
AP4_File file(movie);
....
AP4_MoovAtom moov = movie->GetMoovAtom();
result = moov->AddChild(atom->Clone());
....
AP4_ByteStream output;
result = AP4_FileByteStream::Create (mp4File, AP4_FileByteStream::STREAM_MODE_WRITE, output);
result = AP4_FileWriter::Write(file, *output);
output->Release();
....
}
I use ffmpeg args to h264 to mp4 not bad,but use bento4 has it.
the extend h264file.
http://pan.baidu.com/s/1nuxQhaL
Hi
Is it possible to update the MPD file output to include the required components under the DASH IOP 3 guidelines? i.e.
For any ADAPTATION SETS with @contentType="video" the following attributes SHALL be present:-
@MaxWidth (or @width if all Representations have the same width)
@maxHeight (or @height if all Representations have the same height)
@maxFrameRate (or @framerate if all Representations have the same frame rate)
@Par
For any REPRESENTATION within an Adaptation Set with @contentType="video" the following attributes SHALL be present:
@sar
Can these be added to the MPD file written please?
Thanks, Richard
Hi,
I need to create mpeg-dash that is DRM protected as ExoPlayer did, i.e. the first couple of seconds will be unencrypted (to let ExoPlayer start to play the media while we're waiting for the keys response from the license provider).
Can I achieve that with Bento4 tool?
Thanks in advance for any advice.
Hi
Is it possible to add a flag option in mp4-dash.py to write the Video adaptation set information into the MPD file first, and then the Audio adaptation set second.
Currently it writes the audio set first, and there's no way to switch the order if that's the preference.
Thanks.
Richard
I have the need to have the first audio track to be the language the film is produced in (theatrical language). Even though I pass the track in the order I would like them to be in the MPD, it appears that the are written in a different order (alphabetical ?).
Is there a way to force the order or is there another way to indicate which audio file is the theatrical language? I tried adding +role=main (e.g. [type=audio,+language=English,+role=main] ) but that did not seem to affect the resulting MPD file.
Thank you,
Michelle Winkel
how to widevine and playready dual-DRM signaling?
Hello,
We need to be able to provide Castilian and Mexican Spanish audio for our content. It does not appear that the ISO 639-1 or 639-2 codes provide the ability to distinguish between these two languages. I tested using 2 audio files (one es-ES and one es-MX) found that there was only 1 folder called spa in the audio folder.
Is there a way that I can tag the audio tracks or change how the audio files are written out so that we can provide both languages?
We are using Bento4 mp4-dash to create the mpeg-dash for Widevine, Cenc, Playready and Marlin.
Thank you very much for your assistance.
Michelle Winkel
Hello,
When using the mp42hls
command to generate HLS segments, the m3u8 file is not correctly reflecting the specified name in the --segment-filename-template
. It is always segment-%d.ts (or stream.ts when using --output-single-file
.
For example the command:
./mp42hls --hls-version 4 --output-single-file --index-filename TEST1.m3u8 --segment-filename-template TEST1.ts ~/test/TEST1.mp4
results in an m3u8 index file with the following entries:
#EXTINF:10.010010,
#EXT-X-BYTERANGE:650112@0
stream.ts
#EXTINF:10.010010,
#EXT-X-BYTERANGE:601424@650112
stream.ts
#EXTINF:10.010010,
#EXT-X-BYTERANGE:586192@1251536
stream.ts
#EXTINF:10.010010,
#EXT-X-BYTERANGE:669664@1837728
stream.ts
...
The expected output would be something like:
#EXTINF:10.010010,
#EXT-X-BYTERANGE:650112@0
TEST1.ts
#EXTINF:10.010010,
#EXT-X-BYTERANGE:601424@650112
TEST1.ts
#EXTINF:10.010010,
#EXT-X-BYTERANGE:586192@1251536
TEST1.ts
#EXTINF:10.010010,
#EXT-X-BYTERANGE:669664@1837728
TEST1.ts
...
Hi, I'm looking for a way to explore and extract atom from a MOV/Quicktime file.
For now the only thing I was able to do with Bento4, was to explore the 1st level (see below). But is there a way to uncompress and parse the "cmov" atom ?
[ftyp] size=8+24
major_brand = qt
minor_version = 20050300
compatible_brand = qt
compatible_brand =
compatible_brand =
compatible_brand =
[moov] size=8+1447
[cmov] size=8+1439
[free] size=8+182
[wide] size=8+0
[mdat] size=8+990317
I changed the CMake requirement to 2.8 (shipped with Ubuntu 14.04) and the project compiled without any warnings or messages from CMake.
I need help.
AP4_TkhdAtom::GetMatrix
returns the matrix embedded in the atom. This matrix is an array of 32-bit fixed-point numbers (16.16 fixed-point for first two columns and 2.30 fixed-point for the last column).
Why is the type AP4_SI32
? Wouldn’t it make more sense for it to be AP4_UI32
?
use this operate to mp42mux,mp42ts,mp42hls.
best wish.
Hello again! I'm trying to build Bento4 for x86 linux platform. For this I type such line:
scons -u build_config=Release target=x86-unknown-linux
Building x86-unknown-linux target with SCons failed with such error:
********** Configuring Build Target = x86-unknown-linux / Release ********
scons: done reading SConscript files.
scons: Building targets ...
scons: building associated VariantDir targets: Build/Targets/x86-unknown-linux/Release
o Build/Targets/x86-unknown-linux/Release/C++/Apps/Aac2Mp4/Aac2Mp4.o -c -pedantic -Wall -W -Wundef -Wno-long-long -D_REENTRANT -O3 -D_REENTRANT -DAP4_PLATFORM_BYTE_ORDER=AP4_PLATFORM_BYTE_ORDER_LITTLE_ENDIAN -ISource/Config -ISource/C++/Core -ISource/C++/Crypto -ISource/C++/MetaData -ISource/C++/System/StdC -ISource/C++/System/Posix -ISource/C++/Codecs Source/C++/Apps/Aac2Mp4/Aac2Mp4.cpp
sh: 1: o: not found
...
etc.
I can't find in any build scripts or makefiles line where instead calling of gcc occurs calling of 'o'
But would be better if you make next SDK build of master branch. On Bento4.com available for downloading only version without last changes of AP4_Track needed for my purposes.
Hi,
I am trying to use the Bento packager (mp4-dash.py) to encrypt content with a clear lead.
By 'clear lead' I am referring to the ability to leave certain NAL types in the clear (if present at beginning ) e.g RAP/IDR's
Is this possible with he current tool version?
Hi there,
I'm trying to use Bento4 to encode an mp4 file to be played in the dash.js web player. I took my sample .mp4 file and used mp4fragment, then used mp4-dash.py to encode it.
Specifically my commands were:
mp4fragment sampleVideo.mp4 fragmented.mp4
python /Bento4/Source/Python/utils/mp4-dash.py fragmented.mp4 -o output --exec-dir /Bento4/Build/Targets/x86-unknown-linux/Release --encryption-args="--global-option mpeg-cenc.piff-compatible:true"
When I try to play the output in my dash.js player and even on http://dashif.org/reference/players/javascript/1.4.0/samples/dash-if-reference-player/
I can clearly see in the console that my player is requesting all of the files and moving through the video, nothing plays. The video stays black, and while it correctly gets the duration of the video, the time stays at 0 seconds the whole time.
Am I missing some key step? I've been at this for hours and have made little progress trouble-shooting the issue. Any help would be greatly appreciated.
Hi all,
I was trying to compile the tools on a 64-bit host so I used the x86-unknown-linux target. However it is missing the -m32 flag for both the compiler and the linker. I just added this to Build/Target/Config.scons:
env.AppendUnique(CCFLAGS = ['-m32'])
env.AppendUnique(CXXFLAGS = ['-m32'])
env.AppendUnique(LINKFLAGS = ['-m32'])
And it compiles, but haven't tried that library yet. Am I missing something?
Regards,
Roberto
Hi,
I found a bug which, in some cases, updates the tfra entries more than once. This causes responses with the code "415 - Unsupported Media Type" in services like Akamai when the client requests certain fragments with a correct moof offset but doesn't match with the tfra's entries.
Cheers,
Nadim.
➜ tmp git:(emscripten) ✗ echo $PATH
BunchOfStuff:/Users/Nicholas/mozilla/Bento4/builds
➜ tmp git:(emscripten) ✗ ls /Users/Nicholas/mozilla/Bento4/builds
CMakeCache.txt libap4.a mp4compact mp4encrypt mp4split
CMakeFiles maybe_frag.mp4 mp4dcfpackager mp4extract mp4tag
Makefile mp42aac mp4decrypt mp4fragment tmp
aac2mp4 mp42hls mp4dump mp4info
cmake_install.cmake mp42ts mp4edit mp4mux
➜ tmp git:(emscripten) ✗ ls
video_00500.mp4 video_00875.mp4 video_01625.mp4
video_00500.mp4_ video_01250.mp4 video_02000.mp4
➜ tmp git:(emscripten) ✗ ../../Source/Python/utils/mp4-dash.py video_0*
Executable directory does not exist (/Users/Nicholas/mozilla/Bento4/Source/Python/utils/../bin), use --exec-dir
So I was able to successfully try out a fragmented mp4 with 2 DASH clients. I produced the fragmented and segmented mp4 with mp4fragment and mp4-dash.py. This produced numerous .m4f files. For the adaptive part of adaptive bitrate streaming, I was wondering if there were any built in tools for performing the transcoding? Should the original source be transcoded into multiple transcodings first, then segmented, or segmented into multiple files then each transcoded? I'm more than happy to use ffmpeg, but I was just curious what the suggestion was.
Hi, after trying Bento4 to make a MPEG-DASH stream and validate it with the dash-if conformance tool, I get the following errors:
### error: ftyp-1
### The brand 'isom' can only be a compatible, not major, brand
'tkhd' alternateGroup must be 0 not 1
### error: sidx-1
### Track ID 1 in track reference atoms references a non-existent track
### error:
### getTrakIndexByID: Track ID 1 is not a known track!
Is it normal?
Commands:
$ mp4fragment --fragment-duration 3000 --index media.mp4 fmedia.mp4
$ mp4dash --debug --output-dir=.\dash\ --mpd-name=media.mpd --profiles=live --use-segment-template-number-padding fmedia.mp4
Validation tool: http://dashif.org/conformance.html
Greetings,
I am encountering a Segfault when attempting to delete
a pointer to a SyntheticSampleTable object. I am trying to cleanup inputs and a SampleTable for an application that processes multiple inputs when it Segfaults. I've done a few tests with the Mp4Mux application and can replicate the issue with the SyntheticSampleTable object there as well. I couldn't find any examples of what I'm needing so I'm not sure if delete
ing the pointer is the right solution to being with.
Any and all help is appreciated!
I might be wrong, but I didn't find an option to set <BaseUrl></BaseUrl>
at the MPD level. E.g. GPAC/MP4Box has -base-url option that does this.
AP4_NullTerminatedStringAtom::AP4_NullTerminatedStringAtom(AP4_Atom::Type type,
AP4_UI64 size,
AP4_ByteStream& stream) :
AP4_Atom(type, size)
{
AP4_Size str_size = (AP4_Size)size-AP4_ATOM_HEADER_SIZE;
char* str = new char[str_size];
stream.Read(str, str_size);
str[str_size-1] = '\0'; // force null-termination
m_Value = str;
}
str
is copied into a new AP4_String
(m_Value
), but it is never deleted.
I have a fragmented mp4 file, but I can't create the dash manifest:
➜ mse ~/Downloads/Bento4-SDK-1-4-2-589.universal-apple-macosx/bin/Release/mp4fragment --fragment-duration 30000 snowblind.mp4 snowblind-frag.mp4
➜ mse ~/Downloads/Bento4-SDK-1-4-2-589.universal-apple-macosx/utils/mp4-dash.py --profiles=on-demand --use-segment-list snowblind-frag.mp4
Parsing media file 1: snowblind-frag.mp4
Extracting track 1 from snowblind-frag.mp4
no video track, cannot autodetect fragment duration
unable to detect fragment duration, using default
Parsing media file 1: tmpWeIW74 = Extracted[track 1 from snowblind-frag.mp4]
Processing and Copying media file tmpWeIW74 = Extracted[track 1 from snowblind-frag.mp4]
Bento4/Source/C++/Apps/Mp4Fragment/Mp4Fragment.cpp
Lines 1026 to 1033 in 865ae71
Is it possible to get the fragment duration from audio? Or am I doing something wrong?
Hi,
when the source file or output path include unicode characters mp4-dash.py
fails do write the output files:
$ mp4-dash.py --profiles=on-demand -d -v -f -o "/opt/sb4/data/proxies/media_1/GötzeTest/testfiles/Götze.mp3" "/opt/sb4/data/proxies/media_1/GötzeTest/testfiles/Götze.mp3/fragmented.mp4"
Traceback (most recent call last):
File "/opt/sb4/stage/bin/mp4-dash.py", line 1333, in <module>
main()
File "/opt/sb4/stage/bin/mp4-dash.py", line 1301, in main
media_filename = path.join(options.output_dir, mp4_file.media_name)
File "/opt/sb4/stage/lib/python2.7/posixpath.py", line 73, in join
path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 31: ordinal not in range(128)
We were able to fix this for our use case (our arguements are always UTF-8 encoded) by adding this to the script:
reload(sys)
sys.setdefaultencoding('utf8')
Since I don't know python very well and this solution will probably break on non unicode terminals I did not submit a pull request.
Let me know if you need additional information.
Thanks,
Dominik
There is no built-in support for the 'xml '
atom that is detailed on page 70 of ISO/IEC 14496-12:2012.
8.11.2.1 Definition
Box Type: 'xml ' or 'bxml'
Container: Meta box ('meta')
Mandatory: No
Quantity: Zero or oneWhen the primary data is in XML format and it is desired that the XML be stored directly in the meta-box, one of these forms may be used. The Binary XML Box may only be used when there is a single well-defined binarization of the XML for that defined format as identified by the handler.
Within an XML box the data is in UTF-8 format unless the data starts with a byte-order-mark (BOM), which indicates that the data is in UTF-16 format.
aligned(8) class XMLBox
extends FullBox('xml ', version = 0, 0) {
string xml; }
I have been finding that mp4fragment has been creating an extra audio fragment with only 3 samples even though the previous fragment has less than the maximum number of samples for the specified duration.
Using this sample file: http://asbctest.s3.amazonaws.com/debug/muxed.mp4
Result looks like this
mp4fragment --verbosity 3 muxed.mp4 cokead_frag.m4f
found regular I-frame interval: 200 frames (at 25.000 frames per second)
fragment: track ID 1 200 samples
fragment: track ID 2 345 samples
fragment: track ID 1 200 samples
fragment: track ID 2 344 samples
fragment: track ID 1 200 samples
fragment: track ID 2 345 samples
fragment: track ID 1 150 samples
fragment: track ID 2 258 samples
fragment: track ID 2 3 samples
As the video is 25fps 200 samples per fragment is exactly on 8 seconds as per the encode and the audio is 44.1Khz so should be 43 packets of 1024 samples second == 344.5 samples.
So are the last 2 fragments for track 2 258 and 3? Shouldn't it be one last fragment of 261 samples? Even if I adjust the fragment duration to longer than the video I still get one last audio fragment of 3 samples.
The result is that when it runs through mp4split is that it is generating one more audio segment than video segment and this is causing some players to error.
I am trying to use mp4edit on a single segment generated as part of a DASH live profile and it appears to be failing to process the m4f correctly.
For example the mp4dump of the seg-0.m4f is:
[moof] size=8+488
[mfhd] size=12+4
sequence number = 1
[traf] size=8+464
[tfhd] size=12+8, flags=20020
track ID = 1
default sample flags = 1010000
[tfdt] size=12+8, version=1
base media decode time = 0
[trun] size=12+412, flags=305
sample count = 50
data offset = 504
first sample flags = 2000000
[mdat] size=8+118697
My attempt to use mp4edit (example only via remove):
mp4edit --remove moof/traf[0]/tfhd seg-0.m4f edit.m4f
ERROR: atom 'moof/traf[0]/tfhd' not found
Whereas the same command works when operating on a full mp4 with --remove moov/trak[0]/tkhd e.g.
sample structure:
[ftyp] size=8+28
major_brand = isom
minor_version = 1
compatible_brand = isom
compatible_brand = avc1
compatible_brand = mp42
compatible_brand = iso5
compatible_brand = iso6
[moov] size=8+800
[mvhd] size=12+96
timescale = 1000
duration = 65760
duration(ms) = 65760
[trak] size=8+555
[tkhd] size=12+80, flags=7
enabled = 1
id = 1
duration = 65760
width = 640.000000
height = 360.000000
I am using the latest pull from master
System/Posix/Ap4PosixRandom uses /dev/random. The read function to /dev/random can be blocking. In our case this is not acceptable. Using /dev/urandom is sufficient for encryption key generation and the read function is never blocking. For an extended explanation I recommend http://www.2uo.de/myths-about-urandom/.
Best Regards,
Armin Trattnig (bitmovin)
Hi, I would implement a complete pass through of a Track from 1 input file to a file I create. It could be an audio track or a time code track, in fact I don't know if it really matter, but for now every try I made with the Bento4 API failed ?
Is it possible ?
if 'yes', I could share my current implementation, but it can be summarize by the following step:
input
bitstream) and locate a specific track atomAP4_TrakAtom* newTrakAtom = AP4_DYNAMIC_CAST(AP4_TrakAtom, track_atom);
input
bitstream.result = movie->AddTrack(new AP4_Track(*newTrakAtom, *input, movie->GetTimeScale()));
From lines 752–764 of Ap4AtomFactory.cpp:
default: {
// try all the external type handlers
AP4_List<TypeHandler>::Item* handler_item = m_TypeHandlers.FirstItem();
while (handler_item) {
TypeHandler* handler = handler_item->GetData();
if (AP4_SUCCEEDED(handler->CreateAtom(type, size_32, stream, GetContext(), atom))) {
break;
}
handler_item = handler_item->GetNext();
}
break;
}
The TypeHandler
only gets passed the 32-bit size. :-(
Hi Gilles
Just downloaded v606 to try from the Bento4 website, but mp4-dash.py execution fails (Windows).
I presume the BIN directory should be in the UTILS folder as in previous builds I have seen, but for some reason this is missing.
Can we just copy these missing exes from the other BIN folder in the root, or are these different in any way?
Maybe need to check the build process to see if something has changed as to why these are missing.
Please advise.
The option --output-dir
don't change the output path.
The option --text-overlay
fails on Linux..
https://github.com/axiomatic-systems/Bento4/blob/master/Source/Python/utils/mp4-dash-encode.py#L161
excuse,
I wan't to use any project to extern a method to use stream to change to other stream...
can you help me..I know your Powerful...
Hello!
I got this error:
"No JSON object could be decoded"
when I ran this:
C:\Python27\python.exe bento/utils/mp4-dash-encode.py -b 5 fixed.mp4
[Running windows 7, x64, with python 2.7]
And I have checked the mp4 file for errors with ffprobe and I can verify that it's complete!
Any idea how I can fix this?
Any idea what I can do? Or is this no longer supported?
As you remember, I've implemented function that merge several mp4 files to one for Android application. In general it works fine. But now I'm doing measuring of that operation's performance and compare it with the same operation but written in Java using google's interface.
So, my expectations was that C++ library will be much faster than Java implementation . But result dissapointed me, performance almost unchanged (I use Nexus 5 device for measuring): two FullHD files with duration of 60 sec. each was merged in 23 sec., the same 4 files was merged in 48 sec.
Logs shown me that the most slow function is AP4_FileWriter::Write(AP4_File& file, AP4_ByteStream& stream, Interleaving interleaving = INTERLEAVING_SEQUENTIAL)
Maybe you have any suggestions how to improve performance of writing file operation? Maybe may I change something localy in my version of Bento4 library to achieve that?
Thanks in advance for you time and great feedback in previous issue )
mp4info currently lists the codec string for video tracks, which is very helpful. I would like the codec string to be listed for audio, too.
There are several places in the lib with hardcoded AP4_DefaultAtomFactory::Instance without a way to change the AtomFactory used to parse the atoms. For example:
In AP4_Atom::Clone(),
AP4_DefaultAtomFactory::Instance.CreateAtomFromStream(*mbs, clone);
Specifically, if the CreateAtomFromStream() happens to involve PushContext() in this static instance of the AtomFactory object, you will get random UnknownSampleEntry or other Unknown atom because of the change in the m_ContextStack. This will cause race condition when using the library in a multi-threaded environment. One way to let the caller pass in a reference to a AtomFactory like the AP4_File is better.
There are other places with similar issue like the AP4_LinearReader, AP4_MarlinIpmpEncryptingProcessor ...etc.
Andy
Hello,
I am running bento4 on a windows7, below is my syntax I copied from your PlayReady example using the MS public license servers
This is the example that is listed in the bento4 doc
mp4-dash.py --exec-dir c:\Bento4-SDK-1-4-2-594.x86-microsoft-win32-vs2010\utils\bin\win32 frag_inception_audio.mp4 frag_inception_video.mp4 -f -o encrypted_MS/ --mpd-name=inception.mpd --encryption-key=09e367028f33436ca5dd60ffe6671e70:b42ca3172ee4e69bf51848a59db9cd13 --playready-header=LA_URL:http://playready.directtaps.net/pr/svc/rightsmanager.asmx
when I go to play the media in the DASH reference player
http://dashif.org/reference/players/javascript/1.4.0/samples/dash-if-reference-player/index.html
I get an error "unsupported video type or invalid file path"
Can you assist?
I am trying to get the public MS test server to work so then I can test another PR server once I know the public one works
THX
So I'm testing with two web based DASH clients, dash.js and shaka player. They both work with manifests generated from mp4-dash.py, but seem to only fetch segments from output/video/1
which is the lowest resolution, while streaming off of localhost. They also seem to be unable to cycle segments of bitrates. I will file issues in their bug trackers and reference all of them to see f we can figure out where the incompatibility lies. Se also: Dash-Industry-Forum/dash.js#587 and shaka-project/shaka-player#100
Manifest looks like:
<?xml version="1.0" ?>
<MPD mediaPresentationDuration="PT1M0.08S" minBufferTime="PT3.00S" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" xmlns="urn:mpeg:dash:schema:mpd:2011">
<!-- Created with Bento4 mp4-dash.py, VERSION=1.6.0-594 -->
<Period>
<!-- Audio -->
<AdaptationSet mimeType="audio/mp4" segmentAlignment="true" startWithSAP="1">
<SegmentTemplate duration="3000" initialization="$RepresentationID$/init.mp4" media="$RepresentationID$/seg-$Number$.m4f" startNumber="1" timescale="1000"/>
<Representation audioSamplingRate="22050" bandwidth="130635" codecs="mp4a.40.2" id="audio/und">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
</Representation>
</AdaptationSet>
<!-- Video -->
<AdaptationSet mimeType="video/mp4" segmentAlignment="true" startWithSAP="1">
<SegmentTemplate duration="3000" initialization="$RepresentationID$/init.mp4" media="$RepresentationID$/seg-$Number$.m4f" startNumber="1" timescale="1000"/>
<Representation bandwidth="170203" codecs="avc1.42C00D" frameRate="24" height="144" id="video/1" scanType="progressive" width="256"/>
<Representation bandwidth="405617" codecs="avc1.42C014" frameRate="24" height="216" id="video/2" scanType="progressive" width="384"/>
<Representation bandwidth="563833" codecs="avc1.42C015" frameRate="24" height="270" id="video/3" scanType="progressive" width="480"/>
<Representation bandwidth="718137" codecs="avc1.42C015" frameRate="24" height="316" id="video/4" scanType="progressive" width="560"/>
<Representation bandwidth="698854" codecs="avc1.42C01E" frameRate="24" height="360" id="video/5" scanType="progressive" width="640"/>
</AdaptationSet>
</Period>
</MPD>
I'm trying to have this command line generate my stub mp4 files and the new ISM/ISMC files as well as the mpd file. MY current command line as an example is
c:\mp4-dash.py -smooth --smooth-client-manifest-name=video1435746311702 --smooth-server-manifest-name=video1435746311702 --mpd-name=video1435746311702.mpd
It generate my new ism's and copies the ismv as well as the stub mp4's are built and the mpd file. Do I have to perform anything additional?
I have the security.xml and crossdomain.xml set to * for hosts and I have added the appropriate mime types for mpd and mp4 at the top level IIS server. Any suggestions? I've tried to play from the web hosted players, such as shaka and your akamai hosted one but nothing. I tried one from http://dashif.org/reference/players/javascript/1.4.0/samples/dash-if-reference-player/index.html
And playing the stream http://DALHT7.digitalsyphon.com/dalht7-0/2015/7/video1435746311702.mpd
I encoded my ISMV using expressions encoder 4 pro sp2.
When running on Chrome and windows 7 I just get an unsupported media type when tryingto play back my ism I have mime types for .mpd, .mp4, and .ism (application/vnd.ms-sstr+xml) I've also tried w/o the .ism mime type and no dice? any help woudl be appreciated.
Hi,
I use a simple AAC file of 1085 frames, if I use FFMPEG to Mux that track into a MP4 file and extract again the AAC with ffmpeg, I retrieve an AAC file of 1085 frame (same as the input).
But with the Bento4 App aac2mp4
I get only 1084 frames.
After some investigation I found that in AP4_AdtsParser::FindFrame
at the end we run that test:
} else if (available < adts_header.m_FrameLength || (m_Bits.m_Flags & AP4_BITSTREAM_FLAG_EOS) == 0) {
// not enough for a frame, or not at the end (in which case we'll want to peek at the next header)
return AP4_ERROR_NOT_ENOUGH_DATA;
}
In my case adts_header.m_FrameLength
is equal to 'available'. The frame is really small (14 bytes) but as the m_Bits.m_Flags
is always 0 (0 & 1 == 0 TRUE) the current implementation return AP4_ERROR_NOT_ENOUGH_DATA
I don't see all the implications of a change where in the if
statement ||
become &&
or where (m_Bits.m_Flags & AP4_BITSTREAM_FLAG_EOS) == 0
become (m_Bits.m_Flags & AP4_BITSTREAM_FLAG_EOS) == 1
but at least I can say that by just changing that if statement I'm able to use aac2mp4 without losing a frame :)
Hi,
In function AddSegmentTemplate (mp4-dash.py) you calculate the duration for the segmenttemplate the following way:
duration=str(int(track.average_segment_duration*1000))
I encountered the case that track.average_segment_duration is exactly 4.004.
If you use this value in the calculation the resulting duration will be "4003", due to floating point arithmetic before calling the function. You can try it yourself, in a python shell.
I propose you use duration=str(int(round(track.average_segment_duration*1000))) instead.
Best Regards
Armin
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.