openh264 icon indicating copy to clipboard operation
openh264 copied to clipboard

ffmpeg decode error

Open guiyongdong opened this issue 4 years ago • 3 comments

  1. I use command: ./h264enc -utype 0 -org 1111.yuv -numl 3 -numtl 1 -frin 30 -frout 0 30 -frout 1 30 -frout 2 30 -sw 720 -sh 1280 -dw 0 180 -dh 0 320 -dw 1 360 -dh 1 640 -dw 2 720 -dh 2 1280 -rc -1 -lqp 0 24 -lqp 1 24 -lqp 2 24 -iper 0 -bf OUTPUT.264 -mfile 1
  2. Three files are then generated,OUTPUT_layer0.264,OUTPUT_layer1.264, OUTPUT_layer2.264
  3. then I use command: ../h264dec OUTPUT_layer0.264 1.yuv. 1.yuv can be created.
  4. but I use command:ffmpeg -i OUTPUT_layer0.264 1.yuv, There seems to be an error:

➜ Desktop ffmpeg -i OUTPUT_layer0.264 1.yuv ffmpeg version 3.4 Copyright (c) 2000-2017 the FFmpeg developers built with Apple LLVM version 9.0.0 (clang-900.0.37) configuration: --prefix=/usr/local/Cellar/ffmpeg/3.4 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-ffplay --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma libavutil 55. 78.100 / 55. 78.100 libavcodec 57.107.100 / 57.107.100 libavformat 57. 83.100 / 57. 83.100 libavdevice 57. 10.100 / 57. 10.100 libavfilter 6.107.100 / 6.107.100 libavresample 3. 7. 0 / 3. 7. 0 libswscale 4. 8.100 / 4. 8.100 libswresample 2. 9.100 / 2. 9.100 libpostproc 54. 7.100 / 54. 7.100 [h264 @ 0x7fd31481aa00] sps_id 1 out of range Last message repeated 1 times Input #0, h264, from 'OUTPUT_layer0.264': Duration: N/A, bitrate: N/A Stream #0:0: Video: h264 (Constrained Baseline), yuv420p(progressive), 180x320, 25 fps, 25 tbr, 1200k tbn, 50 tbc [h264 @ 0x7fd315009400] sps_id 1 out of range Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native)) Error while opening decoder for input stream #0:0 : Invalid data found when processing input

guiyongdong avatar Apr 28 '21 03:04 guiyongdong

Because FFMpeg don't support subset_seq_parameter_set.

kanzhu-cisco avatar Aug 31 '21 07:08 kanzhu-cisco

I have the same problem, could you tell me how to solve it?

hzk7287 avatar Sep 23 '21 03:09 hzk7287

you can first filter the outputted 264 file and drop what you do not want (like subset sps, etc) then do following ffmpeg decoding.

huili2 avatar Dec 16 '22 05:12 huili2