简体   繁体   中英

I can’t play HEVC encoded Flv format video files with ffplay

I could not decode a video file

I have a video file in FLV format. Someone told me that the encoding format of this video is HEVC, so I tried to play this video with ffplay. But I found that native ffplay cannot play HEVC encoded files in flv format, so I found relevant information to decode HEVC encoded files in FLV format, but this file still cannot be played.

The following is the error message, the content is that the NAL part of the analysis failed

[hevc @ 0x7fba4800fc00] Invalid NAL unit size in extradata.
[flv @ 0x7fba4800f000] Could not find codec parameters for stream 0 (Video: hevc, none, 5494 kb/s): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options

I tried to use ffplay to play other HEVC encoded videos in FLV format, and the result was no problem. So I use a hexadecimal editor to view the file that cannot be played normally. Below is the data of the first frame of video.

000003a0: xx xx xx xx xx xx xx 09 00 00 4E 00 00 00 00 00    ..........N.....
000003b0: 00 00 1E 00 00 00 00 01 00 00 00 FF E2 00 17 40    ............b..@
000003c0: 01 0C 01 FF FF 01 00 01 00 00 B0 00 00 03 00 00    ..........0.....
000003d0: 03 00 96 1D 94 09 00 1E 42 01 01 01 00 01 00 00    ........B.......
000003e0: B0 00 00 03 00 00 03 00 96 A0 01 E0 20 02 1C 5A    0..........`...Z
000003f0: 1D 96 49 0A 40 A2 01 00 07 44 01 C0 13 18 21 20    ..I.@"...D.@..!.

We can see that 09 represents the video type, 4E represents the length of TAG data, and 1C represents the key frame of HEVC, but I can't judge whether the following data is HEVC encoded data, so I suspect that the latter data may not be encoded by HEVC.

Question

Is there any way to detect the encoding format of the video based on the hexadecimal data, or who can tell me which video encoding format the following data is?

Thank you very much!

try it like this

sudo apt-get update -qq && sudo apt-get -y install autoconf automake   build-essential cmake git-core libass-dev libfreetype6-dev libgnutls28-dev libsdl2-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev meson ninja-build pkg-config texinfo wget yasm zlib1g-dev libx265-dev

git clone https://github.com/ksvc/FFmpeg.git
git reset --hard origin/release/3.4

./configure --enable-static --enable-pic --disable-encoders --enable-encoder=aac --enable-encoder=libx264 --enable-gpl --enable-libx264 --enable-encoder=libx265  --enable-libx265 --disable-decoders --enable-decoder=aac --enable-decoder=h264 --enable-decoder=hevc --disable-demuxers --enable-demuxer=aac --enable-demuxer=mov --enable-demuxer=mpegts --enable-demuxer=flv --enable-demuxer=h264 --enable-demuxer=hevc --enable-demuxer=hls --disable-muxers --enable-muxer=h264 --enable-muxer=flv --enable-muxer=f4v  --enable-muxer=mp4 --disable-doc

make -j8

./ffplay video.flv

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM