summaryrefslogtreecommitdiffstats
path: root/libhb/decavcodec.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix dropped audio when embedded CC sub is selectedJohn Stebbins2019-07-151-2/+3
| | | | | | | The subtitle ID assigned to CC embedded in video collided with regular track IDs in some file types. Fixes https://github.com/HandBrake/HandBrake/issues/2103
* Fix gcc 9 compiler warningsJohn Stebbins2019-06-281-2/+3
| | | | | gcc 9 is quite a lot chattier and clutters the build log with useless information :\
* decvcodec: fix building with QSV disabledJohn Stebbins2019-05-271-1/+1
|
* qsv: zero-copy re-implementationmaximd332019-05-261-38/+47
|
* libhb: pass AV_PKT_FLAG_DISCARD through to decoderJohn Stebbins2019-05-021-0/+7
| | | | | | | | Edit list cuts are not always on keyframe boundaries and therefore sometimes require dropping frames after decoding them. AV_PKT_FLAG_DISCARD tells us when to do this. Fixes https://github.com/HandBrake/HandBrake/issues/1900
* qsv: use HB_PROJECT_FEATURE_QSV instead of USE_QSVJohn Stebbins2019-04-171-12/+12
|
* avfilter: split individual filters to separate filesJohn Stebbins2019-04-081-6/+6
| | | | | | Splits the initialization of pad, cropscale, deinterlace, rotate, and colorspace into their own files. Also splits internal avfilter API into it's own file.
* libhb: change preset key to VideoColorMatrixCodeOverrideJohn Stebbins2019-04-081-2/+42
| | | | | | Reserve VideoColorMatrixCode for doing color conversion. VideoColorMatrixCodeOverride sets color flags without transforming video frame colors.
* libhb: propagate color matrix info through the pipelineJohn Stebbins2019-04-081-5/+12
| | | | | | | | | Propagates pix_fmt, range, primaries, transfer, and matrix everywhere. Everything that passes or creates video frames tags the frames with their color matrix info. All filters know the expected color matrix info of input frames.
* avfilter: simplify internal API to avfilterJohn Stebbins2019-04-081-144/+45
| | | | | | Use this interface in decavcodec. Remove cropscale.c and use avfilter for crop and scale. Improve log output of filters that are aliases for avfilter.
* decavcodec: fix setting up AVCodecContext extradataJohn Stebbins2019-02-141-8/+9
| | | | | It was getting set up, but then deleted right after in avcodec_free_context.
* Add WebM support (#1822)Justin Bull2019-02-131-1/+1
| | | Note that since webm has no official subtitle support, only burned in subtitles can be used with this muxer at this time.
* decavcodec: fix error when ffmpeg parser changes the codec_idJohn Stebbins2019-02-111-4/+17
| | | | | | | | | | | | | | | | | | | | | | | The ffmpeg mpeg2 parser changes AVCodecContext.codec_id on the fly based on what it parses. Normally this results in correct switching of decoders internally in ffmpeg. Due to some unfortunate ordering of how we initialize things when HandBrake is using our own demuxers, avcodec_open gets called with the original AVCodec and the AVCodecContext.codec_id that was changed by the parser resulting in an error. Further explanation... When using our own demuxers, there are some codecs that we have to parse out the extradata for _prior_ to calling avcodec_open. avcodec_open fails if extradata isn't initialized for these codecs prior to the call. To initialize the extradata, we use parser->parser->split. I.e. the parser must be initialized and used prior to calling avcodec_open. When avcodec_open is called, it is using the original AVCodec that was used with avcodec_alloc_context3 (it will fail if AVCodec is not the same between avcodec_alloc_context3 and avccodec_open). The call to avcodec_open fails with "Codec type or id mismatches" since AVCodecContext.codec_id no longer matches AVCodec.id due to the parser changing the codec_id. The solution is to reset AVCodec and reallocate the context when we detect that the parser has changed codec_id on us.
* decavcodec: fix more potential uses of uninitialized variablesTim Walker2019-01-081-6/+6
| | | | | | Fixes a crash I experienced locally following 76f14dad963db46961ce3d425a102ac3d898ce10 Inspired by 3c95342a8cdf5b3b03d8b5e94ec099b0bc6a4f35
* fix missing frames when transcoding m2ts filesJohn Stebbins2019-01-071-0/+66
| | | | Fixes https://github.com/HandBrake/HandBrake/issues/1611
* decavcodec: fix potential use of uninitialized variablesJohn Stebbins2019-01-051-2/+2
|
* Update copyright dates to 2019.Bradley Sepos2019-01-011-1/+1
|
* decavcodec: fix use after freeJohn Stebbins2018-11-071-1/+1
| | | | | Symptom was a crash at the end of subtitle scan. Fixes https://forum.handbrake.fr/viewtopic.php?f=13&t=38379
* decavcodec: packetize data before searching for extradataJohn Stebbins2018-11-061-197/+158
| | | | | | The necessary data for setting up extradata may be scattered across multiple input buffers. The buffers must be combined before extradata can be extracted.
* audio_resample: switch from avresample to swresampleJohn Stebbins2018-06-271-1/+2
| | | | Eliminates deprecation warnings for avresample
* decavcodec: fix crash during audio probeJohn Stebbins2018-06-201-2/+5
| | | | Audio probe does not set w->audio.
* Fix PGS subtitle decoding...John Stebbins2018-06-131-0/+10
| | | | | | | | | | | | | | | | | ...And add a timebase to every stream. ffmpeg's subtitle decoder internally converts the packet pts to AV_TIME_BASE units based on AVCodecContext.pkt_timebase. If pkt_timebase is not set, the PGS subtitle decoder only returns AV_NOPTS_VALUE for timestamps. So setting pkt_timebase in decpgssub.c fixes PGS subtitle decoding. Confusingly, the subtitle decoder does not convert the pts *back* to the input timebase, but instead leaves them in AV_TIME_BASE units upon returning a decoded subtitle. To get a head start on fixing any other such issues that might arrise, I have also set pkt_timebase in all other avcodec decoders.
* decavcodec: fix issues with audio that has no explicit channel_layoutJohn Stebbins2018-06-041-9/+32
| | | | | | | | ffmpeg doesn't set a default channel layout for audio that has no explicit layout (e.g. pcm_216le). So we need to guess it from the number of channels. Fixes "no audio" in https://github.com/HandBrake/HandBrake/issues/1387
* libhb: build: README: Replace instances of Libav with FFmpeg.Bradley Sepos2018-05-291-1/+1
|
* libhb: fix segfault when decoding empty audio trackJohn Stebbins2018-05-291-1/+2
| | | | | | | If an audio track exists, but we receive no audio packets for that track, this causes a condition that results in a NULL dereference. Fixes https://github.com/HandBrake/HandBrake/issues/1358
* FFMPEG: Use avcodec_free_context(..) instead of deprecated leaking ↵Sven Gothel2018-05-281-9/+4
| | | | | | | avcodec_close(..) Hence rename hb_avcodec_close -> hb_avcodec_free_context and pass the required ptr-ptr. avcodec_free_context(..) ensures releasing of all resources attached to the context.
* FFMPEG decavcodec: Consider returned error from av_buffersrc_add_frame(..)Sven Gothel2018-05-281-2/+6
|
* libhb: fix a number of issues reported by clang.Damiano Galassi2018-01-121-1/+1
|
* Update copyright dates to 2018.Bradley Sepos2018-01-011-1/+1
|
* QSV: adding HEVC10b decode supportmaxim_d332017-12-221-3/+5
|
* Auto-rotate video that has rotation tagJohn Stebbins2017-11-091-283/+427
|
* CLI: add option to log version, title, and progress in jsonJohn Stebbins2017-11-061-1/+1
| | | This is useful for scripts and other frontends that need to parse CLI output.
* libhb: add HLG to our list of known transfer characteristics.Damiano Galassi2017-11-061-0/+2
|
* fix use of deprecated libav definesJohn Stebbins2017-07-061-1/+1
| | | | Fixes https://github.com/HandBrake/HandBrake/issues/815
* decavcodec: fix wmapro audio timestampsJohn Stebbins2017-06-191-0/+7
| | | | Fixes https://github.com/HandBrake/HandBrake/issues/717
* scan: fix very slow scanning for some filesJohn Stebbins2017-04-121-0/+1
| | | | | | | The threshold in bytes for when to give up trying to decode a frame was too big for a lot of streams. It was made large to accomodate 4K raw video. Instead of counting bytes, count frames fed to the decoder. This is more consistant regardless of video resolution and codec.
* Fix raw video timestampsJohn Stebbins2017-04-091-0/+2
| | | | | | Raw video has no timestamps. But we drop frames in sync that have no timestamps. So detect raw video and extrapolate timestamps from framerate.
* subtitles: simplify and shorten subtitle descriptions (#591)John Stebbins2017-03-101-13/+22
| | | | | | | | | | | | | | | | | | * subtitles: simplify and shorten subtitle descriptions Generally, it eliminates parens to make things more readable. I.e. it turns this: English (Closed Caption)(Wide Screen)(Bitmap)(VOBSUB) Into this: English, Closed Caption [Wide Screen, VOBSUB] * Revise punctuation per BradleyS request * fix subtitle description formatting * incorporate suggestions from PR
* qsv: adding hevc decode supportmaxd2017-03-041-0/+8
|
* decavcodec: drop initial_padding audio samplesJohn Stebbins2017-02-211-12/+51
| | | | | | These are samples that were not in the original source and were added by the encoder. To get a faithful reproduction of the source, they must be dropped.
* decavcodec: fix commentJohn Stebbins2017-02-181-1/+1
|
* decavcodec: fix avcodec_open failure upon bad extradataJohn Stebbins2017-01-241-2/+6
| | | | | | | If extradata is improperly parsed, avcodec_open may fail. Keep trying avcodec_open as long as there is more data to parse. Fixes https://github.com/HandBrake/HandBrake/issues/542
* decavcodec: fix crash in decavcodecvInfoJohn Stebbins2017-01-241-1/+1
| | | | | If avcodec_open fails, pv->context->codec is NULL, but work->info may still be called by scan.
* qsv: fix for memory leak for decodemaxd2017-01-031-1/+1
| | | | Closes #490.
* Update copyright dates to 2017.Bradley Sepos2017-01-011-1/+1
|
* libhb: pass through BT.2020 transfer flagsJohn Stebbins2016-12-221-0/+4
|
* libhb: add new color tags for Bt 2020 and SMPTE ST 2084Damiano Galassi2016-12-211-0/+8
|
* unref AVPackets, fix merge issuesJohn Stebbins2016-12-171-1/+6
|
* qsv: rename av_qsv* to hb_qsv*John Stebbins2016-12-171-1/+1
|
* decavcodec: fix use of deprecated libav interfacesJohn Stebbins2016-12-171-164/+222
| | | | | | | avcodec_decode_audio4 is deprecated, use avcodec_send_packet and avcodec_receive_frame av_bitstream_filter is deprecated, use av_bsf