bbc / turingcodec

Source code for the Turing codec, an HEVC software encoder optimised for fast encoding of large resolution video content
http://turingcodec.org/
GNU General Public License v2.0
154 stars 39 forks source link

vs2015 assert - turing.exe decode #19

Closed mosdav closed 6 years ago

mosdav commented 6 years ago

Hi,

I've tried decoding HEVC mp4 file (encoded via x265 codec using ffmpeg) I've got the following assert (x eqauls to 24 while Fixed<V>::value is 0 as far I understand the code)

turing.exe!_wassert(const wchar_t * expression, const wchar_t * file_name, unsigned int line_number) Line 444   C++ Symbols loaded.
>   turing.exe!Derive<leading_zero_8bits,PointerTuple<StatePicture,StateDecode>,void>::set(leading_zero_8bits __formal, int x, PointerTuple<StatePicture,StateDecode> & h) Line 283 C++ Symbols loaded.
    turing.exe!ReadU<leading_zero_8bits,f>::go<Handler<Decode<void>,StatePicture,StateDecode> >(Element<leading_zero_8bits,f> e, Handler<Decode<void>,StatePicture,StateDecode> & h) Line 318   C++ Symbols loaded.
    turing.exe!Handler<Decode<void>,StatePicture,StateDecode>::operator()<leading_zero_8bits,f>(leading_zero_8bits v, f m) Line 176 C++ Symbols loaded.
    turing.exe!Syntax<byte_stream_nal_unit>::go<Handler<Decode<void>,StatePicture,StateDecode> >(const byte_stream_nal_unit & fun, Handler<Decode<void>,StatePicture,StateDecode> & h) Line 40  C++ Symbols loaded.
    turing.exe!Handler<Decode<void>,StatePicture,StateDecode>::operator()<byte_stream_nal_unit>(byte_stream_nal_unit fun) Line 184  C++ Symbols loaded.
    turing.exe!Read<AccessUnit>::go<Handler<Decode<void>,StatePicture,StateDecode> >(AccessUnit au, Handler<Decode<void>,StatePicture,StateDecode> & h) Line 2697   C++ Symbols loaded.
    turing.exe!Handler<Decode<void>,StatePicture,StateDecode>::operator()<AccessUnit>(AccessUnit fun) Line 184  C++ Symbols loaded.
    turing.exe!Read<CodedVideoSequence>::go<Handler<Decode<void>,StateDecode> >(CodedVideoSequence __formal, Handler<Decode<void>,StateDecode> & h) Line 2643   C++ Symbols loaded.
    turing.exe!Handler<Decode<void>,StateDecode>::operator()<CodedVideoSequence>(CodedVideoSequence fun) Line 184   C++ Symbols loaded.
    turing.exe!Read<Bitstream>::go<Handler<Decode<void>,StateDecode> >(Bitstream __formal, Handler<Decode<void>,StateDecode> & h) Line 2607 C++ Symbols loaded.
    turing.exe!Handler<Decode<void>,StateDecode>::operator()<Bitstream>(Bitstream fun) Line 184 C++ Symbols loaded.
    turing.exe!decode(int argc, const char * const * argv, std::basic_ostream<char,std::char_traits<char> > & cout, std::basic_ostream<char,std::char_traits<char> > & cerr) Line 110   C++ Symbols loaded.
    turing.exe!main(int argc, const char * * argv) Line 135 C++ Symbols loaded.
    [External Code]     Annotated Frame
sgblasi commented 6 years ago

Hi, and thanks for your interest in the TUring codec. As this is a decoder issue, have you tried decoding the sequence with the HM reference decoder? We have not seen this error yet but before proceeding further, it would be good to understand whether the problem is actually in the bitstream? Thanks!

mosdav commented 6 years ago

Hi,

Thx for your prompt response

Kindly share more light" what is the HM reference decoder ? I've managed decoding the container I've used via ffmpeg (using the vanilla libx265 decoder and also via hevc_cuvid)

I've also used the classic :) BigBuckBunny_2000hevc.mp4 and this also failed on the same assert. Please let me know how I can assist you guys further

sgblasi commented 6 years ago

Hi, Sorry for the misunderstanding! I think I understand better now. The Turing codec only handles elementary streams (meaning when encoding it outputs elementary streams, and when decoding only accepts elementary streams as input). It is not possible to input directly an mp4 container for decoding - the decoder will not understand what it is. If this is the issue, then you have to first demux the mp4 (you can use ffmpeg for that) and extract the elementary stream. Once yo have the hevc streamyou should then be able to input it to the Turing codec and decode it correctly. I hope this helps!