Open h.265 video codec implementation.

Related tags

Video libde265
Overview

libde265 - open h.265 codec implementation

libde265

libde265 is an open source implementation of the h.265 video codec. It is written from scratch and has a plain C API to enable a simple integration into other software.

libde265 supports WPP and tile-based multithreading and includes SSE optimizations. The decoder includes all features of the Main profile and correctly decodes almost all conformance streams (see [wiki page]).

A list of supported features are available in the wiki.

For latest news check our website at http://www.libde265.org

The library comes with two example programs:

  • dec265, a simple player for raw h.265 bitstreams. It serves nicely as an example program how to use libde265.

  • sherlock265, a Qt-based video player with the additional capability to overlay some graphical representations of the h.265 bitstream (like CU-trees, intra-prediction modes).

Example bitstreams can be found, e.g., at this site: ftp://ftp.kw.bbc.co.uk/hevc/hm-10.1-anchors/bitstreams/ra_main/

Approximate performance for WPP, non-tiles streams (measured using the timehevc tool from the GStreamer plugin). The tool plays a Matroska movie to the GStreamer fakesink and measures the average framerate.

Resolution avg. fps CPU usage
720p 284 fps 39 %
1080p 150 fps 45 %
4K 36 fps 56 %

Environment:

  • Intel(R) Core(TM) i7-2700K CPU @ 3.50GHz (4 physical CPU cores)
  • Ubuntu 12.04, 64bit
  • GStreamer 0.10.36

Building

Build Status Build Status

If you got libde265 from the git repository, you will first need to run the included autogen.sh script to generate the configure script.

