yzzz 发表于 2023-12-28 11:16:56

opencv中执行cap>>img卡死,debug到此处varibales信息消失

在检测对象是mp4视频时,opencv中执行到cap>>img卡死,debug到此处varibales信息消失,但换成jpg图片就能执行成功。视频文件能够用cv::CAP_FFMPEG正常打开。

Video size: 1920 x 1080, fps: 30
rknn_init success!
RKNN API version: 1.5.3b6 (181ec8d8b@2023-09-12T17:11:43)
RKNN Driver version: 0.8.2
model input num: 1, output num: 3
input tensors:
   index=0, name=images, n_dims=4, dims=, n_elems=1228800, size=1228800, fmt=NHWC, type=INT8, qnt_type=AFFINE, zp=-128, scale=0.003922
output tensors:
   index=0, name=output0, n_dims=4, dims=, n_elems=1632000, size=1632000, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=69, scale=0.093581
   index=1, name=354, n_dims=4, dims=, n_elems=408000, size=408000, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=49, scale=0.085973
   index=2, name=355, n_dims=4, dims=, n_elems=102000, size=102000, fmt=NCHW, type=INT8, qnt_type=AFFINE, zp=43, scale=0.083459
^C




yzzz 发表于 2023-12-28 11:58:55

当我用ffmpeg -y -c:v h264_rkmpp -i /usr/local/test.mp4 -an output.yuv能够打开/usr/local/test.mp4,但当我将视频文件切换成我本地上传的视频时,无法打开
$ ffmpeg -i ./images/street.mp4 -c:v libx264 -preset medium -crf 23 -c:a aac -strict experimental output.mp4
ffmpeg version 4.2.4-1ubuntu1.0firefly5 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
configuration: --prefix=/usr --extra-version=1ubuntu1.0firefly5 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libdrm --enable-librga --enable-rkmpp --enable-version3 --disable-libopenh264 --disable-vaapi --disable-vdpau --disable-decoder=h264_v4l2m2m --disable-decoder=vp8_v4l2m2m --disable-decoder=mpeg2_v4l2m2m --disable-decoder=mpeg4_v4l2m2m --enable-shared --disable-doc
libavutil      56. 31.100 / 56. 31.100
libavcodec   58. 54.100 / 58. 54.100
libavformat    58. 29.100 / 58. 29.100
libavdevice    58.8.100 / 58.8.100
libavfilter   7. 57.100 /7. 57.100
libavresample   4.0.0 /4.0.0
libswscale      5.5.100 /5.5.100
libswresample   3.5.100 /3.5.100
libpostproc    55.5.100 / 55.5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './images/street.mp4':
Metadata:
    major_brand   : mp42
    minor_version   : 0
    compatible_brands: mp42mp41isomavc1
    creation_time   : 2019-05-05T04:20:56.000000Z
Duration: 00:00:18.00, start: 0.000000, bitrate: 4966 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 4962 kb/s, 30 fps, 30 tbr, 30 tbn, 60 tbc (default)
    Metadata:
      creation_time   : 2019-05-05T04:20:56.000000Z
      handler_name    : L-SMASH Video Handler
      encoder         : AVC Coding
Stream mapping:
Stream #0:0 -> #0:0 (h264 (h264_rkmpp) -> h264 (libx264))
Press to stop, [?] for help
Decoder noticed an info change (1920x1080), format=0
^C

板蓝根 发表于 2023-12-29 09:39:58

test.mp4 提供一下

yzzz 发表于 2023-12-29 20:12:19

板蓝根 发表于 2023-12-29 09:39
test.mp4 提供一下
视频怎么上传?test.mp4就是系统自带的/usr/local/test.mp4

yzzz 发表于 2023-12-29 20:25:19

本帖最后由 yzzz 于 2023-12-29 20:28 编辑

板蓝根 发表于 2023-12-29 09:39
test.mp4 提供一下标红区域是与本地上传的视频./image/street.mp4不同的部分,./image/street.mp4没有红色部分

$ ffmpeg -y -c:v h264_rkmpp -i /usr/local/test.mp4 -an output.yuv
ffmpeg version 4.2.4-1ubuntu1.0firefly5 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
configuration: --prefix=/usr --extra-version=1ubuntu1.0firefly5 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --arch=arm64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libdrm --enable-librga --enable-rkmpp --enable-version3 --disable-libopenh264 --disable-vaapi --disable-vdpau --disable-decoder=h264_v4l2m2m --disable-decoder=vp8_v4l2m2m --disable-decoder=mpeg2_v4l2m2m --disable-decoder=mpeg4_v4l2m2m --enable-shared --disable-doc
libavutil      56. 31.100 / 56. 31.100
libavcodec   58. 54.100 / 58. 54.100
libavformat    58. 29.100 / 58. 29.100
libavdevice    58.8.100 / 58.8.100
libavfilter   7. 57.100 /7. 57.100
libavresample   4.0.0 /4.0.0
libswscale      5.5.100 /5.5.100
libswresample   3.5.100 /3.5.100
libpostproc    55.5.100 / 55.5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/usr/local/test.mp4':
Metadata:
    major_brand   : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 1970-01-01T00:00:00.000000Z
    encoder         : Lavf52.64.2
Duration: 00:00:10.00, start: 0.000000, bitrate: 6836 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1920x1080 , 6664 kb/s, 24 fps, 30 tbr, 30 tbn, 60 tbc (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 166 kb/s (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : SoundHandler
Stream mapping:
Stream #0:0 -> #0:0 (h264 (h264_rkmpp) -> rawvideo (native))
Press to stop, [?] for help
Decoder noticed an info change (1920x1080), format=0
rga_api version 1.8.1_
Output #0, rawvideo, to 'output.yuv':
Metadata:
    major_brand   : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.29.100
    Stream #0:0(und): Video: rawvideo (I420 / 0x30323449), yuv420p, 1920x1080 , q=2-31, 746496 kb/s, 30 fps, 30 tbn, 30 tbc (default)
    Metadata:
      creation_time   : 1970-01-01T00:00:00.000000Z
      handler_name    : VideoHandler
      encoder         : Lavc58.54.100 rawvideo
frame=   31 fps=0.0 q=-0.0 size=   93952kB time=00:00:01.03 bitrate=744827.5kbits/s dup=7frame=   79 fps= 79 q=-0.0 size=239872kB time=00:00:02.63 bitrate=746214.6kbits/s dup=1frame=128 fps= 85 q=-0.0 size=388608kB time=00:00:04.26 bitrate=746127.3kbits/s dup=2frame=179 fps= 87 q=-0.0 size=543488kB time=00:00:05.96 bitrate=746187.7kbits/s dup=3frame=231 fps= 89 q=-0.0 size=701440kB time=00:00:07.70 bitrate=746259.3kbits/s dup=4frame=280 fps= 89 q=-0.0 size=850432kB time=00:00:09.33 bitrate=746436.3kbits/s dup=5frame=305 fps= 89 q=-0.0 Lsize=926438kB time=00:00:10.16 bitrate=746496.0kbits/s dup=66 drop=1 speed=2.97x   
video:926438kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%

郑淇峰 发表于 2024-1-7 20:25:21

麻烦问一下解决了么卡主好久了 一处理视频就不行

sting 发表于 2024-2-26 20:55:20

同问,这个问题原因是啥
页: [1]
查看完整版本: opencv中执行cap>>img卡死,debug到此处varibales信息消失