summaryrefslogtreecommitdiffstats
path: root/libhb/hb.c
Commit message (Collapse)AuthorAgeFilesLines
* Reduce the amount of buffering used and eliminate hb_snooze in the encoding ↵jstebbins2009-12-051-2/+6
| | | | | | | | | | | | | | | | | | | | | | 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
* batch file scanning and scan canceljstebbins2009-11-251-4/+38
| | | | | | | | | | 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
* Maintain an accurate job ETA across pause/resumejstebbins2009-11-071-0/+9
| | | | | | | | Keeps track of how much time is spent paused and factors that into the ETA calculation git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2918 b64f7644-9d1e-0410-96f1-a4d463321fa5
* CLI: SubRip Subtitle importeddyg2009-06-231-0/+2
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2602 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Moved --native-langauge processing from libhb to the CLI. Added --native-dub ↵eddyg2009-06-211-76/+6
| | | | | | option to allow the user to request dubbing instead of subtitles when the audio does not match the users native language. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2594 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Use new appcast URL nameing scheme for HandBrakeCLI --update.konablend2009-06-201-1/+1
| | | | | | | | | - increase storage space hb_handle_s.version[16] to 32 to handle longer version strings; eg. "svn2500 x86_64" - reduce 2-query mechanism to 1-query and only check/notify for newer releases of same type (ie: stable or unstable) - remove hard-coded url and extract host/path components from HB_PROJECT_URL_APPCAST macro git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2586 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - mingw fixes to use fopen() with 'b' flag.konablend2009-06-061-1/+1
| | | | | | | - include pthread.h for pthread_win32 attach/detach decls. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2495 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: correct error in preview scalingjstebbins2009-06-061-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2494 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Adds a keep_display_aspect toggle to the job->anamorphic struct in order to ↵jbrjake2009-06-061-5/+13
| | | | | | fix a bug and implements it in the CLI. Also adds some more anamorphic settings to the job config display. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2492 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Probably a good idea to set the new par width after calculating it.jbrjake2009-06-051-1/+3
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2491 b64f7644-9d1e-0410-96f1-a4d463321fa5
* CLI: Implements custom anamorphic. No more -p or -P. Choices are ↵jbrjake2009-06-051-6/+8
| | | | | | | | | | --strict-anamorphic, --loose-anamorphic, and the new --custom-anamorphic. The last of which also handles --pixel-aspect, --display-width, --itu-par, --modulus, and --keep-display-aspect options. Loose will also obey the pixel aspect and ITU PAR options. Libhb: Fixed a small bug with custom anamorphic working off the source's display aspect even when dealing with a custom display aspect, and made the job config display aware that custom anamorphic exists. Scripts: Updated manicure to write the new anamorphic option names. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2487 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Adds an interjob structure to preserve some encode data across jobs within ↵jbrjake2009-06-041-0/+13
| | | | | | an instance of libhb. This allows correcting the estimated bitrate/filesize of 2-pass encodes of variable framerate content, as the actual frame count is known after the first pass. Thanks for putting the idea into code, Shaya. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2482 b64f7644-9d1e-0410-96f1-a4d463321fa5
* FFMPEG.konablend2009-06-021-3/+3
| | | | | | | | | - bump ffmpeg from 0.5 (approx r17887) to r19067 (thanks van). - fixed latm patch; latmaac input no longer crashes. - removed P02-darwin-h264-dsp-crash. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2469 b64f7644-9d1e-0410-96f1-a4d463321fa5
* softsubtitles:jstebbins2009-06-021-38/+28
| | | | | | | | | | | | | | | | | | - when doing an indepth scan, do not scan CC tracks - separate subtitle configureation attributes into separate hb_subtitle_config_t. Add an instance of this to hb_job_t for setting the attributes of the subtitle found through an indepth scan - Add a default_track flag to hb_subtitle_config_t that tells the muxer that the track should be flaged as the default. muxmkv uses this. - When an indepth scan is complete, check to see if the autoselected subtitle matchces (by id) one of the manually selected subtitles. If a match is found, the autoselected subtitle with all the attributes the user assigned to it replaces the manually selected subtitle. - LinGui: Add "Default" column to subtitle tab. This is a radio that lets the user choose which subtitle should be displayed by default. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2468 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Excises xvid from libhb because it's not worthy. Having two different MPEG-4 ↵jbrjake2009-05-261-2/+0
| | | | | | | | | Part 2 encoders is superfluous and when choosing between ffmpeg and xvid, xvid is the clear loser since we need to keep ffmpeg around for other functions and xvid constantly requires attention to ensure it compiles. MacGui: Removes some stray references to the codec and unlinks it from the Xcode project. CLI: Removes references to the codec and removes it as a dependency. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2448 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - Add CoreAudio AAC as one of the encoder on Mac OS X.ritsuka2009-05-231-8/+31
| | | | | | | - Remove hb_init() and hb_init_express() macro. Rename hb_init_real() to hb_init() - Add two more bitrate combination for audio codecs in common.h git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2441 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Change CC608 decoder to be its own threadeddyg2009-05-071-3/+4
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2396 b64f7644-9d1e-0410-96f1-a4d463321fa5
* VOBSUB encoder skeleton for use with mkv VOBSUB pass-througheddyg2009-05-061-0/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2389 b64f7644-9d1e-0410-96f1-a4d463321fa5
* LinGui: preview changesjstebbins2009-05-041-30/+9
| | | | | | | | | | - update hb_get_preview to allow upscaling and remove borders - allow upscaling in the gui - add user option to show visible cropping borders - gui generates borders when needed instead of hb_get_preview, which allows for flexible alternatives like alternate colors git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2376 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Stage 1 Soft Subtitle Support - Allow multiple subtitle tracks to be ↵eddyg2009-05-041-6/+12
| | | | | | selected, and mark them for Render or Pass Through. No functional difference from the UIs, however in theory they could render multiple tracks - would be a dogs breakfast on screen though, and is untested. Have tested all normal operations from the UIs, including scanning. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2373 b64f7644-9d1e-0410-96f1-a4d463321fa5
* MacGui: Custom Anamorphic initial implementation (experimental) and pic ↵dynaflash2009-05-011-22/+25
| | | | | | | | | | | | | | | | | | | | | settings and preview changes. - Custom Anamorphic mode allows more customization of pixel and display dimensions. -- NOTE: The layout and even functionality are considered very experimental and not ready for prime time yet. -- Change to hb_get_preview allowing a preview size > title->width and height courtesy of jbjake. -- Allows setting the modulus to 16 (default), 8, 4, 2, or 1. -- Adds display height, pixel width and pixel height fields. - Picture Inspector: -- Changes shape and size according to the size/filter tab and anamorphic and filter settings. - Picture Preview: -- Now crops the gray borders from around the image returned from hb_get_preview and recreates cropping and resizing itself. -- Add size and scale information to the preview window title bar so you can see it without activating the hud controls. -- Attempt to fix the intermittent aliasing problem with the hud control overlay by making sure the hud origin is a whole int (fix courtesy of KonaB1end). - Known Issues: -- Scale to Screen mode is currently borked. The actual image does not scale yet. -- Depending on how far you upscale the display dimensions in custom anamorphic, the preview image can get a bit wonky. Returning to one of the standard modes clears it up. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2362 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Remove unneeded preview files at the beginning of a scan.jstebbins2009-03-271-2/+43
| | | | | | | This prevents accumulation of potentially thousands of files during a session git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2282 b64f7644-9d1e-0410-96f1-a4d463321fa5
* reorder some calculations in hb_set_anamorphic_size so that the heightjstebbins2009-03-041-6/+12
| | | | | | | calculated after all adjustments have been made to the width. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2222 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Re-enable libswscale accurate rounding on x86_64.saintdev2009-03-021-4/+1
| | | | | | The libswscale bug causing crashes was fixed a while ago. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2191 b64f7644-9d1e-0410-96f1-a4d463321fa5
* BuildSystem: conversion from jam-based to make-based system.konablend2009-03-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | KNOWN ISSUES: 1. OSX + Xcode builds do not support parallel builds; attempting to use them may cause unbounded number of jobs. However, disabling via configure --disable-xcode avoids the issue. 2. OSX ppc binary produces binary which has audio-scan problems. 3. OSX ppc64 binary has not been runtime tested. ADDED: 00-BuildUserGuide.txt contrib/*/module.* doc/ make/ libhb/module.* test/module.* macos/module.* gtk/module.* DROPPED: BUILD BuildContribDarwin.sh DownloadMacOsXContribBinaries.sh Jamfile Jamrules MacOsXContribBinariesVersion.txt Makefile Makefile.config jam libhb/Jamefile libhb/Makefile test/BUILDSHARED test/Makefile contrib/Jamfile contrib/Makefile contrib/patch-ffmpeg.patch contrib/patch-x264-idr.patch contrib/patch-x264-linux.patch RENAMED: contrib/*.patch -> contrib/MODULE/[AP]??-*.patch macosx/HandBrake.plist -> macosx/Info.plist MODIFIED: libhb/decavcodec.c Patched to use cleaner include "libavcodec/audioconvert". Second part to support this cleanup is ffmpeg A02-audioconvert.patch . MODIFIED: libhb/hb.c MODIFIED: libhb/hb.h MODIFIED: libhb/muxmkv.c MODIFIED: libhb/muxmp4.c MODIFIED: libhb/update.c Patched to use "project.h" for project metadata. Renamed HB_BUILD -> HB_PROJECT_BUILD. Renamed HB_VERSION -> HB_PROJECT_VERSION. MODIFIED: test/test.c: Patched HandBrakeCLI to support I/O on Mac OS X ZFS filesystems. Reference r1803 as similar patch for HandBrake.app . Unpatched behavior is crash/buserror when using ZFS. MODIFIED: macosx/Growl.framework/ Upgraded 0.7.6 (i386,ppc) -> 1.1.2 (i386,x86_64,ppc,ppc64). New architectures facilitate x86_64 and ppc64 builds. MODIFIED: macosx/HandBrake.xcodeproj/ Bumped compatibilty mode from 2.4 -> 3.1 . Dumped old configurations Deployment, Developer. Added configurations standard, sebug as replacements. Added standard.i386, standard.x86_64, standard.ppc, standard.ppc64 . for explicit architecture build. All configurations settings cleaned up and normalized. Build output directories adjusted to support new build system. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2180 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Organizes anamorphic parameters in a struct, requiring some minor search and ↵jbrjake2009-01-261-59/+121
| | | | | | 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
* Consolidate all the ffmpeg-related includes into libhb/hbffmpeg.h then ↵van2008-12-131-4/+1
| | | | | | 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
* fix a threading issue with avcodec_open/closejstebbins2008-12-121-1/+26
| | | | | | | | 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
* fix some floating point rounding errors in aspect ratio calculationsjstebbins2008-12-051-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2009 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Add metadata support to libhb, add importing of MP4 metadata, add export of ↵eddyg2008-12-021-0/+28
| | | | | | 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
* Adds two new parameters to hb_scan, to control the number of preview frames ↵jbrjake2008-11-301-2/+6
| | | | | | | | 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
* 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
* Makes sure loose anamorphic respects max width and height settings, and ↵jbrjake2008-10-181-61/+11
| | | | | | removes a bunch of code by repurposing MULTIPLE_MOD() (thanks j45!). git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1843 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Adds an hb_deep_log() function for multiple levels of debugging verbosity. ↵jbrjake2008-10-091-4/+3
| | | | | | Level 1 displays when hb_log does (job->verbose == 1) and is now meant for logging that helps in tech support. Level 2 adds memory-related logging like freed buffers, and level 3 is for granular stuff that displays once per sample, frame, packet, etc. The debug level continues to be set when hb_init() is called. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1819 b64f7644-9d1e-0410-96f1-a4d463321fa5
* check return value of opendir in hb_close. hb_close was segfaulting whenjstebbins2008-09-111-9/+12
| | | | | | | called a second time to close a second instance of libhb. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1688 b64f7644-9d1e-0410-96f1-a4d463321fa5
* The per-stream timing changes (r1570) make the overall timing depend on ↵van2008-08-181-7/+3
| | | | | | which media streams we process. So we can't ignore audio during pass 1 or the video timing will change between passes & make x264 abort. (Thanks to jbrjake for pointing out the problem.) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1643 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - patch a reference picture leak in ffmpeg/libavcodec/mpegvideo.c that ↵van2008-08-181-2/+0
| | | | | | | | | | | | caused aborts on h264 transport stream encodes. - patch the log level of some h264 decoder error messages so we don't fill our log with messages about stuff that's a very likely & not terribly significant. - don't let hb.c set the ffmpeg av_log level to AV_LOG_DEBUG -- it fills the HB activity log with junk. - add a count of the decoder errors to decavcodec's final report. - when we don't have any chapter text (i.e., during a typical cli encode) just print the chapter number rather than empty quote marks. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1639 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - change aspect from a scaled int to a double so we can handle the widervan2008-08-081-22/+27
| | | | | | | | | | | | | | | | | | | range of aspect ratios we get from ffmpeg files. - add container_aspect to title struct (always zero except for DVDs when it's the aspect from the VTSI). To handle broken French DVDs, make HB complain & use the container aspect if it's different from the aspect computed from the video PAR. - fix ScanFunc's job template init so that it doesn't think the only legal aspect ratios are 16:9 & 4:3. - hb_reduce wouldn't reduce any fraction where both terms were equal and prime (e.g., 2/2, 3/3, 5/5, etc. would not become 1/1). Recoded it using Euclid's Algorithm so it always works and is faster. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1616 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fixes loose anamorphicjbrjake2008-06-041-4/+5
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1491 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Keep track of the input pixel aspect ratio as well as the output one. ↵jbrjake2008-06-041-2/+3
| | | | | | Hopefully doesn't break anything. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1489 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - support blu-ray, avchd & dvb x264van2008-05-311-5/+7
| | | | | | | - support video files handled by ffmpeg (avi, mkv, mp4, etc.) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1480 b64f7644-9d1e-0410-96f1-a4d463321fa5
* git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1471 ↵jbrjake2008-05-291-32/+36
| | | | b64f7644-9d1e-0410-96f1-a4d463321fa5
* Move clock recovery code from reader to demuxmpeg so it sees all frames & ↵van2008-04-151-5/+1
| | | | | | not just the ones we happen to be encoding. This change gives a more accurate clock and allows us to once again ignore audio during pass 1 of a 2 pass encode. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1420 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fixes for different number of frames between pass 1 & 2, missing frames at ↵van2008-04-131-1/+5
| | | | | | | | | | | | end, and an deadlock with pcm audio. - since the SCR clock recovery is done in reader.c we can't currently skip audio frames during pass 1 or we miss clock changes signaled by those frames & end up dropping more video frames in pass 1 than pass 2. - since many modules buffer frames we can't tell if we're done just by looking for empty fifos. Send an empty buffer to mark end-of-stream all the way along the processing pipeline & use it to flush internally buffered data. - in a processing pipeline you're done when the end of the pipe says your done. add a thread status variable so we can tell when individual threads are finished then make do_job wait until the encoder thread is done so that we're sure all the frames have been processed and sent to the muxer. - since the muxer alternates between reading video & audio packets we have to have enough buffer in the audio pipeline to handle a video-frame's worth of audio packets (33ms). Since pcm packets are <1ms we need >60 slots in the audio fifos or we'll deadlock. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1412 b64f7644-9d1e-0410-96f1-a4d463321fa5
* New internal audio handling.saintdev2008-04-011-29/+20
| | | | | | | | 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
* = Adds an hb_detect_comb() function that indicates whether or not a frame ↵jbrjake2008-03-231-0/+106
| | | | | | | | | shows interlacing artifacts. - Utilitizes that function in scan.c to analyze the preview frames - Sets a new title->detected_interlacing variable to true if half or more previews show combing, and warns the user in the log. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1359 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libswscale accurate rounding is now re-enabled for all arches except x86_64.saintdev2008-03-211-4/+9
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1353 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Theora.saintdev2008-03-201-0/+1
| | | | | | | | This adds the theora encoder to the Xcode project as well. It does not enable anything in the Mac GUI, just allows it to build. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1350 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Formatting: Remove a lot of trailing whitespace.saintdev2008-02-211-56/+56
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1307 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Maintains separate filter settings for each job. This prevents the MacGui ↵jbrjake2008-01-221-1/+15
| | | | | | from using the same filter settings for every job in the queue. Patch from travistex. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1228 b64f7644-9d1e-0410-96f1-a4d463321fa5