libde265 has no dependencies on other libraries, but both optional example programs have dependencies on:

  • SDL (optional for dec265's YUV overlay output),

  • Qt (required for sherlock265),

  • libswscale (required for sherlock265 if libvideogfx is not available).

  • libvideogfx (required for sherlock265 if libswscale is not available, optional for dec265).

Libvideogfx can be obtained from http://www.dirk-farin.net/software/libvideogfx/index.html or http://github.com/farindk/libvideogfx

You can disable building of the example programs by running ./configure with

  --disable-dec265        Do not build the dec265 decoder program.
  --disable-sherlock265   Do not build the sherlock265 visual inspection program.

Additional logging information can be turned on and off using these ./configure flags:

  --enable-log-error      turn on logging at error level (default=yes)
  --enable-log-info       turn on logging at info level (default=no)
  --enable-log-trace      turn on logging at trace level (default=no)

Build using cmake

cmake scripts to build libde265 and the sample scripts dec265 and enc265 are included and can be compiled using these commands:

mkdir build
cd build
cmake ..
make

See the cmake documentation for further information on using cmake on other platforms.

Prebuilt binaries

Binary packages can be obtained from this launchpad site.

Software using libde265

Libde265 has been integrated into these applications:

License

The library libde265 is distributed under the terms of the GNU Lesser General Public License. The sample applications are distributed under the terms of the MIT license.

See COPYING for more details.

Copyright (c) 2013-2014 Struktur AG Contact: Dirk Farin [email protected]

Issues
  • dump header info

    dump header info

    hi,

    i use -d option to dump headers while decoding a stream with multiple tiles and one slice per frame...but when i see the info, i see multiple slices, even if i decode one frame (using option -f 1) ....for example i decode one frame with one slice and 4 tiles....shouldn't i see 1 slice and 3 entry points? Instead there seem to be 4 slices info with respective entry points

    opened by ggeor 9
  • Extracting DCT coefficients for every frame in an encoded video.

    Extracting DCT coefficients for every frame in an encoded video.

    I've been using the prebuild dec265 for decoding encoded binaries (.bin) videos. I saw that the acceleration-speed folder has methods for computing the DCT coefficients, however the make fails for acceleration-speed for me. Is there any way I can perhaps call a function via dec265 itself, so it writes all the DCT coefficients in a file as it runs the video?

    opened by ramitsawhney27 8
  • Travis no longer green on master

    Travis no longer green on master

    Travis is no longer green on master after commit 0338ac5: https://travis-ci.org/strukturag/libde265/builds/85284996

    Also the fuzzing streams are failing after commit 8ec4e93: https://travis-ci.org/strukturag/libde265/builds/85519474

    Please check and make sure to keep Travis green/stable at least on the master branch in the future.

    opened by fancycode 8
  • Video cannot be decoded

    Video cannot be decoded

    Hi All,

    I try to use libde265 decoder our company compressed video, which can be downloaded here (https://github.com/qyljcy/libde265/blob/master/testvideo/GangnamStyle-480p.mp4). It compressed by X265

    But no video output. The video can display well in ffmpeg or OpenHEVC, why not de265?

    I try to use modified ffmpeg(https://github.com/farindk/ffmpeg), but this ffmpeg version is too low.

    Hope some expert can help me to check it.

    Best regards, Jesse

    opened by jessejiang0214 8
  • Added parentheses.

    Added parentheses.

    This PR adds parentheses to prevent the use of the max define. We use this library inside the @ImageMagick project and our build fails without these changes.

    opened by dlemstra 7
  • Completion of error handling

    Completion of error handling

    I have looked at a few source files for your current software. I have noticed that some checks for return codes are missing.

    Would you like to add more error handling for return values from functions like the following?

    opened by elfring 6
  • warning: converting to non-pointer type 'DWORD'

    warning: converting to non-pointer type 'DWORD'

    threads.cc:213:14: warning: converting to non-pointer type 'DWORD' {aka 'long unsigned int'} from NULL [-Wconversion-null] 213 | return NULL; | ^~~~ threads.cc:241:10: warning: converting to non-pointer type 'DWORD' {aka 'long unsigned int'} from NULL [-Wconversion-null] 241 | return NULL; | ^~~~

    opened by Jamaika1 5
  • Use libde265_min and libde265_max

    Use libde265_min and libde265_max

    This PR changes std::min to libde265_min and std::max to libde265_max. We use this library inside the @ImageMagick project and our build fails without these changes.

    opened by dlemstra 5
  • Heap-buffer-overflow WRITE 4 (7706)

    Heap-buffer-overflow WRITE 4 (7706)

    The @ImageMagick project is using https://github.com/google/oss-fuzz to find bugs in our own library and in libraries that we use. The fuzzer found an issue and we think this is an issue that should be resolved in the library that we use. This issue is posted under the url https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7706 that is not publicly visible yet but added as a link for future reference. Below are the details of the issue that can be reproduced using the following technique: https://github.com/google/oss-fuzz/blob/master/docs/reproducing.md

    Stacktrace:

    ==1==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62100003bf38 at pc 0x000000c3b3bd bp 0x7fff79e998d0 sp 0x7fff79e998c8
    --
      | WRITE of size 4 at 0x62100003bf38 thread T0
      | SCARINESS: 36 (4-byte-write-heap-buffer-overflow)
      | #0 0xc3b3bc in decoder_context::process_reference_picture_set(slice_segment_header*) libde265/libde265/decctx.cc:1688:24
      | #1 0xc336f1 in decoder_context::process_slice_segment_header(slice_segment_header*, de265_error*, long, nal_header*, void*) libde265/libde265/decctx.cc:2064:7
      | #2 0xc31f47 in decoder_context::read_slice_NAL(bitreader&, NAL_unit*, nal_header&) libde265/libde265/decctx.cc:639:7
      | #3 0xc3716c in decoder_context::decode_NAL(NAL_unit*) libde265/libde265/decctx.cc:1230:11
      | #4 0xc376a7 in decoder_context::decode(int*) libde265/libde265/decctx.cc:1318:16
      | #5 0xad3b06 in decodeH265Image imagemagick/coders/heic.c:933:11
      | #6 0xad1b2e in ReadHEICImage imagemagick/coders/heic.c:1176:9
      | #7 0x6ced88 in ReadImage imagemagick/MagickCore/constitute.c:500:13
      | #8 0x669ba5 in BlobToImage imagemagick/MagickCore/blob.c:469:13
      | #9 0x5b58f2 in Magick::Image::read(Magick::Blob const&) imagemagick/Magick++/lib/Image.cpp:4015:12
      | #10 0x52984e in LLVMFuzzerTestOneInput imagemagick/Magick++/fuzz/encoder_fuzzer.cc:46:11
      | #11 0x553561 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/libfuzzer/FuzzerLoop.cpp:517:13
      | #12 0x52a60a in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /src/libfuzzer/FuzzerDriver.cpp:280:6
      | #13 0x535fbb in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/libfuzzer/FuzzerDriver.cpp:703:9
      | #14 0x529cac in main /src/libfuzzer/FuzzerMain.cpp:20:10
      | #15 0x7ff2a6e3a82f in __libc_start_main /build/glibc-Cl5G7W/glibc-2.23/csu/libc-start.c:291
      | #16 0x41e868 in _start
      |  
      | 0x62100003bf38 is located 0 bytes to the right of 4664-byte region [0x62100003ad00,0x62100003bf38)
      | allocated by thread T0 here:
      | #0 0x525288 in operator new(unsigned long) _asan_rtl_
      | #1 0xc2c4f7 in de265_new_decoder libde265/libde265/de265.cc:218:26
      | #2 0xad1336 in ReadHEICImage imagemagick/coders/heic.c:1145:17
      | #3 0x6ced88 in ReadImage imagemagick/MagickCore/constitute.c:500:13
      | #4 0x669ba5 in BlobToImage imagemagick/MagickCore/blob.c:469:13
      | #5 0x5b58f2 in Magick::Image::read(Magick::Blob const&) imagemagick/Magick++/lib/Image.cpp:4015:12
      | #6 0x52984e in LLVMFuzzerTestOneInput imagemagick/Magick++/fuzz/encoder_fuzzer.cc:46:11
      | #7 0x553561 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/libfuzzer/FuzzerLoop.cpp:517:13
      | #8 0x52a60a in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /src/libfuzzer/FuzzerDriver.cpp:280:6
      | #9 0x535fbb in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/libfuzzer/FuzzerDriver.cpp:703:9
      | #10 0x529cac in main /src/libfuzzer/FuzzerMain.cpp:20:10
      | #11 0x7ff2a6e3a82f in __libc_start_main /build/glibc-Cl5G7W/glibc-2.23/csu/libc-start.c:291
      |  
      | SUMMARY: AddressSanitizer: heap-buffer-overflow (/mnt/scratch0/clusterfuzz/slave-bot/builds/clusterfuzz-builds_imagemagick_6c758f2561112e17568a05126726c2ca513bfabc/revisions/encoder_heic_fuzzer+0xc3b3bc)
      | Shadow bytes around the buggy address:
      | 0x0c427ffff790: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      | 0x0c427ffff7a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      | 0x0c427ffff7b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      | 0x0c427ffff7c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      | 0x0c427ffff7d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      | =>0x0c427ffff7e0: 00 00 00 00 00 00 00[fa]fa fa fa fa fa fa fa fa
      | 0x0c427ffff7f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
      | 0x0c427ffff800: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
      | 0x0c427ffff810: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
      | 0x0c427ffff820: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
      | 0x0c427ffff830: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
      | Shadow byte legend (one shadow byte represents 8 application bytes):
      | Addressable:           00
      | Partially addressable: 01 02 03 04 05 06 07
      | Heap left redzone:       fa
      | Freed heap region:       fd
      | Stack left redzone:      f1
      | Stack mid redzone:       f2
      | Stack right redzone:     f3
      | Stack after return:      f5
      | Stack use after scope:   f8
      | Global redzone:          f9
      | Global init order:       f6
      | Poisoned by user:        f7
      | Container overflow:      fc
      | Array cookie:            ac
      | Intra object redzone:    bb
      | ASan internal:           fe
      | Left alloca redzone:     ca
      | Right alloca redzone:    cb
      | ==1==ABORTING
    

    Links: https://github.com/strukturag/libde265/blob/5c0a672f20d944b3a16aabdb373f0c0736aab3bb/libde265/decctx.cc#L1688 https://github.com/strukturag/libde265/blob/5c0a672f20d944b3a16aabdb373f0c0736aab3bb/libde265/de265.cc#L218

    Commit: 5c0a672f20d944b3a16aabdb373f0c0736aab3bb Testcase file: clusterfuzz-testcase-minimized-encoder_heic_fuzzer-5918050164408320.zip

    opened by dlemstra 5
  • How To Compile?

    How To Compile?

    I'm on Windows, and I have CMAKE, MAKE, arm-none-eabi, and a GCC compiler installed, and I'm trying to compile for an ARM11 device. (No, I can't compile on the device, it's not running Linux.)

    I need to decode H.265 video streaming over the local network on the device, and it doesn't have hardware h264 or h265 support. (It does however have hardware YUV <-> RGB, which is useful.)

    The video is being muxed and demuxed in a custom audio/video format I wrote (I'll put it on GitHub when it's finished), because I got fed up with MP4 and MOV refusing to stream properly.

    I tried just adding the 'libde265' folder to my project and compiling, but that didn't work.

    First problem, my compiler isn't configured to recognize '.cc' extension, so I wrote a script to rename '.cc' to '.cpp' ('cause I like writing scripts.) The includes were written like #include <libde265/whatever.h>, so the compiler couldn't find the files. I wrote a script to fix that as well, which seemed to work. de265-version.h is missing, so I renamed de265-version.h.in to de265-version.h and manually put the version where it clearly goes. But even after all that, the compilation errors just kept piling up, so eventually I just gave up trying to solve them. Obviously, the library isn't meant to be compiled this way.

    So then, how is it supposed to be compiled? I tried the instructions in the Build section of the README, but cmake just generates a bunch of useless garbage in the build folder, and make says it couldn't find a Makefile.

    opened by Pecacheu 5
  • undeclared identifier NULL on FreeBSD

    undeclared identifier NULL on FreeBSD

    The following error happens when trying to build libde265 1.0.2 on FreeBSD.

    The newer FreeBSD releases use Clang as the default compiler, which give the error below. I have tested a old FreeBSD that still has GCC as default compiler build this code fine without any changes.

    Disabling the #define in libde265/util.h fixes the build but I'm not sure that it is the right thing to do.

    /bin/sh ../../../libtool --tag=CXX --mode=compile c++ -DHAVE_CONFIG_H -I. -I../../.. -I../.. -pipe -g -fstack-protector -fno-strict-aliasing -Werror=return-type -Werror=unused-result -Werror=reorder -std=gnu++11 -DDE265_LOG_ERROR -MT libde265_encoder_algo_la-algo.lo -MD -MP -MF .deps/libde265_encoder_algo_la-algo.Tpo -c -o libde265_encoder_algo_la-algo.lo test -f 'algo.cc' || echo './'algo.cc libtool: compile: c++ -DHAVE_CONFIG_H -I. -I../../.. -I../.. -pipe -g -fstack-protector -fno-strict-aliasing -Werror=return-type -Werror=unused-result -Werror=reorder -std=gnu++11 -DDE265_LOG_ERROR -MT libde265_encoder_algo_la-algo.lo -MD -MP -MF .deps/libde265_encoder_algo_la-algo.Tpo -c algo.cc -fPIC -DPIC -o .libs/libde265_encoder_algo_la-algo.o In file included from algo.cc:23: In file included from ../../../libde265/encoder/algo/algo.h:26: In file included from ../../../libde265/encoder/encode.h:26: ../../../libde265/image.h:86:26: error: use of undeclared identifier 'NULL' MetaDataArray() { data=NULL; data_size=0; log2unitSize=0; width_in_uni... ^ /usr/include/sys/_null.h:35:14: note: expanded from macro 'NULL'

    define NULL nullptr

                ^
    

    ../../../libde265/util.h:75:17: note: expanded from macro 'nullptr'

    define nullptr NULL

                ^
    
    opened by kwm81 5
  • Fix for libde265 crash in read_scaling_list

    Fix for libde265 crash in read_scaling_list

    The read_scaling_list function in libde265 contained a security vulnerability where an input could result in a negative scaling_list_pred_matrix_id_delta value. This value flowed to a buffer index used as a src in a memcpy resulting an in an out of bounds read vulnerability.

    opened by CamZhou 0
  • Heap buffer overflow READ 1 in derive_collocated_motion_vectors

    Heap buffer overflow READ 1 in derive_collocated_motion_vectors

    The @ImageMagick project is using the oss-fuzz tooling of google and with the attached file there is a heap buffer overflow read in derive_collocated_motion_vectors on this line: https://github.com/strukturag/libde265/blob/e587ef6e8000662b91c35ccb866c2374d3a40e27/libde265/motion.cc#L1217

    When stepping through this with a debugger I noticed that refIdxCol was -51.

    Test file: test.zip

    opened by dlemstra 0
  • fix build error when compile with libaom

    fix build error when compile with libaom

    when compile with libaom,because libaom also has a source file named "scan.h", XCode build system will use libaom/scan.h to compile libde265, which cause build error of course. so here I indicate which scan.h should use in libde265 to prevent this build error. build_error_report

    opened by turygo 0
  • libde265 1.0.8, was discovered to contain a heap-use-after-free in put_qpel_fallback

    libde265 1.0.8, was discovered to contain a heap-use-after-free in put_qpel_fallback

    Description

    libde265 1.0.8, was discovered to contain a heap-use-after-free in put_qpel_fallback (fallback-motion.cc)

    ENV

    Version : 1.0.8 Commit : 45904e5667c5bf59c67fcdc586dfba110832894c OS : Ubuntu 18.04 Configure : cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=clang++-10 -DCMAKE_CXX_FLAGS="-fsanitize=address" ../

    BT

    ➜  build git:(master) ✗ ./dec265 crash-eebb3b06a97086193e0f1fc9c0328a4a
    WARNING: non-existing PPS referenced
    WARNING: non-existing PPS referenced
    WARNING: end_of_sub_stream_one_bit not set to 1 when it should be
    WARNING: CTB outside of image area (concealing stream error...)
    WARNING: CTB outside of image area (concealing stream error...)
    WARNING: faulty reference picture list
    WARNING: CTB outside of image area (concealing stream error...)
    WARNING: CTB outside of image area (concealing stream error...)
    WARNING: CTB outside of image area (concealing stream error...)
    WARNING: CTB outside of image area (concealing stream error...)
    WARNING: CTB outside of image area (concealing stream error...)
    WARNING: coded parameter out of range
    WARNING: CTB outside of image area (concealing stream error...)
    WARNING: short-term ref-pic-set index out of range
    WARNING: CTB outside of image area (concealing stream error...)
    SPS error: TB > CB
    =================================================================
    ==71626==ERROR: AddressSanitizer: heap-use-after-free on address 0x62a000026420 at pc 0x7f19626d52eb bp 0x7ffdf2508940 sp 0x7ffdf2508938
    READ of size 2 at 0x62a000026420 thread T0
        #0 0x7f19626d52ea in void put_qpel_fallback<unsigned short>(short*, long, unsigned short const*, long, int, int, short*, int, int, int) /work/fuzz/soft/libde265-master/libde265/fallback-motion.cc:532:16
        #1 0x7f19626ce47a in put_qpel_2_1_fallback_16(short*, long, unsigned short const*, long, int, int, short*, int) /work/fuzz/soft/libde265-master/libde265/fallback-motion.cc:647:13
        #2 0x7f196271be1b in acceleration_functions::put_hevc_qpel(short*, long, void const*, long, int, int, short*, int, int, int) const /work/fuzz/soft/libde265-master/libde265/acceleration.h:338:5
        #3 0x7f196271834b in void mc_luma<unsigned short>(base_context const*, seq_parameter_set const*, int, int, int, int, short*, int, unsigned short const*, int, int, int, int) /work/fuzz/soft/libde265-master/libde265/motion.cc:156:23
        #4 0x7f19627042cd in generate_inter_prediction_samples(base_context*, slice_segment_header const*, de265_image*, int, int, int, int, int, int, int, PBMotion const*) /work/fuzz/soft/libde265-master/libde265/motion.cc:367:11
        #5 0x7f19627173d4 in decode_prediction_unit(base_context*, slice_segment_header const*, de265_image*, PBMotionCoding const&, int, int, int, int, int, int, int, int) /work/fuzz/soft/libde265-master/libde265/motion.cc:2107:3
        #6 0x7f196276d11d in read_prediction_unit(thread_context*, int, int, int, int, int, int, int, int, int) /work/fuzz/soft/libde265-master/libde265/slice.cc:4136:3
        #7 0x7f196276f699 in read_coding_unit(thread_context*, int, int, int, int) /work/fuzz/soft/libde265-master/libde265/slice.cc:4517:9
        #8 0x7f1962763d8f in read_coding_quadtree(thread_context*, int, int, int, int) /work/fuzz/soft/libde265-master/libde265/slice.cc:4652:5
        #9 0x7f1962763d5e in read_coding_quadtree(thread_context*, int, int, int, int) /work/fuzz/soft/libde265-master/libde265/slice.cc:4645:7
        #10 0x7f1962763af0 in read_coding_quadtree(thread_context*, int, int, int, int) /work/fuzz/soft/libde265-master/libde265/slice.cc:4635:5
        #11 0x7f1962763504 in read_coding_tree_unit(thread_context*) /work/fuzz/soft/libde265-master/libde265/slice.cc:2861:3
        #12 0x7f1962771a1c in decode_substream(thread_context*, bool, bool) /work/fuzz/soft/libde265-master/libde265/slice.cc:4741:5
        #13 0x7f1962774350 in read_slice_segment_data(thread_context*) /work/fuzz/soft/libde265-master/libde265/slice.cc:5054:14
        #14 0x7f196268347c in decoder_context::decode_slice_unit_sequential(image_unit*, slice_unit*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:852:7
        #15 0x7f196268212b in decoder_context::decode_slice_unit_parallel(image_unit*, slice_unit*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:954:11
        #16 0x7f1962681533 in decoder_context::decode_some(bool*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:739:13
        #17 0x7f196267f866 in decoder_context::read_slice_NAL(bitreader&, NAL_unit*, nal_header&) /work/fuzz/soft/libde265-master/libde265/decctx.cc:697:9
        #18 0x7f1962685548 in decoder_context::decode_NAL(NAL_unit*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:1239:11
        #19 0x7f1962685e9e in decoder_context::decode(int*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:1327:16
        #20 0x7f196265ad74 in de265_decode /work/fuzz/soft/libde265-master/libde265/de265.cc:352:15
        #21 0x4c8e84 in main /work/fuzz/soft/libde265-master/dec265/dec265.cc:764:17
        #22 0x7f1961226c86 in __libc_start_main /build/glibc-uZu3wS/glibc-2.27/csu/../csu/libc-start.c:310
        #23 0x41c4e9 in _start (/work/fuzz/soft/libde265-master/build_debug/dec265/dec265+0x41c4e9)
    
    0x62a000026420 is located 8736 bytes inside of 20480-byte region [0x62a000024200,0x62a000029200)
    freed by thread T0 here:
        #0 0x4c4cfd in operator delete[](void*) (/work/fuzz/soft/libde265-master/build_debug/dec265/dec265+0x4c4cfd)
        #1 0x7f196273c4be in apply_sample_adaptive_offset_sequential(de265_image*) /work/fuzz/soft/libde265-master/libde265/sao.cc:378:3
        #2 0x7f1962682649 in decoder_context::run_postprocessing_filters_sequential(de265_image*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:1898:7
        #3 0x7f19626818c1 in decoder_context::decode_some(bool*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:778:7
        #4 0x7f196267f866 in decoder_context::read_slice_NAL(bitreader&, NAL_unit*, nal_header&) /work/fuzz/soft/libde265-master/libde265/decctx.cc:697:9
        #5 0x7f1962685548 in decoder_context::decode_NAL(NAL_unit*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:1239:11
        #6 0x7f1962685e9e in decoder_context::decode(int*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:1327:16
        #7 0x7f196265ad74 in de265_decode /work/fuzz/soft/libde265-master/libde265/de265.cc:352:15
        #8 0x4c8e84 in main /work/fuzz/soft/libde265-master/dec265/dec265.cc:764:17
        #9 0x7f1961226c86 in __libc_start_main /build/glibc-uZu3wS/glibc-2.27/csu/../csu/libc-start.c:310
    
    previously allocated by thread T0 here:
        #0 0x4c44ad in operator new[](unsigned long) (/work/fuzz/soft/libde265-master/build_debug/dec265/dec265+0x4c44ad)
        #1 0x7f196273bbff in apply_sample_adaptive_offset_sequential(de265_image*) /work/fuzz/soft/libde265-master/libde265/sao.cc:335:24
        #2 0x7f1962682649 in decoder_context::run_postprocessing_filters_sequential(de265_image*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:1898:7
        #3 0x7f19626818c1 in decoder_context::decode_some(bool*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:778:7
        #4 0x7f196267f866 in decoder_context::read_slice_NAL(bitreader&, NAL_unit*, nal_header&) /work/fuzz/soft/libde265-master/libde265/decctx.cc:697:9
        #5 0x7f1962685548 in decoder_context::decode_NAL(NAL_unit*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:1239:11
        #6 0x7f1962685e9e in decoder_context::decode(int*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:1327:16
        #7 0x7f196265ad74 in de265_decode /work/fuzz/soft/libde265-master/libde265/de265.cc:352:15
        #8 0x4c8e84 in main /work/fuzz/soft/libde265-master/dec265/dec265.cc:764:17
        #9 0x7f1961226c86 in __libc_start_main /build/glibc-uZu3wS/glibc-2.27/csu/../csu/libc-start.c:310
    
    SUMMARY: AddressSanitizer: heap-use-after-free /work/fuzz/soft/libde265-master/libde265/fallback-motion.cc:532:16 in void put_qpel_fallback<unsigned short>(short*, long, unsigned short const*, long, int, int, short*, int, int, int)
    Shadow bytes around the buggy address:
      0x0c547fffcc30: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
      0x0c547fffcc40: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
      0x0c547fffcc50: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
      0x0c547fffcc60: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
      0x0c547fffcc70: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
    =>0x0c547fffcc80: fd fd fd fd[fd]fd fd fd fd fd fd fd fd fd fd fd
      0x0c547fffcc90: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
      0x0c547fffcca0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
      0x0c547fffccb0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
      0x0c547fffccc0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
      0x0c547fffccd0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
    Shadow byte legend (one shadow byte represents 8 application bytes):
      Addressable:           00
      Partially addressable: 01 02 03 04 05 06 07 
      Heap left redzone:       fa
      Freed heap region:       fd
      Stack left redzone:      f1
      Stack mid redzone:       f2
      Stack right redzone:     f3
      Stack after return:      f5
      Stack use after scope:   f8
      Global redzone:          f9
      Global init order:       f6
      Poisoned by user:        f7
      Container overflow:      fc
      Array cookie:            ac
      Intra object redzone:    bb
      ASan internal:           fe
      Left alloca redzone:     ca
      Right alloca redzone:    cb
      Shadow gap:              cc
    ==71626==ABORTING
    

    Reported on Apr 11th 2022 https://huntr.dev/bounties/e7b0da8a-14df-447c-be2f-6a7301f78e0e/

    opened by salmonx 0
  • libde265 1.0.8, was discovered to contain a heap-buffer-overflow in put_epel_16_fallback (fallback-motion.cc)

    libde265 1.0.8, was discovered to contain a heap-buffer-overflow in put_epel_16_fallback (fallback-motion.cc)

    Description

    libde265 1.0.8, was discovered to contain a heap-buffer-overflow in put_epel_16_fallback (fallback-motion.cc)

    ENV

    Version : 1.0.8 Commit : 45904e5667c5bf59c67fcdc586dfba110832894c OS : Ubuntu 18.04 Configure : cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=clang++-10 -DCMAKE_CXX_FLAGS="-fsanitize=address" ../

    BT

    ./dec265 crash-0b5718988550fc7f644100bfc53004a4
    WARNING: CTB outside of image area (concealing stream error...)
    WARNING: non-existing PPS referenced
    WARNING: CTB outside of image area (concealing stream error...)
    =================================================================
    ==39848==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60e0000009a0 at pc 0x7f49515672a0 bp 0x7ffec35a8430 sp 0x7ffec35a8428
    READ of size 2 at 0x60e0000009a0 thread T0
        #0 0x7f495156729f in put_epel_16_fallback(short*, long, unsigned short const*, long, int, int, int, int, short*, int) /work/fuzz/soft/libde265-master/libde265/fallback-motion.cc:289:12
        #1 0x7f49515b5f72 in acceleration_functions::put_hevc_epel(short*, long, void const*, long, int, int, int, int, short*, int) const /work/fuzz/soft/libde265-master/libde265/acceleration.h:298:5
        #2 0x7f49515b3bf4 in void mc_chroma<unsigned short>(base_context const*, seq_parameter_set const*, int, int, int, int, short*, int, unsigned short const*, int, int, int, int) /work/fuzz/soft/libde265-master/libde265/motion.cc:205:25
        #3 0x7f495159e76d in generate_inter_prediction_samples(base_context*, slice_segment_header const*, de265_image*, int, int, int, int, int, int, int, PBMotion const*) /work/fuzz/soft/libde265-master/libde265/motion.cc:380:11
        #4 0x7f49515b13d4 in decode_prediction_unit(base_context*, slice_segment_header const*, de265_image*, PBMotionCoding const&, int, int, int, int, int, int, int, int) /work/fuzz/soft/libde265-master/libde265/motion.cc:2107:3
        #5 0x7f495160711d in read_prediction_unit(thread_context*, int, int, int, int, int, int, int, int, int) /work/fuzz/soft/libde265-master/libde265/slice.cc:4136:3
        #6 0x7f495160902c in read_coding_unit(thread_context*, int, int, int, int) /work/fuzz/soft/libde265-master/libde265/slice.cc:4497:9
        #7 0x7f49515fdd8f in read_coding_quadtree(thread_context*, int, int, int, int) /work/fuzz/soft/libde265-master/libde265/slice.cc:4652:5
        #8 0x7f49515fdaf0 in read_coding_quadtree(thread_context*, int, int, int, int) /work/fuzz/soft/libde265-master/libde265/slice.cc:4635:5
        #9 0x7f49515fdaf0 in read_coding_quadtree(thread_context*, int, int, int, int) /work/fuzz/soft/libde265-master/libde265/slice.cc:4635:5
        #10 0x7f49515fdaf0 in read_coding_quadtree(thread_context*, int, int, int, int) /work/fuzz/soft/libde265-master/libde265/slice.cc:4635:5
        #11 0x7f49515fd504 in read_coding_tree_unit(thread_context*) /work/fuzz/soft/libde265-master/libde265/slice.cc:2861:3
        #12 0x7f495160ba1c in decode_substream(thread_context*, bool, bool) /work/fuzz/soft/libde265-master/libde265/slice.cc:4741:5
        #13 0x7f495160e350 in read_slice_segment_data(thread_context*) /work/fuzz/soft/libde265-master/libde265/slice.cc:5054:14
        #14 0x7f495151d47c in decoder_context::decode_slice_unit_sequential(image_unit*, slice_unit*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:852:7
        #15 0x7f495151c12b in decoder_context::decode_slice_unit_parallel(image_unit*, slice_unit*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:954:11
        #16 0x7f495151b533 in decoder_context::decode_some(bool*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:739:13
        #17 0x7f4951519866 in decoder_context::read_slice_NAL(bitreader&, NAL_unit*, nal_header&) /work/fuzz/soft/libde265-master/libde265/decctx.cc:697:9
        #18 0x7f495151f548 in decoder_context::decode_NAL(NAL_unit*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:1239:11
        #19 0x7f495151fe9e in decoder_context::decode(int*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:1327:16
        #20 0x7f49514f4d74 in de265_decode /work/fuzz/soft/libde265-master/libde265/de265.cc:352:15
        #21 0x4c8e84 in main /work/fuzz/soft/libde265-master/dec265/dec265.cc:764:17
        #22 0x7f49500c0c86 in __libc_start_main /build/glibc-uZu3wS/glibc-2.27/csu/../csu/libc-start.c:310
        #23 0x41c4e9 in _start (/work/fuzz/soft/libde265-master/build_debug/dec265/dec265+0x41c4e9)
    
    0x60e0000009a0 is located 16 bytes to the right of 144-byte region [0x60e000000900,0x60e000000990)
    allocated by thread T0 here:
        #0 0x4956c7 in posix_memalign (/work/fuzz/soft/libde265-master/build_debug/dec265/dec265+0x4956c7)
        #1 0x7f49515751e7 in ALLOC_ALIGNED(unsigned long, unsigned long) /work/fuzz/soft/libde265-master/libde265/image.cc:55:9
        #2 0x7f4951575fbb in de265_image_get_buffer(void*, de265_image_spec*, de265_image*, void*) /work/fuzz/soft/libde265-master/libde265/image.cc:133:23
        #3 0x7f495157952a in de265_image::alloc_image(int, int, de265_chroma, std::shared_ptr<seq_parameter_set const>, bool, decoder_context*, long, void*, bool) /work/fuzz/soft/libde265-master/libde265/image.cc:385:25
        #4 0x7f495154ebe3 in decoded_picture_buffer::new_image(std::shared_ptr<seq_parameter_set const>, decoder_context*, long, void*, bool) /work/fuzz/soft/libde265-master/libde265/dpb.cc:262:8
        #5 0x7f4951521204 in decoder_context::generate_unavailable_reference_picture(seq_parameter_set const*, int, bool) /work/fuzz/soft/libde265-master/libde265/decctx.cc:1427:17
        #6 0x7f4951524b63 in decoder_context::process_reference_picture_set(slice_segment_header*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:1656:30
        #7 0x7f495151ad25 in decoder_context::process_slice_segment_header(slice_segment_header*, de265_error*, long, nal_header*, void*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:2075:7
        #8 0x7f4951519005 in decoder_context::read_slice_NAL(bitreader&, NAL_unit*, nal_header&) /work/fuzz/soft/libde265-master/libde265/decctx.cc:648:7
        #9 0x7f495151f548 in decoder_context::decode_NAL(NAL_unit*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:1239:11
        #10 0x7f495151fe9e in decoder_context::decode(int*) /work/fuzz/soft/libde265-master/libde265/decctx.cc:1327:16
        #11 0x7f49514f4d74 in de265_decode /work/fuzz/soft/libde265-master/libde265/de265.cc:352:15
        #12 0x4c8e84 in main /work/fuzz/soft/libde265-master/dec265/dec265.cc:764:17
        #13 0x7f49500c0c86 in __libc_start_main /build/glibc-uZu3wS/glibc-2.27/csu/../csu/libc-start.c:310
    
    SUMMARY: AddressSanitizer: heap-buffer-overflow /work/fuzz/soft/libde265-master/libde265/fallback-motion.cc:289:12 in put_epel_16_fallback(short*, long, unsigned short const*, long, int, int, int, int, short*, int)
    Shadow bytes around the buggy address:
      0x0c1c7fff80e0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
      0x0c1c7fff80f0: 00 00 00 00 00 00 00 00 00 00 fa fa fa fa fa fa
      0x0c1c7fff8100: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
      0x0c1c7fff8110: 00 00 00 00 00 00 fa fa fa fa fa fa fa fa fa fa
      0x0c1c7fff8120: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    =>0x0c1c7fff8130: 00 00 fa fa[fa]fa fa fa fa fa fa fa 00 00 00 00
      0x0c1c7fff8140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fa fa
      0x0c1c7fff8150: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
      0x0c1c7fff8160: 00 00 00 00 00 00 00 00 00 00 fa fa fa fa fa fa
      0x0c1c7fff8170: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00
      0x0c1c7fff8180: 00 00 00 00 00 00 fa fa fa fa fa fa fa fa fa fa
    Shadow byte legend (one shadow byte represents 8 application bytes):
      Addressable:           00
      Partially addressable: 01 02 03 04 05 06 07 
      Heap left redzone:       fa
      Freed heap region:       fd
      Stack left redzone:      f1
      Stack mid redzone:       f2
      Stack right redzone:     f3
      Stack after return:      f5
      Stack use after scope:   f8
      Global redzone:          f9
      Global init order:       f6
      Poisoned by user:        f7
      Container overflow:      fc
      Array cookie:            ac
      Intra object redzone:    bb
      ASan internal:           fe
      Left alloca redzone:     ca
      Right alloca redzone:    cb
      Shadow gap:              cc
    ==39848==ABORTING
    

    Reported on Apr 8th 2022 https://huntr.dev/bounties/1e7d564d-749a-47b2-a56a-428e78fcf45d/

    opened by salmonx 0
  • Is it possible to make all frames in GOP depend only on the first keyframe of the group?

    Is it possible to make all frames in GOP depend only on the first keyframe of the group?

    Hi, would it be possible to use this library to make all P frames be computed from the first I frame in GOP? I have found the encoder code but I don't see where would I change the reference frame for the currently encoded one. The goal is to have random access allowed within GOP. Even if I make all the frames computed from the I frame, would it be possible to decode such video with other existing decoders? Do the packets in the stream actually contain the index of their reference frame or would I have to write a custom decoder for that as well? Thanks for this great implementation!

    opened by ichlubna 0
Releases(v1.0.8)
Owner
struktur AG
struktur AG
🤟Super fast H.264/H.265 FLV player

??Super fast H.264/H.265 FLV player

Eros Zhao 1.2k Jul 1, 2022
Open Source H.264 Codec

OpenH264 OpenH264 is a codec library which supports H.264 encoding and decoding. It is suitable for use in real time applications such as WebRTC. See

Cisco Systems 4.6k Jun 26, 2022
OpenShot Video Library (libopenshot) is a free, open-source C++ library dedicated to delivering high quality video editing, animation, and playback solutions to the world

OpenShot Video Library (libopenshot) is a free, open-source C++ library dedicated to delivering high quality video editing, animation, and playback solutions to the world

OpenShot Studios, LLC 851 Jun 30, 2022
A free, fast, cross-platform volumetric codec for everyone.

The open source Universal Volumetric (".uvol") compressed interchange format for streaming mesh sequences. This project also includes a cross-platform player implementation using h.264 video for texture.

XR Foundation 69 Jun 21, 2022
ffmpeg supporting EVC codec and file formats.

ffevc ffmpeg supporting EVC codec and file formats. MPEG-5 Essential Video Coding (EVC) integration with FFmpeg project. It is supported under Linux a

MPEG-5 19 May 26, 2022
Vulkan Video Sample Application demonstrating an end-to-end, all-Vulkan, processing of h.264/5 compressed video content.

This project is a Vulkan Video Sample Application demonstrating an end-to-end, all-Vulkan, processing of h.264/5 compressed video content. The application decodes the h.264/5 compressed content using an HW accelerated decoder, the decoded YCbCr frames are processed with Vulkan Graphics and then presented via the Vulkan WSI.

NVIDIA DesignWorks Samples 108 Jun 18, 2022
Video stabilization is a software-based approach in real-time to eliminating environmental effects (wind, heavy vehicle etc.) and enhance the visual performance that degrade video streaming quality.

Video Stabilization Contents General Info Installation To Do General Info Video stabilization is a software-based approach in real-time to eliminating

null 5 Mar 7, 2022
Minimalist video maker -- simplify your music score video making process!

VisualScores 极简视频制作程序,简化你的乐谱视频制作! 如果需要编译,请解压 lib 文件夹中压缩包。 使用前请参考 manual 文件夹中的用户手册。 请勿修改、移动或删除 resource 文件夹中的任何文件。 VisualScores Minimalist video maker

Chen and Sim 5 Jan 11, 2022
Shotcut - a free, open source, cross-platform video editor

cross-platform (Qt), open-source (GPLv3) video editor

MLT Framework 6.7k Jul 4, 2022
Vireo is a lightweight and versatile video processing library written in C++11

Overview Vireo is a lightweight and versatile video processing library that powers our video transcoding service, deep learning recognition systems an

Twitter 852 Jun 27, 2022
Olive is a free non-linear video editor for Windows, macOS, and Linux.

Olive is a free non-linear video editor for Windows, macOS, and Linux.

Olive Team 6.2k Jun 26, 2022
Video player for 3ds

Video player for 3DS Patch note v1.0.1 Added allow skip frames option v1.0.0 Initial release Summary Video player for 3DS Performance 256x144(144p)@30

Core 2 Extreme 107 Jun 10, 2022
Plugin for VLC that pauses/plays video on mouse click

Pause Click plugin for VLC VLC plugin that allows you to pause/play a video by clicking on the video image. Can be configured to work nicely with doub

null 618 Jun 19, 2022
A WFH utility to visually indicate user engagement of audio and video

DIY: In meeting indicator - WFH Utility The need for in meeting indicator at home So many of you have gotten accustomed to work from home by now. This

krishna kumar T 10 Jun 28, 2021
Real-Time Intermediate Flow Estimation for Video Frame Interpolation filter for VapourSynth

Description RIFE filter for VapourSynth, based on rife-ncnn-vulkan. Usage rife.RIFE(clip clip[, int model=0, int gpu_id=auto, int gpu_thread=2, bint t

Home Of VapourSynth Evolution 50 Jun 19, 2022
SRS is a simple, high efficiency and realtime video server, supports RTMP/WebRTC/HLS/HTTP-FLV/SRT/GB28181.

SRS is a simple, high efficiency and realtime video server, supports RTMP/WebRTC/HLS/HTTP-FLV/SRT/GB28181.

ossrs 18.5k Jul 3, 2022
Anki-like app for spaced repetition of video clips

ReeePlayer The ReeePlayer application is designed for spaced repetition of fragments (clips) of video and audio files with similar principle as in Ank

Filipp Volodin 11 May 2, 2022
NymphCast is a audio and video casting system with support for custom applications.

NymphCast is a software solution which turns your choice of Linux-capable hardware into an audio and video source for a television or powered speakers. It enables the streaming of audio and video over the network from a wide range of client devices, as well as the streaming of internet media to a NymphCast server, controlled by a client device.

Maya Posch 2.2k Jun 20, 2022
SortNode is a JS binding for SORT: Simple, online, and real-time tracking of multiple objects in a video sequence.

SortNode is a JS binding for SORT: Simple, online, and real-time tracking of multiple objects in a video sequence.

Techainer 11 Sep 17, 2021