Projects
Multimedia
bento4
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 9
View file
bento4.changes
Changed
@@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Mon Jan 8 10:24:20 UTC 2018 - aloisio@gmx.com + +- Update to 1.5.1-622 + +------------------------------------------------------------------- Mon Oct 16 07:18:32 UTC 2017 - aloisio@gmx.com - Update to 1.5.1-621
View file
bento4.spec
Changed
@@ -1,7 +1,7 @@ # # spec file for package bento4 # -# Copyright (c) 2017 Packman Team <packman@links2linux.de> +# Copyright (c) 2018 Packman Team <packman@links2linux.de> # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,10 +16,10 @@ # -%define _over 1.5.1-621 -%define _libver 1_5_1r621 +%define _over 1.5.1-622 +%define _libver 1_5_1r622 Name: bento4 -Version: 1.5.1r621 +Version: 1.5.1r622 Release: 0 Summary: C++ toolkit for all your MP4 and MPEG DASH media format needs License: GPL-2.0
View file
bento4-1.5.1r622.tar.gz/.travis.yml
Added
@@ -0,0 +1,19 @@ +language: cpp + +matrix: + include: + - os: osx + osx_image: xcode9.2 + env: + - BUILD_DIR=Build/Targets/universal-apple-macosx + - BUILD_SCRIPT="xcodebuild -target All -configuration Release" + + - os: linux + env: + - BUILD_DIR=. + - BUILD_SCRIPT="scons build_config=all stop_on_warning=yes" + +script: + - cd $BUILD_DIR + - $BUILD_SCRIPT +
View file
bento4-1.5.1r621.tar.gz/README.md -> bento4-1.5.1r622.tar.gz/README.md
Changed
@@ -1,5 +1,6 @@ Bento4 -====== +===== +[![Build Status](https://travis-ci.org/axiomatic-systems/Bento4.svg?branch=master)](https://travis-ci.org/axiomatic-systems/Bento4.svg?branch=master) Bento4 is a C++ class library and tools designed to read and write ISO-MP4 files. This format is defined in international specifications ISO/IEC 14496-12, 14496-14 and 14496-15. @@ -74,7 +75,7 @@ ### Windows using Visual Studio Open the Visual Studio solution file Build/Targets/x86-microsoft-win32-vs2010/Bento4.sln and build -### Using SCons +### On Linux and other platforms, using SCons Make sure you the the SCons build tool installed on your host machine (http://www.scons.org). To build the Debug configuration, simply enter the command: @@ -90,7 +91,7 @@ Example: -```scons -u build_config=Release target=arm-unknown-linux``` +```scons -u build_config=Release target=x86_64-unknown-linux``` ### Using CMake CMake can generate Makefiles, Xcode project files, or Visual Studios project files.
View file
bento4-1.5.1r621.tar.gz/Source/C++/Apps/Mp4Edit/Mp4Edit.cpp -> bento4-1.5.1r622.tar.gz/Source/C++/Apps/Mp4Edit/Mp4Edit.cpp
Changed
@@ -37,10 +37,12 @@ /*---------------------------------------------------------------------- | constants +---------------------------------------------------------------------*/ -#define BANNER "MP4 File Editor - Version 1.1\n"\ +#define BANNER "MP4 File Editor - Version 1.2\n"\ "(Bento4 Version " AP4_VERSION_STRING ")\n"\ - "(c) 2002-2012 Axiomatic Systems, LLC" - + "(c) 2002-2017 Axiomatic Systems, LLC" + +const AP4_LargeSize AP4_MP4EDIT_MAX_PAYLOAD_SIZE = (AP4_LargeSize)0xFFFFFFFFUL; + /*---------------------------------------------------------------------- | PrintUsageAndExit +---------------------------------------------------------------------*/ @@ -51,9 +53,15 @@ BANNER "\n\nusage: mp4edit [commands] <input> <output>\n" " where commands include one or more of:\n" - " --insert <atom_path>:<atom_source_file>[:<position>]\n" + " --insert <atom_path>:<atom_source>[:<position>]\n" " --remove <atom_path>\n" - " --replace <atom_path>:<atom_source_file>\n"); + " --replace <atom_path>:<atom_source>\n" + "\n" + " and <atom_source> may be either a filename for a file\n" + " that contains the atom data (header and payload), or\n" + " <uuid>#<file> with <uuid> specifying an atom uuid type,\n" + " as a 32-character hex value, and <file> a file with the atom\n" + " payload only.\n"); exit(1); } @@ -75,17 +83,17 @@ // constructor Command(Type type, const char* atom_path, - const char* file_path, + const char* atom_source, int position = -1) : m_Type(type), m_AtomPath(atom_path), - m_FilePath(file_path), + m_AtomSource(atom_source), m_Position(position) {} // members Type m_Type; AP4_String m_AtomPath; - AP4_String m_FilePath; + AP4_String m_AtomSource; int m_Position; }; @@ -103,7 +111,7 @@ private: // methods - AP4_Result InsertAtom(const char* file_path, + AP4_Result InsertAtom(AP4_String& atom_source, AP4_AtomParent* container, int position); AP4_Result DoRemove(Command* command, AP4_AtomParent& top_level); @@ -191,29 +199,68 @@ | AP4_EditingProcessor::InsertAtom +---------------------------------------------------------------------*/ AP4_Result -AP4_EditingProcessor::InsertAtom(const char* file_path, +AP4_EditingProcessor::InsertAtom(AP4_String& atom_source, AP4_AtomParent* container, int position) { - // read the atom to insert - AP4_Atom* child = NULL; - AP4_ByteStream* input = NULL; - AP4_Result result = AP4_FileByteStream::Create(file_path, AP4_FileByteStream::STREAM_MODE_READ, input); - if (AP4_FAILED(result)) { - fprintf(stderr, "ERROR: cannot open atom file (%s)\n", file_path); - return AP4_FAILURE; + const char* file_path = atom_source.GetChars(); + int separator = atom_source.Find('#'); + AP4_UI08 atom_uuid[16]; + bool is_uuid = false; + if (separator == 32) { + // uuid + AP4_ParseHex(atom_source.GetChars(), atom_uuid, 16); + file_path += separator + 1; + is_uuid = true; } - AP4_DefaultAtomFactory atom_factory; - result = atom_factory.CreateAtomFromStream(*input, child); - input->Release(); - if (AP4_FAILED(result)) { - fprintf(stderr, "ERROR: failed to create atom\n"); - return AP4_FAILURE; - } + AP4_Atom* child = NULL; + if (is_uuid) { + // open the payload + AP4_ByteStream* payload = NULL; + AP4_Result result = AP4_FileByteStream::Create(file_path, AP4_FileByteStream::STREAM_MODE_READ, payload); + if (AP4_FAILED(result)) { + fprintf(stderr, "ERROR: cannot open atom file (%s)\n", file_path); + return result; + } + + // check the size + AP4_LargeSize payload_size = 0; + result = payload->GetSize(payload_size); + if (AP4_FAILED(result)) { + fprintf(stderr, "ERROR: cannot get atom file size\n"); + payload->Release(); + return result; + } + if (payload_size > AP4_MP4EDIT_MAX_PAYLOAD_SIZE) { + fprintf(stderr, "ERROR: atom payload too large\n"); + payload->Release(); + return AP4_ERROR_OUT_OF_RANGE; + } + + // synthesize a uuid atom + child = new AP4_UnknownUuidAtom(payload_size + AP4_ATOM_HEADER_SIZE + 16, atom_uuid, *payload); + payload->Release(); + } else { + // read the atom to insert + AP4_ByteStream* input = NULL; + AP4_Result result = AP4_FileByteStream::Create(file_path, AP4_FileByteStream::STREAM_MODE_READ, input); + if (AP4_FAILED(result)) { + fprintf(stderr, "ERROR: cannot open atom file (%s)\n", file_path); + return AP4_FAILURE; + } + AP4_DefaultAtomFactory atom_factory; + result = atom_factory.CreateAtomFromStream(*input, child); + input->Release(); + if (AP4_FAILED(result)) { + fprintf(stderr, "ERROR: failed to create atom\n"); + return AP4_FAILURE; + } + } + // insert the atom - result = container->AddChild(child, position); + AP4_Result result = container->AddChild(child, position); if (AP4_FAILED(result)) { fprintf(stderr, "ERROR: failed to insert atom\n"); delete child; @@ -253,7 +300,7 @@ return AP4_FAILURE; } - return InsertAtom(command->m_FilePath.GetChars(), parent, command->m_Position); + return InsertAtom(command->m_AtomSource, parent, command->m_Position); } /*---------------------------------------------------------------------- @@ -283,7 +330,7 @@ delete atom; // insert the replacement - return InsertAtom(command->m_FilePath.GetChars(), parent, position); + return InsertAtom(command->m_AtomSource, parent, position); } }
View file
bento4-1.5.1r621.tar.gz/Source/C++/Apps/Mp4Mux/Mp4Mux.cpp -> bento4-1.5.1r622.tar.gz/Source/C++/Apps/Mp4Mux/Mp4Mux.cpp
Changed
@@ -388,6 +388,7 @@ double frame_rate = atof(parameters[i].m_Value.GetChars()); if (frame_rate == 0.0) { fprintf(stderr, "ERROR: invalid video frame rate %s\n", parameters[i].m_Value.GetChars()); + input->Release(); return; } video_frame_rate = (unsigned int)(1000.0*frame_rate); @@ -602,6 +603,7 @@ double frame_rate = atof(parameters[i].m_Value.GetChars()); if (frame_rate == 0.0) { fprintf(stderr, "ERROR: invalid video frame rate %s\n", parameters[i].m_Value.GetChars()); + input->Release(); return; } video_frame_rate = (unsigned int)(1000.0*frame_rate);
View file
bento4-1.5.1r621.tar.gz/Source/C++/Core/Ap4Atom.cpp -> bento4-1.5.1r622.tar.gz/Source/C++/Core/Ap4Atom.cpp
Changed
@@ -645,36 +645,58 @@ // walk the path while (path[0] && path[1] && path[2] && path[3]) { // we have 4 valid chars - const char* tail; - int index = 0; - if (path[4] == '\0') { - tail = NULL; - } else if (path[4] == '/') { - // separator - tail = &path[5]; - } else if (path[4] == '[') { - const char* x = &path[5]; + const char* end = &path[4]; + + // look for the end or a separator + while (*end != '\0' && *end != '/' && *end != '[') { + ++end; + } + + // decide if this is a 4-character code or a UUID + AP4_UI08 uuid[16]; + AP4_Atom::Type type = 0; + bool is_uuid = false; + if (end == path+4) { + // 4-character code + type = AP4_ATOM_TYPE(path[0], path[1], path[2], path[3]); + } else if (end == path+32) { + // UUID + is_uuid = true; + AP4_ParseHex(path, uuid, sizeof(uuid)); + } else { + // malformed path + return NULL; + } + + // parse the array index, if any + int index = 0; + if (*end == '[') { + const char* x = end+1; while (*x >= '0' && *x <= '9') { index = 10*index+(*x++ - '0'); } - if (x[0] == ']') { - if (x[1] == '\0') { - tail = NULL; - } else { - tail = x+2; - } - } else { + if (*x != ']') { // malformed path return NULL; } - } else { + end = x+1; + } + + // check what's at the end now + if (*end == '/') { + ++end; + } else if (*end != '\0') { // malformed path return NULL; } - + // look for this atom in the current list - AP4_Atom::Type type = AP4_ATOM_TYPE(path[0], path[1], path[2], path[3]); - AP4_Atom* atom = parent->GetChild(type, index); + AP4_Atom* atom = NULL; + if (is_uuid) { + atom = parent->GetChild(uuid, index); + } else { + atom = parent->GetChild(type, index); + } if (atom == NULL) { // not found if (auto_create && (index == 0)) { @@ -689,8 +711,8 @@ } } - if (tail) { - path = tail; + if (*end) { + path = end; // if this atom is an atom parent, recurse parent = AP4_DYNAMIC_CAST(AP4_ContainerAtom, atom); if (parent == NULL) return NULL;
View file
bento4-1.5.1r621.tar.gz/Source/C++/Core/Ap4Processor.cpp -> bento4-1.5.1r622.tar.gz/Source/C++/Core/Ap4Processor.cpp
Changed
@@ -740,6 +740,11 @@ // cleanup frags.DeleteReferences(); delete mfra; + if (fragments) { + // with a fragments stream, `moov` isn't inclued in `top_level` + // so we need to delete it here + delete moov; + } return AP4_SUCCESS; }
View file
bento4-1.5.1r621.tar.gz/Source/C++/Core/Ap4Utils.cpp -> bento4-1.5.1r622.tar.gz/Source/C++/Core/Ap4Utils.cpp
Changed
@@ -455,7 +455,7 @@ AP4_BitReader::BitsWord cache = m_Cache & AP4_BIT_MASK(m_BitsCached); n -= m_BitsCached; m_BitsCached = AP4_WORD_BITS - n; - result = (word >> m_BitsCached) | (cache << n); + result = m_BitsCached ? (word >> m_BitsCached) | (cache << n) : word; m_Cache = word; }
View file
bento4-1.5.1r621.tar.gz/Source/Python/utils/aes.py -> bento4-1.5.1r622.tar.gz/Source/Python/utils/aes.py
Changed
@@ -294,7 +294,7 @@ def decrypt(self, ciphertext): if len(ciphertext) != self.block_size: - raise ValueError('wrong block length, expected ' + str(self.block_size) + ' got ' + str(len(plaintext))) + raise ValueError('wrong block length, expected ' + str(self.block_size) + ' got ' + str(len(ciphertext))) Kd = self.Kd BC = self.block_size / 4
View file
bento4-1.5.1r621.tar.gz/Source/Python/utils/mp4-dash.py -> bento4-1.5.1r622.tar.gz/Source/Python/utils/mp4-dash.py
Changed
@@ -28,7 +28,7 @@ # setup main options VERSION = "1.8.0" -SDK_REVISION = '621' +SDK_REVISION = '622' SCRIPT_PATH = path.abspath(path.dirname(__file__)) sys.path += [SCRIPT_PATH] @@ -752,6 +752,7 @@ master_playlist_file.write('\r\n') master_playlist_file.write('# Video\r\n') + iframe_playlist_lines = [] for video_track in all_video_tracks: if options.on_demand or not options.split: media_subdir = '' @@ -791,20 +792,48 @@ OutputHlsTrack(options, video_track, media_subdir, media_playlist_name, media_file_name) OutputHlsIframeIndex(options, video_track, media_subdir, iframes_playlist_name, media_file_name) + # this will be written later + iframe_playlist_lines.append('#EXT-X-I-FRAME-STREAM-INF:AVERAGE-BANDWIDTH=%d,BANDWIDTH=%d,CODECS="%s",RESOLUTION=%dx%d,URI="%s"\r\n' % ( + video_track.average_segment_bitrate, + video_track.max_segment_bitrate, + video_track.codec, + video_track.width, + video_track.height, + media_playlist_path)) + master_playlist_file.write('\r\n# I-Frame Playlists\r\n') - for video_track in all_video_tracks: - master_playlist_file.write('#EXT-X-I-FRAME-STREAM-INF:AVERAGE-BANDWIDTH=%d,BANDWIDTH=%d,CODECS="%s",RESOLUTION=%dx%d,URI="%s"\r\n' % ( - video_track.average_segment_bitrate, - video_track.max_segment_bitrate, - video_track.codec, - video_track.width, - video_track.height, - media_playlist_path)) + master_playlist_file.write(''.join(iframe_playlist_lines)) + + # IMSC1 subtitles + if len(all_subtitles_tracks): + master_playlist_file.write('\r\n# Subtitles (IMSC1)\r\n') + for subtitles_track in all_subtitles_tracks: + if subtitles_track.codec != 'stpp': + # only accept IMSC1 tracks + continue + language = subtitles_track.language.decode('utf-8') + language_name = LanguageNames.get(language, language).decode('utf-8') + + if options.on_demand or not options.split: + media_subdir = '' + media_file_name = subtitles_track.parent.media_name + media_playlist_name = subtitles_track.representation_id+".m3u8" + media_playlist_path = media_playlist_name + else: + media_subdir = subtitles_track.representation_id + media_file_name = '' + media_playlist_name = options.hls_media_playlist_name + media_playlist_path = media_subdir+'/'+media_playlist_name + master_playlist_file.write('#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="imsc1",NAME="{0:s}",DEFAULT=NO,AUTOSELECT=YES,LANGUAGE="{1:s}",URI="{2:s}"\r\n' + .format(language_name, language, media_playlist_path)) + + # WebVTT subtitles if len(subtitles_files): - master_playlist_file.write('# Subtitles\r\n') + master_playlist_file.write('\r\n# Subtitles (WebVTT)\r\n') for subtitles_file in subtitles_files: - master_playlist_file.write('''#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="{0:s}",DEFAULT=NO,AUTOSELECT=YES,FORCED=YES,LANGUAGE="{0:s}",URI="subtitles/{0:s}/{1:s}"\r\n'''.format(subtitles_file.language,subtitles_file.media_name)) + master_playlist_file.write('#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="{0:s}",DEFAULT=NO,AUTOSELECT=YES,FORCED=YES,LANGUAGE="{0:s}",URI="subtitles/{0:s}/{1:s}"\r\n' + .format(subtitles_file.language,subtitles_file.media_name)) ############################################# def OutputSmooth(options, audio_tracks, video_tracks):
View file
bento4-1.5.1r621.tar.gz/Source/Python/utils/mp4-hls.py -> bento4-1.5.1r622.tar.gz/Source/Python/utils/mp4-hls.py
Changed
@@ -27,7 +27,7 @@ # setup main options VERSION = "1.1.0" -SDK_REVISION = '621' +SDK_REVISION = '622' SCRIPT_PATH = path.abspath(path.dirname(__file__)) sys.path += [SCRIPT_PATH]
View file
bento4-1.5.1r621.tar.gz/Source/Python/utils/mp4utils.py -> bento4-1.5.1r622.tar.gz/Source/Python/utils/mp4utils.py
Changed
@@ -696,7 +696,7 @@ accu_size += sizes[j] accu_duration += durations[j] max_avail = buffer_size+accu_duration*bandwidth/8.0 - if accu_size > max_avail: + if accu_size > max_avail and accu_duration != 0: bandwidth = 8.0*(accu_size-buffer_size)/accu_duration break return int(bandwidth)
View file
bento4-1.5.1r622.tar.gz/Test/Data/README.txt
Added
@@ -0,0 +1,2 @@ +test-001.mp4: simple audio+video file +test-002.mp4: same as test-001.mp4 but fragmented
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.