summaryrefslogtreecommitdiffstats
path: root/libhb/muxmp4.c
Commit message (Collapse)AuthorAgeFilesLines
* Add metadata support to libhb, add importing of MP4 metadata, add export of ↵eddyg2008-12-021-115/+43
| | | | | | MP4 metadata, add importing of MP4 chapters, add seek to chapter for input files, add new libmp4v2, remove old MP4 chapter muxing - now in libmp4v2. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1987 b64f7644-9d1e-0410-96f1-a4d463321fa5
* ETSI TS 102 366 V1.2.1 compliant AC3 in MP4, replaces older hacked version ↵eddyg2008-10-291-2/+103
| | | | | | that was hardcoding the AC3 stream information in the dac3 atom based on the AppleTV startup movie stream. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1879 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Bumps libmp4v2 to r36, which fixes the problem with QuickTime reading ↵jbrjake2008-10-221-1/+1
| | | | | | non-H.264 video, and also features a snazzy new layout and build routine thanks to KonaBlend (which necessitated a minor change to the include path for muxmp4.c). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1859 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Adds a configuration option for whether the COLR atom and h.264 VUI header ↵jbrjake2008-10-191-1/+12
| | | | | | should signal Bt.601 or Bt.7709 color, instead of just setting it based on whether the source is standard or high definition (which is preserved as default, and made more sensitive to letterboxed HD content). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1851 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Bumps libmp4v2 to r21, which fixes that include issue by folding the old ↵jbrjake2008-10-151-1/+1
| | | | | | 5.5G iPod UUID atom into the library, as well as a typing issue with Linux systems. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1836 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Switches from mpeg4ip's copy of libmp4v2 to an independently-maintained one ↵jbrjake2008-10-151-24/+9
| | | | | | located at: code.google.com/p/mp4v2 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1833 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Only associate audio tracks with an alternate group if there's more than one ↵jbrjake2008-10-111-6/+8
| | | | | | audio track. That way the iPhone doesn't show the audio selection button when it isn't necessary. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1828 b64f7644-9d1e-0410-96f1-a4d463321fa5
* CLI: Add support for naming audio tracks to the HandBrakeCLI, thanks to ↵eddyg2008-10-101-8/+26
| | | | | | LePetomane for the patch. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1825 b64f7644-9d1e-0410-96f1-a4d463321fa5
* After discussion with eddyg, extending verbose logging level 2 from just ↵jbrjake2008-10-091-3/+3
| | | | | | memory-related logging to general-purpose housekeeping--stuff that isn't necessary when scrolling through activity logs users submit with bug reports and support queries. This includes things like thread start/exit messages and preview frames. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1820 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Use PTS, not DTS, in encx264 output frames so we don't have to special-case ↵van2008-07-261-33/+38
| | | | | | its output in every muxer. Confine code that deals with Apple's mistakes in handling video with b-frames to muxmp4. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1582 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - in encx264, if an video frame is larger than init_delay split it into ↵van2008-07-261-33/+19
| | | | | | | | | | | | pieces so we don't get jerky output caused by out-of-order frames. - add an explicit EOF for all streams, not just video. - don't generate extra audio silence at the end of an encode (don't need it with explicit eof). - get rid of 80ms initial delay in AAC encode & flush final four frames buffered in encoder. - put mp4 'chap' atom on first track (usually video) rather than first audio track since we can now do video without audio (atom just needs to go on an enabled media track & video is always enabled). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1581 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix a crash when using mp4 and no audio tracks.saintdev2008-06-261-4/+10
| | | | | | | | Because there were no audio structs on list_audio, audio->config was attempting to dereference a NULL pointer. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1540 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - Add COLR atom support to mpeg4ipvan2008-06-181-0/+18
| | | | | | | | - Add COLR atom to mp4 video tracks - Add colorspace info to h.264 VUI header git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1528 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - Don't allow chapter durations to go negative (since durations are ↵van2008-04-251-2/+21
| | | | | | | | | unsigned the result will be interpreted as a huge positive number). - Revert the change to sync that pushed out the final frame of video -- on many DVDs this frame seems to be junk that's not intended to be displayed. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1438 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Saearch & Replace domain names to move from .m0k.org to handbrake.fr. Only ↵jbrjake2008-04-151-1/+1
| | | | | | covers trunk files, libhb, and test. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1418 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Minor chapter cleanups.van2008-04-041-7/+15
| | | | | | | | | | - put chapter number in buf rather than a 'new chapter' flag. - use that chapter number to index chapter text in muxers so a dropped chapter doesn't make all subsequent chapter labeling wrong. - get rid of most of the chapter logging & just output one line giving the chapter text, number, frame & time. - fix a bug in sync that could cause chapter marks to be lost. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1377 b64f7644-9d1e-0410-96f1-a4d463321fa5
* New internal audio handling.saintdev2008-04-011-20/+28
| | | | | | | | Each audio track contains it's own settings for codec, bitrate, samplerate, etc. This allows for very complex combinations of audio tracks if desired. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1365 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Don't allow negative durations. These shouldn't happen but occasionally do ↵van2008-02-251-1/+18
| | | | | | due to upstream bugs. Replace them with a small positive duration so the mp4 file will be playable. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1316 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Formatting: Remove a lot of trailing whitespace.saintdev2008-02-211-72/+72
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1307 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Remove the transformation matrix, and use the width field of the tkhd atom ↵ritsuka2008-02-171-53/+2
| | | | | | to do anamorphic in quicktime based players and devices. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1280 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Signal anamorphic in the MP4 container though the pixel aspect atom as well ↵jbrjake2008-02-171-2/+13
| | | | | | as the transformation matrix. This allows anamorphic on the iPhone and iPod Touch. One day, if Apple fixes a QuickTime Player bug, the only way to get it to display right in QuickTime might be to remove the transformation matrix the AppleTV still depends upon. It's a gamble. Oh well. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1278 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Allow mac gui to select AC-3 + AAC at the same time, still needs CLI work ↵eddyg2008-02-161-1/+2
| | | | | | for the same. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1267 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Reverts 1262, since, duh, sample size != sample duration.jbrjake2008-02-141-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1263 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Calculate AC3-in-M4V frame sizes based on channel count instead of always ↵jbrjake2008-02-141-1/+1
| | | | | | using 1536. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1262 b64f7644-9d1e-0410-96f1-a4d463321fa5
* AC3 from DVD via HB converted to M4V for viewing on ATVeddyg2008-02-141-7/+26
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1261 b64f7644-9d1e-0410-96f1-a4d463321fa5
* account for quantization bias when computing durations for vfr.van2008-01-221-8/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1224 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Set the alternate group for the audio tracks. Does only work when building ↵ritsuka2008-01-191-0/+3
| | | | | | with jam, contrib pack is not updated yet. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1214 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Apply same edit to chapter track as to video track so chapters will stay invan2008-01-061-0/+7
| | | | | | | sync with the video (otherwise they end up 2-4 frames late). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1168 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fill in the "Encoded By:" tag in MP4 files with "HandBrake" followed by the ↵jbrjake2008-01-041-0/+7
| | | | | | version number and build date. Thanks for making me aware that libmp4v2 had an MP4SetMetadataTool() function, realityking. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1164 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fixes a typo in MP4 chapter marker durations. Thanks, van!jbrjake2007-12-291-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1154 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Better b-frame muxing. Instead of using an arbitrarily long offset and then ↵jbrjake2007-12-281-36/+16
| | | | | | | | later walking the file to find the smallest one, now x264 uses the smallest delay it can from the start. This significantly cuts down muxing time. As a side effect, it also makes fixing chapter markers + b-frames easy, so that's included too in muxmp4 (thanks, van!). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1152 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Gives the CLI a separate option for adding the iPod UUID atom to mp4 files, ↵jbrjake2007-11-281-1/+1
| | | | | | instead of it just being a side-effect of using the x264b30 encoder. It's called with -I or --ipod-atom . git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1084 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Optimize MP4 files for HTTP streaming (on the CLI it's -O or --optimize).jbrjake2007-11-211-12/+12
| | | | | | | | Has mpeg4ip run a second pass after muxing is complete, to move the MOOV atom to the beginning of the file. To get this to work, I had to replace a patch from Perian, which has written the avc1 "Compressor Name" in the Pascal string style QuickTime expects. Unfortunately, that patch left mpeg4ip unable to parse its own output, when muxing x264 video. Instead, now the Compressor Name is a blank string, and QuickTime substitutes "H.264" for it. NOTE: This is *not* hinting for RTP streaming, just shuffling the container around so it starts playing faster over the web. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1074 b64f7644-9d1e-0410-96f1-a4d463321fa5
* First attempt at variable frame rate detelecining for NTSC video sources.jbrjake2007-11-101-1/+8
| | | | | | | This check-in includes the library code as well as the CLI implementation. Only works with MP4 and MKV, untested with high profile, results may vary with mixed content, consult a physician if condition persists for longer than four hours. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1051 b64f7644-9d1e-0410-96f1-a4d463321fa5
* This patch from superdump lets muxmp4.c set a Height Ratio for the QuickTime ↵jbrjake2007-10-161-7/+20
| | | | | | transformation matrix. This makes it possible to scale up 4:3 material to 720*540 on playback, instead of displaying it scaled down to 640*480. In other words: true anamorphic 4:3. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1027 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Added rudimentory error handling to HB. Instead of using hb_log() use ↵eddyg2007-08-271-15/+43
| | | | | | hb_error(). Also causes us to stop muxing when we get a write error in MP4 and MKV containers. Still requires macosx dialog box by dynaflash (see main.mm for stub to use). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@869 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Switch buf->key to buf->frametype which is a bitmask telling us what type of ↵saintdev2007-06-171-2/+2
| | | | | | | | | frame we are dealing with. This doesn't change any functionality, but I need to be able to distinguish between x264 IDR and I frames for the upcoming matroska muxer. This also has the side effect of making the code a little easier to read and maintain. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@623 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Finally recommitting clee's patch from r518 to allow 64-bit mp4 files that ↵jbrjake2007-06-131-1/+12
| | | | | | | | can hold more than 4 gigs... controlled by a boolean called job->largeFileSize and enabled from the cli with -4 or --large-file. Note that this breaks compatibility with stuff like the iPod, AppleTV, PS3 (I think), etc...so it is off by default. Also converted a few stray hard tabs into soft tabs. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@618 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Disables extra audio tracks so they don't all play over the main audio track ↵jbrjake2007-06-121-6/+21
| | | | | | in QuickTime. They can be re-enabled from the Properties menu in QT Pro or with Dumpster. Shouldn't have any affect on people who use sane video players. Props to eddyg for reporting the issue, identifying the atom in question, and castigating me for my lazy and unkempt coding ways. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@606 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Various fixes:saintdev2007-04-261-5/+49
| | | | | | | | | - Include parsecsv.c in the Jamfile so we can compile the CLI with Jam - Quiet some compiler warnings in parsecsv.{c,h} - Check some return values in muxmp4.c and encfaac.c and die gracefully if there is a problem. - Correctly set the number of audio channels in the stsd atom. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@552 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix Previous Bad commit for Cyanders Chapter Markersdynaflash2007-04-251-28/+119
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@548 b64f7644-9d1e-0410-96f1-a4d463321fa5
* 64-bit data atoms break some consumer devices. We need to figure out a ↵clee2007-04-171-1/+1
| | | | | | smarter way of doing this. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@520 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Successfully create MP4 files bigger than 4GBclee2007-04-161-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@518 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Prevents a bus error at the end of muxing when b-frames are enabled.jbrjake2007-04-161-0/+3
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@517 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Much better B-frame muxing frame-reordering. This will preserve the sps/pps ↵jbrjake2007-04-161-27/+30
| | | | | | | | info, properly offset the first frame, and flush any remaining frames at the end of the encode. Patch by: Nyx git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@513 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Cleaning up some compiler warnings.clee2007-04-151-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@508 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Ooops. Restores xvid-in-mp4 functionality, which I broke with b-frame ↵jbrjake2007-04-041-3/+3
| | | | | | muxing. (Thanks for the bug report, superdump, and thanks for pointing out where the problem was, saintdev.) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@476 b64f7644-9d1e-0410-96f1-a4d463321fa5
* H.264 B-frame muxing for MP4, including B-pyramids. The latter are QuickTime ↵jbrjake2007-03-301-3/+35
| | | | | | | | incompatible. "Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves." -- Alan Kay git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@464 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Keep the language id for each audio track when using MP4.saintdev2007-03-261-0/+8
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@454 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Added chapter markers in a chapter text track in mp4 files.maurj2007-03-231-2/+45
| | | | | | | | | This option is turned off by default. It can be turned on in the CLI by specifying a "-m" or "--markers" option. it is not yet enabled as an option in the Mac GUI. These chapter tracks are only detected by QuickTime if the file extension is .m4v. If the extension is .mp4, the chapter text track is ignored. To this end, I have made test.c detect .m4v as a file extension for mp4 too. This change has required a substantial change to the mp4v2 library patch. Until the precompiled contrib binaries are updated by Prigaux, try doing "./configure" and then "./jam" (which will build the native contribs, but fail to build UB versions of the apps), and then try "make internal" to compile a native version of the apps. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@440 b64f7644-9d1e-0410-96f1-a4d463321fa5