summaryrefslogtreecommitdiffstats
path: root/libhb
Commit message (Collapse)AuthorAgeFilesLines
* AC3 dynamic range compression changes. 0 now means a null DRC function. 1 ↵jbrjake2009-02-052-3/+10
| | | | | | | | remains the same (default DRC) and >1 still boosts soft sounds. For the moment, presets and interfaces still assume a default of 1, but the notion is to move to having 0 as the default, in the hope it will be louder/clearer. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2119 b64f7644-9d1e-0410-96f1-a4d463321fa5
* With live preview decmpeg2 can be running more than once simultaneously, so ↵jbrjake2009-02-051-25/+25
| | | | | | the crude cadence tracking (Film->Video messages) needs to go in the hb_libmpeg2 struct...where I should have put it in the first place. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2118 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Don't let an invalid PES header length (from a corrupted packet) cause us to ↵van2009-01-281-8/+9
| | | | | | crash in memcpy. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2103 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Organizes anamorphic parameters in a struct, requiring some minor search and ↵jbrjake2009-01-2611-118/+179
| | | | | | replace changes in the interfaces. Folds the logic for strict anamorphic mode into hb_set_anamorphic_size() and also stakes out a new, more customizable mode 3. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2097 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Update libmkv and start writing mkv tags, no artwork as yet - haven't had ↵eddyg2009-01-201-0/+14
| | | | | | time to do it, sorry. I also had a hard time testing that the tags work. But I could see that they were present in the file, and I could see that it didn't affect playability. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2090 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Don't resync based on subtitles since their average duration is meaningless.van2009-01-151-12/+43
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2087 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Add importing of ffmpeg input chapters.ritsuka2009-01-142-8/+33
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2082 b64f7644-9d1e-0410-96f1-a4d463321fa5
* h.264 i frame shouldn't be marked as sync sample.ritsuka2009-01-121-1/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2077 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Always use the track samplerate as the timescale for audio tracks. This ↵ritsuka2009-01-111-2/+2
| | | | | | fixes a problem when creating an mp4 with multiple audio tracks that have different samplerate. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2074 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Remove some unused variablesritsuka2009-01-111-10/+0
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2073 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Bumps mp4v2 to r224jbrjake2009-01-111-5/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2072 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Get previews from H.264 content even if it's missing IDR frames (e.g., NZ TV ↵van2009-01-104-148/+176
| | | | | | | | | | | | & some blu-rays): - Grab stream characteristics (IDRs or not, PCRs or not, RAPs or not) while we're reading to compute the duration rather than trying to guess with no information later. - Only wait for an IDR after a seek if we know the stream has IDRs. Even then, wait for at most 255 frames. - If the stream doesn't have IDRs tell scan (via a new flag in the title struct) so that it can read but discard a second's worth of frames to get the decoder in sync withe stream. - While we're trying to sync the decoder, ffmpeg will spit out dozens of useless error messages so suppress them. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2071 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - have to account for a non-zero start time when we're seeking in ffmpeg files.van2008-12-131-13/+60
| | | | | | | | - try harder to get keyframes from ffmpeg files: if we've just done a seek, search the next 50 frames for a keyframe. - detect WMV3 keyframes since ffmpeg doesn't. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2027 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - try to determine the sample rate, channels, etc., of audio streams rather ↵van2008-12-131-12/+71
| | | | | | | | | than hardwiring 48KHz & 2 channels. - have to discard audio that starts before video time zero otherwise we desync the audio & video. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2026 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Consolidate all the ffmpeg-related includes into libhb/hbffmpeg.h then ↵van2008-12-1312-20/+22
| | | | | | prototype hb_avcodec_{init,open,close} so that we don't get gcc warnings from a dozen modules. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2025 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Loosen tolerance on Program Stream SCR change - 100ms is too tight for an ↵van2008-12-121-1/+1
| | | | | | EyeTV S-Video capture. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2024 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix a threading issue with avcodec_open/closejstebbins2008-12-127-16/+41
| | | | | | | | these functions can not be called from 2 threads simultaneosly. made a wrapper function that holds a lock while making the call git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2023 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Don't reject MPEG PS files just because they're missing a SYS header (clips ↵van2008-12-111-7/+7
| | | | | | won't have one). The standard says we just need a PACK header followed by some other legal start code. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2018 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Improve duration calculation for transport streams. Streams that havejstebbins2008-12-101-3/+5
| | | | | | | | | many discontinuities (like concatenated blu-ray m2ts files) are handled better. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2017 b64f7644-9d1e-0410-96f1-a4d463321fa5
* If we don't get signed 16 bits samples from the audio decoder, convert to ↵van2008-12-061-0/+37
| | | | | | signed 16 bit. (Fix for the pcm_u8 audio generated by Canon cameras.) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2014 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix some floating point rounding errors in aspect ratio calculationsjstebbins2008-12-052-4/+4
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2009 b64f7644-9d1e-0410-96f1-a4d463321fa5
* More code to deal with the flakey streams from NZ TV. They like to change ↵van2008-12-055-33/+18
| | | | | | the PCR without sending a new PCR and we get big timestamp changes but no new reference clock. So now we look at the PTS and if its change is outside a tolerance window we use the new PTS as a PCR & declare a clock discontinuity. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2008 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb:sr552008-12-041-1/+8
| | | | | | The malloc() function in cygwin doesn't return 16-byte aligned memory which causes it to randomly crash. Replaced with memalign() for the cygwin platform only. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2006 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - validate frame sync the way the standard suggests (via checking the frame ↵van2008-12-042-97/+169
| | | | | | | | | | | | crc) rather than looking at multiple frames. This should reduce the probability of mis-identifying random junk as AC-3 to less than 1 in 2^32. - check the crc on every frame so we don't let corrupted data into the decoder. - interpret the PTS as per the standard (it's the time of the first frame that starts in the packet, not the time of the first byte of the packet). Incorrect interpretation was resulting in an average 15ms timing error (worse case 31ms). - do all the PTS calculations in doubles so we don't get round-off error that will desync the audio & video with 44.1KHz audio sources (these can't appear on DVDs but do show up in avi/mkv/... files). - don't rely on the container to give us large enough frame fragments to validate the sync (some containers split audio frames into really small pieces). Instead use the 8K of unused space in the esconfig of the audio object as an accumulation buffer. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2002 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - Elementary streams that scan couldn't type as audio streams have to be ↵van2008-12-041-15/+56
| | | | | | | | | | completely ignored - some of these don't follow the normal PES packet encoding so feeding them downstream to the demuxer will cause strange timing and other problems. - make log message correctly reflect our uncertainty about audio stream type so people don't complain about missing AC-3 audio when it isn't really there. - add missing av_free_packet in VC-1 keyframe search. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2001 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Found the ffmpeg initialization problem with VC-1 video. jstebbins2008-12-032-12/+115
| | | | | | | So now we can use our own demuxer for streams with VC-1. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1995 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - allow titles with video but no audio.van2008-12-021-9/+4
| | | | | | | - don't throw away previews just because we hit eof while trying to find audio info. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1993 b64f7644-9d1e-0410-96f1-a4d463321fa5
* I suspect that eddyg's r1987 didn't really want to totally break transport ↵van2008-12-021-0/+5
| | | | | | and program streams ... git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1992 b64f7644-9d1e-0410-96f1-a4d463321fa5
* git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1991 ↵sr552008-12-021-1/+1
| | | | b64f7644-9d1e-0410-96f1-a4d463321fa5
* Add metadata support to libhb, add importing of MP4 metadata, add export of ↵eddyg2008-12-0211-128/+460
| | | | | | 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
* Fix one massively stupid & one moderately stupid bug I introduced into the ↵van2008-11-301-2/+21
| | | | | | DTS PTS handling. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1976 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Adds two new parameters to hb_scan, to control the number of preview frames ↵jbrjake2008-11-306-30/+52
| | | | | | | | generated during scan, and whether or not they're written to disk for later display. This will break any interfaces that use hb_scan until the new params are specified...sorry. Also adds a new job->seek_points setting (set this to the same as the number of previews) to be used with job->start_at_preview when doing live preview encodes, so the seek function has a frame of reference. Wires up the CLI with a --previews option (long option only) to control the new scan parameters, and defaults the CLI to not writing previews to disk. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1970 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Don't allow multiple decodes of the same ffmpeg audio stream. Because ffmpeg ↵van2008-11-291-4/+22
| | | | | | | | | mixes stream reader state with decoder state we only have one decoder instance for the streamso multiple decode requests will garble the audio and/or cause an abort. (Since the Universal preset specifies AC-3 passthru, using it on non-ac3 audio caused a second decode of the first audio track to be requested which triggered this bug and resulted in lots of aborts for wmv & avi conversions.) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1969 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix 5.1 channels map for vorbis.ritsuka2008-11-271-6/+19
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1965 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - add John A. Stebbins' changes to handle TrueHD and DTS-HD multiplexed ↵van2008-11-256-370/+401
| | | | | | | | | | streams. - give transport streams their own demuxer rather than constructing fake PS packets to use the DVD demuxer. - start re-doing the transport stream code so it does fewer memory to memory copies. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1953 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - get rid of an unnecessary seek that was messing up either mkv or vc1 ↵van2008-11-191-2/+16
| | | | | | | | | | decoding. - switch av_seek_frame to zero back to time-based rather than byte-based since time-based screws up mkv & mp4 while time-based works for everything but vc1. - since ffmpeg doesn't correctly indicate key frames in vc1 look for them ourselves so that vc1 previews & cropping will work. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1927 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Don't abort when the ffmpeg vc1 decoder hands us a bogus packet sizevan2008-11-181-0/+7
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1925 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - search for IDR frames in blu-ray (m2ts) inputs so we get useful previewsvan2008-11-161-5/+35
| | | | | | | - don't require a key frame after we seeking to the beginning of the file (this was probably causing the leading PPS & SPS of some blu-ray h.264 content to get dropped which resulted in a few seconds of missing video). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1923 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix pmt processingjstebbins2008-11-111-14/+24
| | | | | | | | | | | | | | there were 2 problems 1. when the program list in the pat contains a network PID, the pmt parsing code doesn't properly skip this entry. this causes attempts to interpret a pat as a pmt since the pid entry in the table is left initialized to 0. 2. pmt parsing always waits till the start of the second pmt section before parsing the first. if for some reason there were only one pmt in the stream, it would never parse the pmt. I've changed it to parse the pmt as soon as all the necessary bytes are collected. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1916 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb support for live previewjstebbins2008-11-113-29/+65
| | | | | | | | set job->start_at_preview to the preview frame you want to start at set job->pts_to_stop to the number of 90khz ticks duration git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1915 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Bumps libtheora to 1.0 final and fixes a small problem with r1905's chroma ↵jbrjake2008-11-091-1/+1
| | | | | | rounding re: Theora. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1909 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Hack to make VC1 work: If we get a ts or m2ts with VC1 video, don't say we ↵van2008-11-091-0/+16
| | | | | | have a valid stream. This will cause HB to try to open it with ffmpeg which often can read VC1 TS streams. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1908 b64f7644-9d1e-0410-96f1-a4d463321fa5
* If 'auto' audio output rate is selected and that results in an invalid rate ↵van2008-11-091-0/+37
| | | | | | for AAC, select the next higher valid rate. This should make wmv's & avi's with weird audio rates more likely to work with the default HB settings. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1907 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Correct chroma size for raw video frames - width & height need to be rounded ↵van2008-11-0813-29/+41
| | | | | | up if they're odd before dividing by 2. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1905 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - Always use HandBrake's DTS decoder rather than ffmpeg's even for inputs ↵van2008-11-082-6/+23
| | | | | | | | | | we read via ffmpeg so that we get the user-specified mixdown. Otherwise we eventually abort in the sample rate converter or audio encoder. - Teach HB's DTS coder to handle implicit timestamps so that it doesn't screw up on mkv's & some m2ts inputs. - mkv's produced from Bluray HD content seem to have large timestamp errors - filter them out in the decoder so that sync doesn't drop big chunks of our audio. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1904 b64f7644-9d1e-0410-96f1-a4d463321fa5
* clean up picture allocation in hb_get_preview and fix minor picture corruptionjstebbins2008-11-071-9/+12
| | | | | | | that happens when the width is not divisible by 8. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1901 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Minor tweaks the job config display for the COLR atom: only show when not ↵jbrjake2008-11-011-9/+3
| | | | | | using a default value, display with the name "color matrix" instead of "color space" to avoid confusion with conversions to YUV420 planar color space, and appear with the other container settings instead of video settings. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1889 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix for mpeg content that changes size in the middle of a decode (such as ↵van2008-10-301-17/+66
| | | | | | | | | Doctor Who season 1 disc 2 title 4). Problem reported in http://forum.handbrake.fr/viewtopic.php?f=4&t=4306 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1880 b64f7644-9d1e-0410-96f1-a4d463321fa5
* ETSI TS 102 366 V1.2.1 compliant AC3 in MP4, replaces older hacked version ↵eddyg2008-10-295-2/+123
| | | | | | 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
* Get rid of the black frame & long silence at the beginning of avi & wmv ↵van2008-10-261-0/+8
| | | | | | files that have a non-zero 'start' specified in their header. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1868 b64f7644-9d1e-0410-96f1-a4d463321fa5