[Libav-user] hevc: No start code is found. while trying to play .mkv

Anton Sviridenko anton at corp.bluecherry.net
Wed Nov 29 18:52:17 EET 2017


I'm trying to add HEVC/H.265 support to our DVR software,
which stores recordings from IP cameras in .mkv format.

I test with Dahua IP camera model IPC-HDBW4431R-ZS
having substream configured to stream using HEVC codec.

I'm able to view livestream, but all players (mpv, mplayer, vlc, ffplay)
fail to play recorded video with the same errors:

[ffmpeg/video] hevc: No start code is found.
[ffmpeg/video] hevc: Error splitting the input into NAL units.

sample video: http://lizard.bluecherry.net/~anton/testhevc.mkv

I've googled some hint on stackoverflow suggesting to use
hevc_mp4toannexb bitstream filter,
but it does not give any difference.

steps to reproduce:

$ ffmpeg -i rtsp://admin:admin@192.168.86.113:554/cam/realmonitor?channel=1\&subtype=1
-c copy -vbsf hevc_mp4toannexb ~/temp/testhevc.mkv
ffmpeg version N-89317-gda49cdf640 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.9.4 (Gentoo 4.9.4 p1.0, pie-0.6.4)
  configuration: --prefix=/usr --libdir=/usr/lib64
--shlibdir=/usr/lib64 --docdir=/usr/share/doc/ffmpeg-9999/html
--mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc
--cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar
--optflags='-O2 -march=native -pipe' --disable-static
--enable-avfilter --enable-avresample --disable-stripping
--disable-indev=oss --disable-indev=jack --disable-outdev=oss
--enable-bzlib --disable-runtime-cpudetect --disable-debug
--disable-gcrypt --disable-gnutls --disable-gmp --enable-gpl
--enable-hardcoded-tables --enable-iconv --disable-lzma
--enable-network --disable-openssl --enable-postproc
--disable-libsmbclient --enable-ffplay --enable-sdl2 --enable-vaapi
--disable-vdpau --enable-xlib --enable-libxcb --enable-libxcb-shm
--enable-libxcb-xfixes --enable-zlib --disable-libcdio
--disable-libiec61883 --disable-libdc1394 --disable-libcaca
--disable-openal --enable-opengl --disable-libv4l2 --disable-libpulse
--disable-libopencore-amrwb --disable-libopencore-amrnb
--disable-libfdk-aac --disable-libopenjpeg --disable-libbluray
--disable-libcelt --disable-libgme --disable-libgsm --disable-mmal
--disable-libmodplug --disable-libopus --disable-libilbc
--disable-librtmp --disable-libssh --disable-libspeex --enable-librsvg
--enable-libvorbis --disable-libvpx --disable-libzvbi
--disable-libbs2b --disable-chromaprint --disable-libflite
--disable-frei0r --disable-libfribidi --enable-fontconfig
--disable-ladspa --disable-libass --enable-libfreetype
--disable-librubberband --disable-libzmq --disable-libzimg
--disable-libsoxr --enable-pthreads --disable-libvo-amrwbenc
--enable-libmp3lame --disable-libkvazaar --enable-nvenc
--disable-libopenh264 --disable-libsnappy --disable-libtheora
--disable-libtwolame --disable-libwavpack --disable-libwebp
--enable-libx264 --disable-libx265 --enable-libxvid --disable-armv5te
--disable-armv6 --disable-armv6t2 --disable-neon --disable-vfp
--disable-vfpv3 --disable-armv8 --disable-mipsdsp --disable-mipsdspr2
--disable-mipsfpu --disable-altivec --disable-amd3dnow
--disable-amd3dnowext --disable-fma3 --disable-fma4 --disable-xop
--cpu=host --disable-doc --disable-htmlpages --enable-manpages
  libavutil      56.  3.100 / 56.  3.100
  libavcodec     58.  6.101 / 58.  6.101
  libavformat    58.  2.103 / 58.  2.103
  libavdevice    58.  0.100 / 58.  0.100
  libavfilter     7.  5.100 /  7.  5.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  0.101 /  5.  0.101
  libswresample   3.  0.101 /  3.  0.101
  libpostproc    55.  0.100 / 55.  0.100
[hevc @ 0xfd6aa0] VPS 0 does not exist
    Last message repeated 1 times
[hevc @ 0xfd6aa0] SPS 0 does not exist.
Input #0, rtsp, from
'rtsp://admin:admin@192.168.86.113:554/cam/realmonitor?channel=1&subtype=1':
  Metadata:
    title           : Media Server
  Duration: N/A, start: 0.080000, bitrate: N/A
    Stream #0:0: Video: hevc (Main), yuv420p(tv), 704x576, 25 tbr, 90k
tbn, 90k tbc
Output #0, matroska, to '/home/odsk/temp/testhevc.mkv':
  Metadata:
    title           : Media Server
    encoder         : Lavf58.2.103
    Stream #0:0: Video: hevc (Main), yuv420p(tv), 704x576, q=2-31, 25
tbr, 1k tbn, 90k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[matroska @ 0x1007940] Timestamps are unset in a packet for stream 0.
This is deprecated and will stop working in the future. Fix your code
to set the timestamps properly
frame=  132 fps= 18 q=-1.0 Lsize=     423kB time=00:00:08.64 bitrate=
401.2kbits/s speed=1.18x
video:421kB audio:0kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.441737%
Exiting normally, received signal 2.

$ mpv ~/temp/testhevc.mkv
Playing: /home/user/temp/testhevc.mkv
 (+) Video --vid=1 (*) (hevc 704x576 1000.000fps)
File tags:
 Title: Media Server
[ffmpeg/video] hevc: No start code is found.
[ffmpeg/video] hevc: Error splitting the input into NAL units.
[ffmpeg/video] hevc: No start code is found.
[ffmpeg/video] hevc: Error splitting the input into NAL units.
[ffmpeg/video] hevc: No start code is found.
[ffmpeg/video] hevc: Error splitting the input into NAL units.
[ffmpeg/video] hevc: Invalid NAL unit 0, skipping.
Error while decoding frame!
Error while decoding frame!
[ffmpeg/video] hevc: No start code is found.
[ffmpeg/video] hevc: Error splitting the input into NAL units.
Error while decoding frame!

and so on...


all players were rebuilt with latest ffmpeg version from git master
(commit da49cdf640)

however, I am able to see picture while playing RTSP stream:

$ mpv rtsp://admin:admin@192.168.86.113:554/cam/realmonitor?channel=1\&subtype=1
Playing: rtsp://admin:admin@192.168.86.113:554/cam/realmonitor?channel=1&subtype=1
[ffmpeg/video] hevc: VPS 0 does not exist
[ffmpeg/video] hevc: VPS 0 does not exist
[ffmpeg/video] hevc: SPS 0 does not exist.
 (+) Video --vid=1 (hevc 704x576)
File tags:
 Title: Media Server
[ffmpeg/video] hevc: VPS 0 does not exist
No video PTS! Making something up.
VO: [opengl] 704x576 yuv420p
Invalid video timestamp: 0.000000 -> 0.000000
V: 00:00:10 Cache:  1s
[ffmpeg] NULL: missing picture in access unit


Exiting... (Quit)


More information about the Libav-user mailing list