summaryrefslogtreecommitdiffstats
path: root/libhb
Commit message (Collapse)AuthorAgeFilesLines
* handle YUV422P video in the mpeg2 decoderjstebbins2010-04-021-10/+31
| | | | | | | | if the image format is 422, convert it to 420 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3187 b64f7644-9d1e-0410-96f1-a4d463321fa5
* flush frames x264 has cached properlyjstebbins2010-04-021-2/+4
| | | | | | | | | | waiting until the returned size is == 0 isn't adequate. you must use the function x264_encoder_delayed_frames encoding very short clips resulted in invalid unplayable files. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3186 b64f7644-9d1e-0410-96f1-a4d463321fa5
* when in cfr mode, tell x264 we are doing cfr and allow x264 to set the ↵jstebbins2010-04-021-2/+11
| | | | | | | | | | | timebase to the framerate. fixes compatibility issue with tsMuxer which many PS3 users use. now they can select a specific framerate, which will output cfr video that tsMuxer can grok. we should have been doing this anyway. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3185 b64f7644-9d1e-0410-96f1-a4d463321fa5
* downmix support for ffmpeg audio sourcesjstebbins2010-04-028-91/+1540
| | | | | | | | now we can eat our own dogfood. i.e. aac 6ch discrete input now works, along with any other multi-channel audio ffmpeg can toss at us. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3182 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix a problem processing PS stream that look a lot like DVD PS but are not.jstebbins2010-04-011-0/+17
| | | | | | | | | these streams have start codes that all align on 2048 byte boundaries which makes them look like DVD PS. But within the 2048 bytes, they have multiple pack headers which we were tripping on. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3181 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: change the x264 header NAL array order from sei - sps - pps to sps - ↵dynaflash2010-03-311-4/+4
| | | | | | | | pps - sei as per x265 r1510 - Thanks golgol7777 for the patch! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3180 b64f7644-9d1e-0410-96f1-a4d463321fa5
* handle bluray LPCM streamsjstebbins2010-03-272-25/+87
| | | | | | | | | | | | | | | bluray lpcm uses an stype that is normally used for digicipher. so we use the registration descriptor == HDMV in the PMT to recognize bluray streams. also, ffmpeg doesn't provide a parser for this audio type because none is needed. so when the parser is NULL, pass our buffer data directly to the decoder. Since ffmpeg is doing the decoding, we will still suffer from the same problem with multi-channel ffmpeg streams. So this currenlty only works properly with stereo. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3175 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix sporadic incorrect bitrate calculation of muxed tracksjstebbins2010-03-271-1/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3173 b64f7644-9d1e-0410-96f1-a4d463321fa5
* make it possible to dynamically create and close multiple libhb instancesjstebbins2010-03-265-42/+85
| | | | | | | | | | tweaks to make libhb more usable from a C# app remove pointers from preview filenames, replaces with hb instance and title id's removes only previews upon hb_close, leaves temp dir for hb_global_close git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3170 b64f7644-9d1e-0410-96f1-a4d463321fa5
* reduce mux interleave threshold more to prevent out of memory situationsjstebbins2010-03-191-1/+1
| | | | | | | | | | when skewed timestamps or premature end of a stream is encountered, the muxer buffers streams in an attempt to interleave stream timestamps. this threshold tells it when to give up. The previous value still allowed out of memory conditions with windows 2GB per application limit. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3169 b64f7644-9d1e-0410-96f1-a4d463321fa5
* improve lame audio quality by using ABR mode and disabling joint stereo modejstebbins2010-03-142-2/+38
| | | | | | | add mp3 muxing into mp4 container. cli and gtk gui now support this. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3167 b64f7644-9d1e-0410-96f1-a4d463321fa5
* extend search range for TS re-syncjstebbins2010-03-131-14/+24
| | | | | | | | we were only checking approx the next 16K bytes when sync was lost in a transport stream. now we will continues searching to the end of the file. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3165 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix a crash that happens when subtitle scan selects a subtitle thatjstebbins2010-03-071-0/+1
| | | | | | | is alread in the list of subtitles to encode. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3154 b64f7644-9d1e-0410-96f1-a4d463321fa5
* temporary hack to use old x264 b-pyramid default of 0 (none)jstebbins2010-03-051-0/+3
| | | | | | | | this will be reverted when the gui's and presets are updated to reflect the new default of 2 (normal). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3150 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix incorrect comment in PS detection functionjstebbins2010-02-121-3/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3119 b64f7644-9d1e-0410-96f1-a4d463321fa5
* try harder to identify program streams that do not begin with a pack headerjstebbins2010-02-121-8/+22
| | | | | | | | search deeper into the file for a pack header followed by another start code prefix. Fixes problem with file cut by StreamClip on non-pack header boundary git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3118 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Adjustable picture modulus: Base patch by BradleyS, Thanks BradleyS!dynaflash2010-02-114-32/+34
| | | | | | | - Enables setting modulus for all anamorphic modes (including non-anamorphic) except strict. The job variable "anamorphic.modulus" is repurposed for this and is renamed to simply "modulus" - Other changes: Increases minimum output dimensions to 32x32 pixels in libhb (prevents possible crashes, notably in macgui). Better crop value and maximum crop value calculations to prevent crashes. Some code optimization / refactoring. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3113 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix compiler warning about "definition has no type or storage class"jstebbins2010-02-101-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3108 b64f7644-9d1e-0410-96f1-a4d463321fa5
* put a limit on how many buffers the muxer will cache when it isjstebbins2010-02-091-4/+11
| | | | | | | | | | | having trouble interleaving timestamps This prevents some out of memory crashes. In particular, it fixes a crashed caused by a source in which the audio stream ends substantially before the video stream ends. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3106 b64f7644-9d1e-0410-96f1-a4d463321fa5
* removed test codesr552010-02-062-8/+0
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3102 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb dll fix by RandomEngysr552010-02-062-0/+19
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3101 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix keyint mismatch between 1st and 2nd passes of a 2pass encodejstebbins2010-02-061-10/+5
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3100 b64f7644-9d1e-0410-96f1-a4d463321fa5
* dvdnav: fix seeking on some dvds that use multiple pgc's in a titlejstebbins2010-02-061-2/+7
| | | | | | | | The code that was in place to handle this did not allow for the possibility that there could be sector gaps between the segments git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3098 b64f7644-9d1e-0410-96f1-a4d463321fa5
* use DTS generated by x264 when computing duration and offset in muxmp4jstebbins2010-02-065-117/+101
| | | | | | | | also fix an issue where ffmpeg generated negative PTS for initial frames of video. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3097 b64f7644-9d1e-0410-96f1-a4d463321fa5
* osx doesn't have fread_unlockedjstebbins2010-01-311-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3090 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix problem with reading program streamsjstebbins2010-01-311-1/+33
| | | | | | | | audio PES packets can have sequences that look like start codes in the data so parse PES enough to get the length and skip the data. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3089 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix cancel during p-to-p searchjstebbins2010-01-201-0/+5
| | | | | | | | | when canceling, video sync was closed, but audio sync was stuck waiting on a condition variable. so force audio sync to wake up when video sync closes. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3078 b64f7644-9d1e-0410-96f1-a4d463321fa5
* prevent hang during foreign audio searchjstebbins2010-01-101-4/+5
| | | | | | | was waiting for an audio pts during the indepth scan when there is no audio being processed git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3065 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Added some errors checks and a flush function to encode the remaining data ↵ritsuka2009-12-311-14/+72
| | | | | | | | in the fifo. It may fix the "0.5 seconds of digital noise" issue, but I was unable to reproduce it, so I don't know if it actually helps. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3053 b64f7644-9d1e-0410-96f1-a4d463321fa5
* add point-to-point encodingjstebbins2009-12-238-37/+449
| | | | | | | | | | | | | | allows frame and pts based start points. end points were already previously supported. New job variables pts_to_start and frame_to_start specify the start point. There can be a period during the encode where it has to search for the start point. During this period, libhb sets a new state HB_STATE_SEARCHING and sets progress and eta till start point found. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3039 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Adds a very crude, CLI-only rotation filter to flip pixels vertically (mode ↵jbrjake2009-12-193-1/+390
| | | | | | 1), horizontally (mode 2), or both (mode 3, default). Called with --rotate. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3036 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix potential runaway buffer usagejstebbins2009-12-154-3/+40
| | | | | | | | | | pthread_cond_timedwait can wake early. under certain system load conditions, this happens often. I was going ahead and adding buffers whenever it woke, regardless of whether the condition had actually been met. so the fifo depth would increase until memory ran out. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3030 b64f7644-9d1e-0410-96f1-a4d463321fa5
* bump ffmpeg to svn 20817jstebbins2009-12-141-0/+4
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3028 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix crash with vobsub passthrujstebbins2009-12-131-1/+3
| | | | | | | | the last subtitle buffer was getting added to the buffer pool twice and ultimately freed twice. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3027 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Only display mux stats oncejstebbins2009-12-101-42/+42
| | | | | | | | Close prints mux stats and gets called for each stream. So only print the stats when the last stream is closed. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3023 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix dvdnav read error retry jstebbins2009-12-101-1/+1
| | | | | | | | | the error count was being reset on dvdnav events that didn't involve any actual reading. So we got caught in an very long loop alternating between read failures and valid events. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3022 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Avert a rare race condition.jstebbins2009-12-091-5/+6
| | | | | | | | | | | | | | | | | A bad source can cause reader to call hb_stream_close before decavcodecviWork ever starts. This causes hb_ffmpeg_context to access an invalid pointer. So move the call to hb_ffmpeg_context to after we check for a 0 length buffer in decavcodecvoiWork since reader will have sent this to signal that it has reached the end of the stream. This does not eliminate the race condition, but it does make it much less likely to happen and fixes the specific case where we found this occuring. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3020 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Disables chapter markers when there is only one chapter. Most interfaces ↵jbrjake2009-12-091-0/+6
| | | | | | already do this, but now they have no choice. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3019 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Removes obsolete check for mbtree being off before adjusting render offsets ↵jbrjake2009-12-091-3/+3
| | | | | | for b-pyramid. Also corrects a bit of coding style. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3018 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix buffer leak during indepth scan jstebbins2009-12-083-0/+23
| | | | | | | and fix a couple potential leaks if the timing is just right in work loops git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3016 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Faster combing detection through slightly less stupid use of pointers. Also ↵jbrjake2009-12-081-68/+61
| | | | | | realigns boundary points for the combing mask checker to match what the code actually does. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3015 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Use the correct render offset when b-pyramid is enabled in the x264 ↵jbrjake2009-12-081-39/+24
| | | | | | parameter string but is being disabled inside libx264 due to mb-tree. Thanks, Rodeo, and good catch! Also adds a logging message to note weight-p being disabled in bframeless encodes. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3013 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix detection of forced subtitles during foreign audio searchjstebbins2009-12-071-1/+1
| | | | | | | | | | reader drops all buffers till it finds video or audio. but since video and audio fifos are null when indepth_scan is set, we never see video or audio. Solution is to not drop buffers in indepth scan mode git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3011 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix a double free of an hb_buffer in syncjstebbins2009-12-061-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3010 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Reduce the amount of buffering used and eliminate hb_snooze in the encoding ↵jstebbins2009-12-0511-1049/+1396
| | | | | | | | | | | | | | | | | | | | | | pipeline For HD sources on an 8 core system with hyperthreading, we were using 1.5GB of ram. Add to that the 600MB x264 uses for rc-lookahead, pushes it north of 2GB. To reduce our memory usage, the fifo depths have been reduced are are no longer a multiple of cpu count. Use of hb_snooze has been eliminated in the encoding pipeline so that performance doesn't fall as a result of the reduced fifo depths. In sync, each audio and video were given separate threads so that each can wait on it's respective input fifo without blocking the others. In muxcommon, each stream being muxed was given a separate thread so that each can wait on it's respective fifo. This allows the removal of hb_snooze in the sync and muxer work loops. In both sync and muxer, there is common data that is shared by all threads, so special init routines allocate this shared data and initialize the threads. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3007 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix audio sync problem for AAC (or any other mpeg PS or TS audio decoded by ↵van2009-11-261-66/+31
| | | | | | decavcodec) with a sample rate other than 48KHz. This problem had already been fixed for decavcodecai (the 'internal' ffmpeg audio decoder that handles all input files but mpeg streams) so decavcodec was just changed to use the same logic. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2985 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix title index issue in batch scanningjstebbins2009-11-252-4/+6
| | | | | | | | | title index was assigned as the nth file in the directory, but files that are not video would cause title indexes to be skipped in job.list_title this would mess up the progress bar. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2982 b64f7644-9d1e-0410-96f1-a4d463321fa5
* batch file scanning and scan canceljstebbins2009-11-2514-31/+310
| | | | | | | | | | When a directory is specified as the source, first we attempt to open as a dvd, then if that fails, we attempt to open each file in the directory as a stream source. Since opening a large directory of files can take a really long time, you can also now cancel a scan. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2980 b64f7644-9d1e-0410-96f1-a4d463321fa5
* don't read the entire file looking for audio in transport streamsjstebbins2009-11-251-1/+1
| | | | | | | | if the PMT indicates there is no audio we do not need to continue searching. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2972 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Rate limit hb_error() messages to at most 1 message per second of the same ↵eddyg2009-11-242-4/+77
| | | | | | | | | | | | message. Repeats will be counted and presented as a count when 1 second has elapsed since the first error of a sequence, or an error message with a different string. Also modified dvdnav to use hb_error() to take advantage of the limiting. This works around a real bug from dvdnav where the Mac GUI becomes unresponsive during the output of large numbers of errors. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2971 b64f7644-9d1e-0410-96f1-a4d463321fa5