summaryrefslogtreecommitdiffstats
path: root/libhb/muxavformat.c
Commit message (Collapse)AuthorAgeFilesLines
* hw-encoder-vaapi: Enables VAAPI if available and supported for h264 (tested ↵Sven Gothel2021-04-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | w/ AMD NAVI10), untested: h265, vp8 and vp9 Tested using lates mesa master branch patched with - contrib/mesa/A00-gallium_vaapi_encpackedheader01-commit-5e10db6.patch to enable Matroska and correct packed header in general using ffmpeg. Test hardware and configuration: - Mesa Gallium driver 20.2.0-devel for AMD Radeon RX 5700 XT (NAVI10, DRM 3.37.0, 5.7.0-1-amd64, LLVM 9.0.1) Codev h264_vaapi, avcodec_open options: rc_mode=CQP,qp=24,b_depth=2,profile=100,level=40 (profile high, level 4.0) HD1080 source ~45min with 212fps PSNR and SSIM difference to x264 below 1%, having x264 using profile high, level 4.0, preset fast, rc 23. Both using constant-quality w/ variable bitrate. ++++ If FEATURE vaapi is enable (autodetected), the following libraries are linked: X11 va va-drm va-x11. - hb.c: - Adding global static 'vaapi_device_ctx0' default device initialized via hb_avcodec_init() and released via hb_avcodec_free(). The 'vaapi_device_ctx0' is used in vaa_common hb_avcodec_vaapi_set_hwframe_ctx(..). - hb_avcodec_vaapi_set_hwframe_ctx() attaches the new AVHWFramesContext to the AVCodecContext at initializing the encoder. This is the final sink for the vaapi hw-encoder and Encode(..) performs the frame conversion into it. - hb_avcodec_test_encoder(..) adds VAAPI branch, needs refinement - encavcodec.c - adding VAAPI branches, enabling available, needs refinement. Currently profile and level are set to the user preferences, additionally 'b_depth=2' is being passed. - added hb_avcodec_test_encoder*(..) functions, currently only used to check vaapi-*codec*-availability. We used this codefragment regularly in an earlier HB version. +++ Discussion: Previous version of this patch of mine worked well on Intel hardware, as described above - AMD NAVI10 also performs quite well. VAAPI Workflow: - It uses hardware frames on the target device, which are being transported from the software device. The frame transport implicitly converts the pix_fmt. - AVCodecContext's pix_fmt uses AV_PIX_FMT_VAAPI - AVHWFramesContext: format uses AV_PIX_FMT_VAAPI and sw_format AV_PIX_FMT_NV12, the latter hinting on the actual hw-frame's target format. - AV_PIX_FMT_NV12 uses interleaved UV data, where AV_PIX_FMT_YUV420P uses seperated planes. Both use a separated Y plane upfront. Therefor both formats are not picture compatible, memory requirements are same. - Encode(..) allocates a hw_frame and the source frame is being transported to the hw-frame target using the pic_fmt conversion to NV12. Finally the hw_frame is being sent 'avcodec_send_frame' and the code-path re-aligns with non VAAPI. Further fixes to do: Validate whether 'b_depth=2' (b-frames) works for all vaapi implementations, add custom extra-video-encoder field!
* muxavformat: fix compiler indentation warningJohn Stebbins2021-04-121-1/+1
|
* Fix for Issue #632 (#3413)George Sheppard2021-03-031-0/+5
| | | | muxavformat: add logic to compare avio error message, and add description of the error if the output destination file cannot be written or accessed.
* libhb: add videotoolbox 10bit hevc encoder.Damiano Galassi2021-02-281-0/+1
|
* fixed typosfreddii2021-02-251-2/+2
|
* Add support for using the ffmpeg MediaFoundation encoder wrapperMartin Storsjö2021-02-201-0/+2
| | | | | | | | | | | | | This works fine for e.g. the Qualcomm H264 and HEVC encoders on ARM64 windows devices, and should work the same for other vendors HW encoders on X86 devices (even though those encoders usually are available via vendor specific APIs as well, and this patch is currently only tested and tuned for Qualcomm). There's no detection for whether the MediaFoundation wrapper is going to provide a working encoder for either format (it currently forcibly tries to use a HW encoder and fails if there isn't a matchine one, or if it doesn't accept the parameters that have been set).
* libhb: passthru mastering display metadata and content light level metadata.Damiano Galassi2021-02-011-2/+38
|
* muxavformat: disable libavformat's mkv automatic handling of default flag. ↵Damiano Galassi2021-01-211-0/+2
| | | | Fixes #3200.
* Update copyright dates to 2021.Bradley Sepos2021-01-011-1/+1
|
* MP2 PassThru (libhb part)Nomis1012020-11-081-0/+3
|
* muxavformat: fix setting iso639_2b lang code in mkvJohn Stebbins2020-06-031-1/+2
| | | | | | | | | An empty string was getting set for the mkv lang code. Need to test that the string is not NULL **and** not empty. Affects Hebrew, Indonesian, Javanese, and Yiddish. Fixes https://github.com/HandBrake/HandBrake/issues/2903
* decavsub: enable dvb subtitle passthrough in mkvJohn Stebbins2020-03-291-0/+5
|
* Update copyright dates to 2020.Bradley Sepos2020-01-011-1/+1
|
* Gardening: Clean up trailing whitespaceNomis1012019-11-041-1/+1
| | | | Remove trailing whitespace in "*.c", "*.m", "*.h" and "*.cpp" files.
* libhb: make hb_buffer_t libhb privateJohn Stebbins2019-09-121-0/+1
| | | | hb_buffer_t conflicts with a harfbuzz typedef by the same name
* libhb: resolve header conflicts with pango/harfbuzzJohn Stebbins2019-09-121-3/+3
| | | | | | | Newest versions appear to have a "common.h" somewhere that is interfering with libhb/common.h. move headers into "handbrake" subdirectory
* Resolve conflict with harfbuzz include file hb.hJohn Stebbins2019-09-101-1/+1
| | | | Rename hb.h to handbrake.h
* fix build errorJohn Stebbins2019-08-111-1/+2
| | | | not sure how/why I committed somethng I didn't even compile :-\
* muxavformat: set handler_name for subtitle track names alsoJohn Stebbins2019-08-111-0/+6
|
* muxavformat: fix writing alternative track name in mp4 hdlr atomJohn Stebbins2019-08-111-1/+1
| | | | ffmpeg changed the name of the metadata key at some point
* add subtitle track name read/writeJohn Stebbins2019-08-111-0/+6
| | | | | | | | | | | | | | | | Works similar to audio track names. If source has a subtitle track name, hb_subtitle_t.name is set. To set output subtitle track name, set hb_subtitle_config_t.name. Source track names are available in title returned by hb_title_to_dict and hb_title_to_json in SubtitleList[].Name In job dict it is also SubtitleList[].Name hb_preset_job_init and hb_preset_job_init_json initialize output tracks with the source track name. Also adds subtitle name support to LinGui
* a few fixes for audio track name handlingJohn Stebbins2019-08-111-1/+1
| | | | fixes a memory leak makes name const
* Fix some typos (#2202)Nomis1012019-07-311-1/+1
| | | Fix some typos
* Add WebM support (#1822)Justin Bull2019-02-131-1/+13
| | | Note that since webm has no official subtitle support, only burned in subtitles can be used with this muxer at this time.
* muxavformat: use better approximation for duration of last video frameJohn Stebbins2019-01-161-0/+10
| | | | Fixes https://github.com/HandBrake/HandBrake/issues/1802
* ssa: improve SSA to TX3G conversionJohn Stebbins2019-01-141-3/+11
| | | | | We were only applying SSA inline override tags. With this patch we now parse SSA style descritions in the SSA header and apply them per event.
* Add SSA subtitle importJohn Stebbins2019-01-141-1/+2
|
* Update copyright dates to 2019.Bradley Sepos2019-01-011-1/+1
|
* Add VideoToolbox hardware encoding thru FFmpeg.Damiano Galassi2018-11-151-0/+2
|
* muxavformat: fix error messagesJohn Stebbins2018-11-141-4/+4
|
* encavcodec: fix passing extradata to muxerJohn Stebbins2018-11-141-12/+64
| | | | | | The extradata handling hasn't changed since 0.7 when we only used encavcodec for mpeg4 encoding. It was not designed to handle the additional codecs we are encoding now.
* Add NVEnc encoder. (Round 3) (#1437)Scott2018-06-291-0/+2
| | | | | | Adding the Nvidia NVEnc H.264 and H.265 encoders. Based on Initial work by sgothel --enable-nvenc is the new compile time configure option to enable for builds.
* muxavformat: silence mp4 frame size warningJohn Stebbins2018-06-151-0/+1
| | | | Set samples per frame for audio tracks
* muxavformat: use alternate API to initialize out contextJohn Stebbins2018-06-151-12/+5
| | | | | | avformat_alloc_output_context2 does several things for us that we were doing in separate steps. It also allocates AVFormatContext.url for us so we do not have a case where we alloc something that ffmpeg frees.
* muxavformat: fix crash on windowsJohn Stebbins2018-06-151-1/+1
| | | | | | We allocate AVFormatContext.url, but libavformat frees it. So we must use an allocation function that is compatible with the free function used by libavformat.
* muxavformat: fix use of deprecated AVFormat.filenameJohn Stebbins2018-06-131-1/+1
| | | | | | The new way is AVFormat.url. AVFormat.filename had lenght limitations that url does not since it is allocated by the caller (and freed by libavformat).
* muxavformat: Fix muxing SSA subtitlesJohn Stebbins2018-06-091-35/+0
| | | | | | ffmpeg expect SSA packets in matroska format. Fixes https://github.com/HandBrake/HandBrake/issues/1379
* Add support for VCE hardware encoding.Michael Wootton2018-06-061-0/+2
|
* contrib: Use AV_CODEC_ID_ASS for FFmpeg.Bradley Sepos2018-05-281-2/+2
|
* FFMPEG #974: Use latest FFMPEG 3.4.1 (1/2)Sven Gothel2018-05-281-0/+2
| | | | | | | | Patch 1/2 for https://github.com/HandBrake/HandBrake/issues/974 moving to FFMPEG 3.4.1 from LIBAV 12.2. The re-ordering of to be linked modules was required to solve statically linked dependencies. See libhb/module.defs etc.
* Missed typo in previous commitluz.paz2018-02-201-1/+1
|
* please review....luz.paz2018-02-201-2/+2
| | | there is a redundant 'the the' in this string, please advise
* Update copyright dates to 2018.Bradley Sepos2018-01-011-1/+1
|
* add sdtp (sample dependency) box to mp4 (#1006)John Stebbins2017-11-281-0/+4
| | | | | * add sdtp (sample dependency) box to mp4 The AppleTV 4K requires this box in order to play 2160p60 video.
* Add adaptive streaming support (#972)John Stebbins2017-11-091-1/+16
| | | | | | | "Adaptive streaming" allows changing video parameters mid-stream at IDR boundaries. Such changes require new SPS and PPS NALs at the IDR. MP4 supports this with 'avc3' and 'hev1' sample entry types.
* tx3g: make font size scale with video heightJohn Stebbins2017-11-031-5/+17
| | | Fixes https://forum.handbrake.fr/viewtopic.php?f=5&t=37034
* fix use of deprecated libav definesJohn Stebbins2017-07-061-14/+14
| | | | Fixes https://github.com/HandBrake/HandBrake/issues/815
* muxavformat: override h.265 'hev1' with 'hvc1' (#782)John Stebbins2017-06-141-1/+2
| | | This provides compatibility with apple software
* qsv: added HEVC 10-bit as encoder, should help for GUI integrationmaxd2017-03-051-0/+1
|
* muxavformat: Inform muxer of encoder delayJohn Stebbins2017-02-151-0/+2
| | | | | | | initial_padding is used to inform libav muxers of initial encoder delay duration. When set for mkv it can be used to remove the silence samples during playback since the delay value gets stored in the mkv CodecDelay element.