summaryrefslogtreecommitdiffstats
path: root/libhb/stream.c
Commit message (Collapse)AuthorAgeFilesLines
* libhb: don't use deprecated elements of the FFmpeg/Libav APIjstebbins2011-04-281-20/+14
| | | | | | | | | | | | | HandBrake uses many attributes of the FFmpeg API that are were deprecated when we did the last bump. Many of them no longer exist in current FFmpeg/Libav git, or are going to be removed soon. Replaces them with non-deprecated attributes that already exist in the build we currently use. Thanks to Rodeo for the patch. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3964 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Make order of audio tracks found in PS streams more predictablejstebbins2011-04-251-1/+10
| | | | | | | | | Since PS streams don't have a directory of streams, we find them by scanning the PES headers for stream types. We were adding them in the order found which is pretty random. This sorts audios by substream id. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3958 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix a problem when encoding the same source audio track twice from BD sourcesjstebbins2011-04-251-5/+23
| | | | | | | | | The pid and substream were being added to the TS stream list twice which caused 2 copies of each packet to be returned to reader. This caused sync to drop every second packet with "time went backwards" log message. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3957 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Add support for TrueHD and DTS-HD from BD sourcesjstebbins2011-04-221-483/+761
| | | | | | | | | | | | | | TrueHD and DTS-HD now show up in the audio list along side their AC-3 and DTS counterparts. Note that currently the DTS-HD decoder we are using (ffmpeg) discards the HD portion of the stream and onle decodes the DTS core portion. So there is no advantage yet to using the DTS-HD stream. In the future I would like to add DTS-HD passthru support and hopefully ffmpeg will improve their DTS-HD decoder. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3950 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Change internal audio representation rangejstebbins2011-04-081-0/+1
| | | | | | | | | | | ...from float [-32768...32767] to float [-1.0...1.0] Using the range [-1.0..1.0] requires fewer translations of the range for our various encoders and decoders. This also gets rid of a hacky translation from float to int to float in decavcodec audio decoding. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3908 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Flush ffmpeg codec buffers after every seek.jstebbins2011-04-021-1/+21
| | | | | | | | | | According to several e-mails I've read on ffmpeg-devel, avcodec_flush_buffers should be called after any seek. It appears this is even more critical to do when using frame based multi-threading. I don't see any immediate difference in functionality by adding this, but it may prevent surprises in the future. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3896 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix garbled previews from BD h.264 sourcesjstebbins2011-04-021-1/+4
| | | | | | | | | | | Forome reason, frames that are tagged as recovery points in many BD h.264 streams do not result in complete frames when decoded. Pushing 2 extra frames through the decoder seems to always fix this. This patch extends something I was already doing when generating previews from a BD structure. This just applies the same logic to ffmpeg streams that have h.264 video. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3895 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix chapter passthru problems with some files.jstebbins2011-03-291-0/+1
| | | | | | | | | | | | If the video stream is not the first track in the file, chapters were lost. During scan, we identify which track is video and stash this in title. While reading, when a chapter is found we want to tag the next video buffer. But the video track id stored in the title was not being applied when opening the file for reading, so the chapter mark always went on track id 0. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3889 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Add support for DTS-HD High Resolution Audio for BD streamsjstebbins2011-03-191-5/+29
| | | | | | | Thanks to Rodeo for the patch. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3851 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Use ffmpeg's lock manager for locking needed by ffmpegjstebbins2011-03-101-1/+1
| | | | | | | | This lets ffmpeg tell us when it needs a lock instead of us trying to guess which functions we need to wrap in a mutex. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3834 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Remove a workaround for an ffmpeg bug that has been fixed.jstebbins2011-03-081-11/+0
| | | | | | | | | Removal of the workaround also removes the need for a patch that fails to apply cleanly to latest ffmpeg git. So remove the patch as well. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3833 b64f7644-9d1e-0410-96f1-a4d463321fa5
* silence compiler warning about const char *jstebbins2011-03-011-1/+1
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3822 b64f7644-9d1e-0410-96f1-a4d463321fa5
* bump ffmpeg from git-185a155 to git-0b32da9jstebbins2011-02-271-1/+1
| | | | | | | fixes win64 crash git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3818 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Remove unnecessary translation of string "LIBFAAD" to "AAC".jstebbins2011-02-111-4/+0
| | | | | | | | ffmpeg will never give us this name anymore since it no longer wraps faad. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3795 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix issue with decoding DTS-HD streamsjstebbins2011-02-081-17/+17
| | | | | | | | We now inspect the new profile member of AVCodecContext to determine if the stream is DTS or DTS-HD and send it to the appropriate decoder. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3785 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix ffmpeg multiple audio decode issuejstebbins2011-01-171-1/+1
| | | | | | | | we can now have one ffmpeg audio input track fan out to multiple output tracks. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3753 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix a problem reading flv files that have null packetsjstebbins2011-01-021-0/+6
| | | | | | | | ffmpeg will return error code EAGAIN for these packets. we were terminating when seeing this error code. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3724 b64f7644-9d1e-0410-96f1-a4d463321fa5
* bump ffmpeg from r25374 to r25689jstebbins2010-11-101-7/+12
| | | | | | | brings back LATM support git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3669 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Fix use of uninitialized variable in mpeg PS detection.jstebbins2010-11-071-1/+1
| | | | | | | This could easily cause PS detection to fail. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3656 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Add code to recognize eac3 streams in TSjstebbins2010-10-051-4/+26
| | | | | | | | Recognizes BD, HDDVD, and DVB variations of signalling eac3 streams. Let me know if you find streams that don't work. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3572 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix ffmpeg locking issuejstebbins2010-10-021-1/+1
| | | | | | | | | | ffmpeg complained "insufficient thread locking around avcodec_open/close()". This was caused by encavcodec.c calling avcodec_open at the same time as stream.c called av_find_stream_info. av_find_stream_info has a side effect of calling avcodec_open, so we must lock around this call as well. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3563 b64f7644-9d1e-0410-96f1-a4d463321fa5
* SSA subtitle burn injstebbins2010-09-281-0/+50
| | | | | | | | | | Anime fans rejoice! This patch adds SSA subtitle burn-in support with libass. Therefore SSA subtitles should now be rendered in full quality, with the appropriate embedded fonts and positioning information. Thanks to davidfstr git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3557 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix a crash when a TS has no aspect ratio set in the video streamjstebbins2010-09-141-0/+6
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3529 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Bump ffmpeg from 22950 to 25082jstebbins2010-09-141-1/+6
| | | | | | | | | | | | | | It's been 5 months since an ffmpeg bump. One negative is that we loose LATM support. The LATM patch is just impossible to apply anymore since ffmpeg dropped support for using the external faad lib. There are ifdef's in the code should anyone wish to revert to an earlier ffmpeg and enable LATM. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3526 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Add Bluray supportjstebbins2010-09-081-492/+633
| | | | | | | | | | | | | | | | | | Unencrypted BD directory trees only. Doesn't support iso images. Also, no PGS subtitle support yet. Chapters and angles are supported. Adds a new contrib libbluray. Adds new option to hb_scan() for duration of short titles to filter. This applies to BD and DVD multi-title scans only. Does not apply to any single title scans. Fixes memory leak during scan. hb_buffer_close() was not freeing all buffers in a chain of buffers passed to it. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3510 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Improve program stream detectionjstebbins2010-06-281-17/+49
| | | | | | | | | We were getting some false positives on some files. In some cases this would lead to a crash. In all cases it leads to a failure to scan or encode properly. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3418 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Add SSA subtitle supportjstebbins2010-06-011-3/+4
| | | | | | | Thanks to davidfster git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3342 b64f7644-9d1e-0410-96f1-a4d463321fa5
* add check for reasonable vobsub width/height values when parsing out of mp4jstebbins2010-05-301-2/+10
| | | | | | | if the values aren't good, use default of 720x480 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3338 b64f7644-9d1e-0410-96f1-a4d463321fa5
* preserve vobsub palette, width, and height from mkv and mp4 vobsub tracksjstebbins2010-05-301-20/+67
| | | | | | | Thanks to davidfster for mp4 palette addition. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3337 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Support for reading VOB subtitle tracks from file inputs initital ↵dynaflash2010-05-201-5/+76
| | | | | | | | | | | | | | implementation. - Patch by davidfstr, Nice Work! - Adds support for reading VOB subtitle tracks from file inputs. Tested with: - MKV VOB -> MKV VOB passthru. - MKV VOB -> MKV VOB burned in. VOB subtitle palette moved from per-title to per-track. Discussion leading up to commit can be referenced here: http://forum.handbrake.fr/viewtopic.php?f=4&t=16267 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3308 b64f7644-9d1e-0410-96f1-a4d463321fa5
* Universal Text Subtitle Support Initial Implementationdynaflash2010-05-041-0/+74
| | | | | | | | | | | | | - Patch by davidfstr ... Thanks! - Adds support for reading TEXT subtitle tracks from file inputs - Tested combinations: -- MKV UTF-8 -> MKV UTF-8 (passthru) -- MKV UTF-8 -> MP4 TX3G (upconvert) -- MP4 TX3G -> MKV UTF-8 (downconvert) -- MP4 TX3G -> MP4 TX3G (downconvert to UTF-8 then upconvert) - Further explained here http://forum.handbrake.fr/viewtopic.php?f=4&t=16099 git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3283 b64f7644-9d1e-0410-96f1-a4d463321fa5
* bump ffmpeg to rev 22950jstebbins2010-04-251-3/+18
| | | | | | | | | offset ffmpeg seeks by value of initial timestamp since it can be non-zero catch pix fmt that is unsupported by swscale, log it, skip the track use new ffmpeg avg_frame_rate for more accurate framerate estimate git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3267 b64f7644-9d1e-0410-96f1-a4d463321fa5
* add test to ensure that ffmpeg's reported audio layout agrees with channel countjstebbins2010-04-241-2/+8
| | | | | | | | | a crash report from a user leads me to believe ffmpeg is giving us a channel layout that has a different number of channels than the channel count it tells us. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3260 b64f7644-9d1e-0410-96f1-a4d463321fa5
* downmix support for ffmpeg audio sourcesjstebbins2010-04-021-13/+14
| | | | | | | | 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
* handle bluray LPCM streamsjstebbins2010-03-271-20/+63
| | | | | | | | | | | | | | | 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
* 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 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
* use DTS generated by x264 when computing duration and offset in muxmp4jstebbins2010-02-061-0/+11
| | | | | | | | 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
* add point-to-point encodingjstebbins2009-12-231-0/+23
| | | | | | | | | | | | | | 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
* bump ffmpeg to svn 20817jstebbins2009-12-141-0/+4
| | | | git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3028 b64f7644-9d1e-0410-96f1-a4d463321fa5
* batch file scanning and scan canceljstebbins2009-11-251-0/+2
| | | | | | | | | | 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
* fix an off-by-one error in assignment of audio stream registration descriptorjstebbins2009-11-091-26/+28
| | | | | | | | | | | | | | format. This sometimes caused the misdetection of TrueHD audio since it would be tagged as the format of the stream following it in the PMT. Also fix a problem in PMT parsing that I stumbled upon while investigating the above problem. If a PMT has a PID listed more than once for some reason, we would add that PID multiple times to our stream list. And if it happened to be a video PID that is duplicated, the duplications would be interpreted as audio PIDs. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2920 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix a couple transport stream issuesjstebbins2009-10-231-9/+46
| | | | | | | | | | | | | | | when the first packet seen is audio, the stream timing for the audio must be initialized a little different then when it follows video add a more thorough check for duplicate packets. a ts stream that is the result of splicing multiple clips together can have duplicate continuity count values. usually this means that a duplicate packet exists and the duplicate is dropped. but in the case of spliced clips, the packet should not be dropped. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2895 b64f7644-9d1e-0410-96f1-a4d463321fa5
* fix VC1 I-frame detection in ffmpeg_is_keyframejstebbins2009-10-061-1/+1
| | | | | | | | | The pattern was incorrect, so we were pretty much always starting on a non-I-frame when creating previews from VC1 ffmpeg sources. This fixes the grey preview complaints several users have had. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2870 b64f7644-9d1e-0410-96f1-a4d463321fa5
* libhb: don't truncate last chapter of a streamjstebbins2009-08-091-1/+2
| | | | | | | | | | | | | When an ffmpeg stream doesn't have chapters, we insert a dummy chapter into our chapter list that has the same duration as the title. But the title duration is only a guess. Later, when the chapter end time is reached, we increment the chapter number. In the reader, we exit if the current chapter number is greater than the last chapter. This patch only increments the chapter number in stream if there is actually another chapter. This way reader will continue till the file is exhausted git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2757 b64f7644-9d1e-0410-96f1-a4d463321fa5
* - Some DVB programs have a lot of streams (20 for BBC HD) so up max from 16 ↵van2009-07-131-1/+5
| | | | | | | | | to 32 - If we find a DVB AC-3 stream descriptor mark the associated stream as AC-3 so we don't mistakenly type it as MPEG-2. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2687 b64f7644-9d1e-0410-96f1-a4d463321fa5