- > thread-15 got frame. use = 0.053311 s
- > thread-17 got frame. use = 0.053342 s
- > thread-16 got frame. use = 0.053319 s
- > thread-13 got frame. use = 0.057605 s
- > thread-5 got frame. use = 0.053264 s
- > thread-2 got frame. use = 0.057661 s
- > thread-22 got frame. use = 0.053360 s
- > thread-11 got frame. use = 0.053379 s
- > thread-18 got frame. use = 0.053744 s
- > thread-10 got frame. use = 0.053248 s
- > thread-6 got frame. use = 0.060539 s
- > thread-14 got frame. use = 0.072897 s
- > thread-1 got frame. use = 0.053793 s
- > thread-9 got frame. use = 0.057637 s
- > thread-24 got frame. use = 0.055093 s
- > thread-0 got frame. use = 0.028877 s
- > thread-3 got frame. use = 0.050691 s
- > thread-4 got frame. use = 0.070230 s
- > thread-7 got frame. use = 0.080159 s
- > thread-26 got frame. use = 0.000015 s
- [08/12 07:14:24.064] T/: decode_get_frame get info changed found
- [08/12 07:14:24.064] T/: decoder require buffer w:h [1280:720] stride [1280:720] size 1843200
- [08/12 07:14:24.080] T/: decode_get_frame get info changed found
- [08/12 07:14:24.080] T/: decoder require buffer w:h [1280:720] stride [1280:720] size 1843200
- [08/12 07:14:24.103] T/: decode_get_frame get info changed found
- [08/12 07:14:24.103] T/: decoder require buffer w:h [1280:720] stride [1280:720] size 1843200
- [08/12 07:14:24.113] T/: decode_get_frame get info changed found
- [08/12 07:14:24.113] T/: decoder require buffer w:h [1280:720] stride [1280:720] size 1843200
- > thread-0 got frame. use = 0.073034 s
- [08/12 07:14:24.139] T/: decode_get_frame get info changed found
- [08/12 07:14:24.139] T/: decoder require buffer w:h [1280:720] stride [1280:720] size 1843200
- [08/12 07:14:24.148] T/: decode_get_frame get info changed found
- [08/12 07:14:24.148] T/: decoder require buffer w:h [1280:720] stride [1280:720] size 1843200
- [08/12 07:14:24.159] T/: decode_get_frame get info changed found
- [08/12 07:14:24.159] T/: decoder require buffer w:h [1280:720] stride [1280:720] size 1843200
- [08/12 07:14:24.164] T/: decode_get_frame get info changed found
- [08/12 07:14:24.164] T/: decoder require buffer w:h [1280:720] stride [1280:720] size 1843200
- [08/12 07:14:24.186] T/: decode_get_frame get info changed found
- [08/12 07:14:24.186] T/: decoder require buffer w:h [1280:720] stride [1280:720] size 1843200
- [08/12 07:14:24.186] T/: decode_get_frame get info changed found
- [08/12 07:14:24.186] T/: decoder require buffer w:h [1280:720] stride [1280:720] size 1843200
- [08/12 07:14:24.212] T/: decode_get_frame get info changed found
- [08/12 07:14:24.212] T/: decoder require buffer w:h [1280:720] stride [1280:720] size 1843200
- Segmentation fault
复制代码
jefferyzhang 发表于 2022-8-12 17:26
python没办法达到那么多路的,python是有GIL全局解释锁,相当于只有一个核在跑,python的多线程因为全局解 ...
MWM 发表于 2022-8-13 09:00
好的。谢谢了。顺便问下有没有c++的demo。因为平时都是用python。
以及python 的demo在哪里下载,
jefferyzhang 发表于 2022-8-13 09:02
c++ RK提供的很多硬件处理库,比如硬件编解码的mpp; 图像处理的rga;
你要自己组合起来用。 ...
MWM 发表于 2022-8-13 09:05
好的。谢谢了。python的demo在哪里下有吗.我现在是对着文档自己写的
jefferyzhang 发表于 2022-8-13 09:15
python sdk的文档里每个章节都带有sample code呀,而且他是沿用opencv命名方式,
这都要再写demo,那这个 ...
MWM 发表于 2022-8-13 09:18
哈哈。也是就是。不过有用例还是会好。
对了后面会不会考虑加入直接读取本地文件进行编解码,而不通过第 ...
jefferyzhang 发表于 2022-8-13 09:22
你看下python sdk文档,是支持pipe输入的。里头都有demo写法了。
但是这个是有局限的,pipe没办法多路传 ...
- root@debian:/# ffmpeg: /lib/aarch64-linux-gnu/libOpenCL.so.1: no version information available (required by /lib/aarch64-linux-gnu/libavfilter.so.7)
- ffmpeg: /lib/aarch64-linux-gnu/libOpenCL.so.1: no version information available (required by /lib/aarch64-linux-gnu/libavfilter.so.7)
- ffmpeg: /lib/aarch64-linux-gnu/libOpenCL.so.1: no version information available (required by /lib/aarch64-linux-gnu/libavutil.so.56)
- ffmpeg: /lib/aarch64-linux-gnu/libOpenCL.so.1: no version information available (required by /lib/aarch64-linux-gnu/libavutil.so.56)
- ffmpeg version 4.3.4-0+deb11u1 Copyright (c) 2000-2021 the FFmpeg developers
- built with gcc 10 (Debian 10.2.1-6)
- configuration: --prefix=/usr --extra-version=0+deb11u1 --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-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --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-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --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-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
- libavutil 56. 51.100 / 56. 51.100
- libavcodec 58. 91.100 / 58. 91.100
- libavformat 58. 45.100 / 58. 45.100
- libavdevice 58. 10.100 / 58. 10.100
- libavfilter 7. 85.100 / 7. 85.100
- libavresample 4. 0. 0 / 4. 0. 0
- libswscale 5. 7.100 / 5. 7.100
- libswresample 3. 7.100 / 3. 7.100
- libpostproc 55. 7.100 / 55. 7.100
- Input #0, h264, from '/home/toybrick/1080.h264':
- Duration: N/A, bitrate: N/A
- Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x1080, 25 fps, 25 tbr, 1200k tbn, 50 tbc
- Output #0, h264, to 'pipe:':
- Metadata:
- encoder : Lavf58.45.100
- Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x1080, q=2-31, 25 fps, 25 tbr, 25 tbn, 25 tbc
- Stream mapping:
- Stream #0:0 -> #0:0 (copy)
- Press [q] to stop, [?] for help
- av_interleaved_write_frame(): Broken pipe
- Error writing trailer of pipe:: Broken pipe
- frame= 1 fps=0.0 q=-1.0 Lsize= 84kB time=00:00:00.04 bitrate=17273.0kbits/s speed= 563x
- video:84kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
- Conversion failed!
- root@debian:/# ls ffmpeg: /lib/aarch64-linux-gnu/libOpenCL.so.1:
- ls: cannot access 'ffmpeg:': No such file or directory
- ls: cannot access '/lib/aarch64-linux-gnu/libOpenCL.so.1:': No such file or directory
- root@debian:/# /usr/lib/x86_64-linux-gnu/libOpenCL.so
- bash: /usr/lib/x86_64-linux-gnu/libOpenCL.so: No such file or directory
复制代码
- import toybrick as toy
- import cv2
- import ffmpeg
- process1 = (
- ffmpeg
- .input('/home/toybrick/1080.h264')
- # .output('-', format='h264', codec='copy')
- .output('-', format='h264', codec='copy')
- .run_async(pipe_stdout=True)
- )
- disp = toy.Display("File", 1920, 1080, True)
- pipe = toy.PipeCapture(process1, toy.FMT_H264)
- pipe.start()
- while True:
- ret, frame = pipe.read(1920, 1080)
- if frame is None:
- time.sleep(0.01)
- continue
- disp.imshow(frame)
复制代码
欢迎光临 Toybrick (https://t.rock-chips.com/) | Powered by Discuz! X3.3 |