- 2023-06-08
-
回复了主题帖:
读书入围名单:走近《了不起的芯片》,多加了5本,作者温戈出题助读
个人信息无误,确认可以完成阅读计划和打卡任务
-
回复了主题帖:
【名单公布】 EEWorld邀你来拆解(第10期)——玩具总动员
已确认
- 2023-05-26
-
回复了主题帖:
EEWorld邀你来拆解(第10期)——玩具总动员
1.作为机械专业转嵌入式开发对电动跳舞机器人的动作机构比较感兴趣,猜测应该是一个连杆机构,用点击驱动,所以自由度可能只有一个,应该不能转向,看看怎么实现的,来拆解看看吧。
2. 用过很多TFT屏幕了,看看带屏幕的早教机这个成本是怎么控制的,用的什么屏,触摸方案是什么,
屏驱动方式是什么,比较想看看玩具市场的极限成本控制,来拆拆看。
- 2023-05-25
-
回复了主题帖:
评价就有机会获得【按摩仪、50元京东卡】|【多功能电工台】DIY全过程大放送!
【MPS探索营+第四站】种草多功能电工台 - 电池管理 - MPS技术论坛 (monolithicpower.cn)
- 2023-05-20
-
发表了主题帖:
【米尔MYD-YG2LX开发板】在多媒体应用场景的体验-从源码开始应用开发体验
前言
前面我们搭建了ffmpeg的开发环境,进行了ffmpeg性能测试,还演示了ffmepg进行网络推流视频播放。但是很多时候我们需要自定义开发,已经构建好的ffmpeg并不能满足我们的需求,这时我们就必须基于源码进行开发。本篇就进行基于ffmpeg的应用开发体验。
准备
前面搭建好的环境
编码测试
代码
以官方例程代码为例
位于FFmpeg/doc/examples/encode_video.c下
编译
aarch64-linux-gnu-gcc doc/examples/encode_video.c -O3 -o ./encode_video -I/home/lhj/opt/ffmpeg/board/include/ -L/home/lhj/opt/ffmpeg/board/lib -lavcodec -lavutil -lswresample -lpthread -lm
运行
导出到win下
cp encode_video /mnt/d
然后ssh或者串口登录开发板,rz导入到开发板的~目录下
chmod +x encode_video
./encode_video encode.bin mpeg1video
结果
root@myir-yg2lx:~# ./encode_video encode.bin mpeg1video
Send frame 0
Send frame 1
Write packet 0 (size= 6731)
Send frame 2
Write packet 2 (size= 3727)
Send frame 3
Write packet 1 (size= 1698)
Send frame 4
Write packet 4 (size= 2744)
Send frame 5
Write packet 3 (size= 1676)
Send frame 6
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
Write packet 6 (size= 2955)
Send frame 7
Write packet 5 (size= 1810)
Send frame 8
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
Write packet 8 (size= 3170)
Send frame 9
Write packet 7 (size= 1937)
Send frame 10
Write packet 10 (size=12306)
Send frame 11
Write packet 9 (size= 2173)
Send frame 12
Write packet 12 (size= 3770)
Send frame 13
Write packet 11 (size= 2064)
Send frame 14
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
Write packet 14 (size= 3340)
Send frame 15
Write packet 13 (size= 1941)
Send frame 16
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
Write packet 16 (size= 3121)
Send frame 17
Write packet 15 (size= 1897)
Send frame 18
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
Write packet 18 (size= 3392)
Send frame 19
Write packet 17 (size= 2172)
Send frame 20
Write packet 20 (size=12266)
Send frame 21
Write packet 19 (size= 2169)
Send frame 22
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
Write packet 22 (size= 4000)
Send frame 23
Write packet 21 (size= 2018)
Send frame 24
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
[mpeg1video @ 0xaaaae25232a0] warning, clipping 1 dct coefficients to -255..255
Write packet 24 (size= 3072)
Write packet 23 (size= 1935)
root@myir-yg2lx:~#
生成了encode.bin
root@myir-yg2lx:~# ls -al encode.bin
-rw-r--r-- 1 root root 88088 Jan 1 03:11 encode.bin
导出编码后文件到电脑
sz encode.bin
播放
.\ffplay.exe .\encode.bin
PS D:\BaiduSyncdisk\ffmpeg-master-latest-win64-gpl-shared\bin> .\ffplay.exe .\encode.bin
ffplay version N-108711-g3141dbb7ad-20221018 Copyright (c) 2003-2022 the FFmpeg developers
built with gcc 12.1.0 (crosstool-NG 1.25.0.55_3defb7b)
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --enable-shared --disable-static --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --enable-frei0r --enable-libgme --enable-libkvazaar --enable-libass --enable-libbluray --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librist --enable-libssh --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --disable-vaapi --enable-libvidstab --enable-vulkan --enable-libshaderc --enable-libplacebo --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20221018
libavutil 57. 39.101 / 57. 39.101
libavcodec 59. 51.100 / 59. 51.100
libavformat 59. 34.101 / 59. 34.101
libavdevice 59. 8.101 / 59. 8.101
libavfilter 8. 49.101 / 8. 49.101
libswscale 6. 8.112 / 6. 8.112
libswresample 4. 9.100 / 4. 9.100
libpostproc 56. 7.100 / 56. 7.100
[mpegvideo @ 000001e9075d38c0] Estimating duration from bitrate, this may be inaccurate
Input #0, mpegvideo, from '.\encode.bin':
Duration: 00:00:00.01, bitrate: 104851 kb/s
Stream #0:0: Video: mpeg1video, yuv420p(tv), 352x288 [SAR 1:1 DAR 11:9], 104857 kb/s, 25 fps, 25 tbr, 1200k tbn
10.54 M-V: 0.008 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0
解码测试
代码
以官方例程代码为例
位于FFmpeg/doc/examples/decode_video.c下
编译
aarch64-linux-gnu-gcc doc/examples/decode_video.c -O3 -o ./decode_video -I/home/lhj/opt/ffmpeg/board/include/ -L/home/lhj/opt/ffmpeg/board/lib -lavcodec -lavutil -lswresample -lpthread -lm
运行
导出到win下
cp decode_video /mnt/d
然后ssh或者串口登录开发板,rz导入到开发板的~目录下
chmod +x decode_video
./decode_video encode.bin decode.bin
结果
root@myir-yg2lx:~# ./decode_video encode.bin decode.bin
saving frame 1
saving frame 2
saving frame 3
saving frame 4
saving frame 5
saving frame 6
saving frame 7
saving frame 8
saving frame 9
saving frame 10
saving frame 11
saving frame 12
saving frame 13
saving frame 14
saving frame 15
saving frame 16
saving frame 17
saving frame 18
saving frame 19
saving frame 20
saving frame 21
saving frame 22
saving frame 23
saving frame 24
saving frame 25
root@myir-yg2lx:~#
生成文件如下
root@myir-yg2lx:~# ls -al decode*
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-1
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-10
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-11
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-12
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-13
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-14
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-15
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-16
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-17
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-18
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-19
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-2
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-20
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-21
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-22
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-23
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-24
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-25
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-3
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-4
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-5
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-6
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-7
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-8
-rw-r--r-- 1 root root 101391 Jan 1 03:17 decode.bin-9
-rwxr-xr-x 1 root root 80663160 May 20 2023 decode_video
root@myir-yg2lx:~#
总结
以上从源码编译开始体验了基于ffmpeg的应用程序开发,可以看到基于开发板完备的运行环境和优异的性能,进行多媒体应用开发页变得很便捷。
-
发表了主题帖:
【米尔MYD-YG2LX开发板】在多媒体应用场景的体验-ffmpeg网络视频播放器
前言
前面进行了ffmpeg的开发环境搭建以及性能测试,现在就可以进行具体的应用开发了。
这一篇就以一个网络视频播放的Demo来演示基于米尔MYD-YG2LX开发板快捷高效的多媒体用用开发。
过程
https://www.sample-videos.com/index.php#sample-mp4-video下下测试mp4视频
这里下载的是big_buck_bunny_720p_10mb.mp4。
导入视频文件到开发板的~目录下。
设置开发板和PC的IP地址在同一网段
我这里电脑是192.168.137.1,所以设置开发板为192.168.137.2
ifconfig eth0 192.168.37.2
root@myir-yg2lx:/usr/lib# ifconfig eth0
eth0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC> mtu 1500 metric 1
inet 192.168.137.2 netmask 255.255.255.0 broadcast 192.168.137.255
inet6 fe80::ca9:54ff:fe57:8ed4 prefixlen 64 scopeid 0x20<link>
ether 0e:a9:54:57:8e:d4 txqueuelen 1000 (Ethernet)
RX packets 345675 bytes 422385328 (402.8 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 151051 bytes 11916402 (11.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 184
确认开发板和PC网口通讯OK。
从如下地址下载安装VLC
https://www.videolan.org/vlc/
ffmpeg -re -i big_buck_bunny_720p_10mb.mp4 -an -vcodec copy -f rtp rtp://192.168.137.1:5004
打印如下
root@myir-yg2lx:~# ffmpeg -re -i big_buck_bunny_720p_10mb.mp4 -an -vcodec copy -f rtp rtp://192.168.137.1:5004
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8.3.0 (GCC)
configuration: --disable-stripping --enable-pic --enable-shared --enable-pthreads --cross-prefix=aarch64-poky-linux- --ld='aarch64-poky-linux-gcc -mtune=cortex-a55 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/recipe-sysroot' --cc='aarch64-poky-linux-gcc -mtune=cortex-a55 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/recipe-sysroot' --cxx='aarch64-poky-linux-g++ -mtune=cortex-a55 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/recipe-sysroot' --arch=aarch64 --target-os=linux --enable-cross-compile --extra-cflags=' -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map==/usr/src/debug/ffmpeg/4.2.2-r0 -fdebug-prefix-map==/usr/src/debug/ffmpeg/4.2.2-r0 -fdebug-prefix-map=/recipe-sysroot= -fdebug-prefix-map=/recipe-sysroot-native= -mtune=cortex-a55 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/recipe-sysroot' --extra-ldflags='-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now' --sysroot=/recipe-sysroot --libdir=/usr/lib64 --shlibdir=/usr/lib64 --datadir=/usr/share/ffmpeg --disable-mipsdsp --disable-mipsdspr2 --cpu=generic --pkg-config=pkg-config --disable-static --enable-alsa --enable-avcodec --enable-avdevice --enable-avfilter --enable-avformat --enable-avresample --enable-bzlib --disable-libfdk-aac --enable-gpl --disable-libgsm --disable-indev=jack --disable-libvorbis --enable-lzma --disable-libmfx --disable-libmp3lame --disable-openssl --enable-postproc --disable-sdl2 --disable-libspeex --enable-swresample --enable-swscale --enable-libtheora --disable-vaapi --disable-vdpau --disable-libvpx --enable-libx264 --disable-libx265 --disable-libxcb --disable-outdev=xv --enable-zlib
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 'big_buck_bunny_720p_10mb.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 1970-01-01T00:00:00.000000Z
encoder : Lavf53.24.2
Duration: 00:01:02.32, start: 0.000000, bitrate: 1347 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 959 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 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, 5.1, fltp, 383 kb/s (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : SoundHandler
Output #0, rtp, to 'rtp://192.168.137.1:5004':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.29.100
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 959 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbc (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 192.168.137.1
t=0 0
a=tool:libavformat 58.29.100
m=video 5004 RTP/AVP 96
b=AS:959
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z01AH9oBQBbsBEAAAAMAQAAADIPGDKg=,aO88gA==; profile-level-id=4D401F
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 1068 fps= 25 q=-1.0 Lsize= 5315kB time=00:00:42.68 bitrate=1020.2kbits/s speed= 1x
video:5262kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.001308%
复制如下部分
在PC端新建demo.sdp文件,粘体上述内容
然后使右键点击该sdp文件用VLC打开。
看到开始播放
固定帧率25帧
frame= 496 fps= 25 q=-1.0 size= 2187kB time=00:00:19.80 bitrate= 905.0kbits/s speed= 1x
总结
以上可以看到,得益于开发板有意的性能和完备的运行环境,开发多媒体应用非常边界快速。所以基本本板进行二次开发是非常不错的选择。
-
发表了主题帖:
【米尔MYD-YG2LX开发板】在多媒体应用场景的体验-ffmpeg环境搭建与性能测试
前言
瑞萨RZ/G2L是一款工业领域高性能、超高效的芯片,具备丰富多媒体功能,显示、摄像头、音频接口资源丰富,满足人机交互和图像采集需求,适用于工业HMI、医疗、工业自动化、电力、显控终端等场景。
本篇就以搭建ffmpeg开发环境以及性能的测试为例,体验该开发板在多媒体等领域的应用。
准备
以下基于WIN11+WSL2环境进行开发,需要安装必备的工具链比如aarch64-linux-gnu-等,这些不再赘述。
下载代码
git clone https://github.com/FFmpeg/FFmpeg.git
cd FFmpeg/
交叉编译
./configure --cross-prefix=aarch64-linux-gnu- --enable-cross-compile --target-os=linux --cc=aarch64-linux-gnu-gcc --arch=arm64 --prefix=/home/lhj/opt/ffmpeg/board --enable-ffmpeg --disable-armv5te --disable-armv6 --disable-armv6t2
(注意要先创建/home/lhj/opt/ffmpeg/board文件夹)
WARNING: aarch64-linux-gnu-pkg-config not found, library detection may fail.
make
make install
文件如下
lhj@lhj:~/FFmpeg$ tree /home/lhj/opt/ffmpeg/board/
/home/lhj/opt/ffmpeg/board/
|-- bin
| |-- ffmpeg
| `-- ffprobe
|-- include
| |-- libavcodec
| | |-- ac3_parser.h
| | |-- adts_parser.h
| | |-- avcodec.h
| | |-- avdct.h
| | |-- avfft.h
| | |-- bsf.h
| | |-- codec.h
| | |-- codec_desc.h
| | |-- codec_id.h
| | |-- codec_par.h
| | |-- d3d11va.h
| | |-- defs.h
| | |-- dirac.h
| | |-- dv_profile.h
| | |-- dxva2.h
| | |-- jni.h
| | |-- mediacodec.h
| | |-- packet.h
| | |-- qsv.h
| | |-- vdpau.h
| | |-- version.h
| | |-- version_major.h
| | |-- videotoolbox.h
| | |-- vorbis_parser.h
| | `-- xvmc.h
| |-- libavdevice
| | |-- avdevice.h
| | |-- version.h
| | `-- version_major.h
| |-- libavfilter
| | |-- avfilter.h
| | |-- buffersink.h
| | |-- buffersrc.h
| | |-- version.h
| | `-- version_major.h
| |-- libavformat
| | |-- avformat.h
| | |-- avio.h
| | |-- version.h
| | `-- version_major.h
| |-- libavutil
| | |-- adler32.h
| | |-- aes.h
| | |-- aes_ctr.h
| | |-- ambient_viewing_environment.h
| | |-- attributes.h
| | |-- audio_fifo.h
| | |-- avassert.h
| | |-- avconfig.h
| | |-- avstring.h
| | |-- avutil.h
| | |-- base64.h
| | |-- blowfish.h
| | |-- bprint.h
| | |-- bswap.h
| | |-- buffer.h
| | |-- camellia.h
| | |-- cast5.h
| | |-- channel_layout.h
| | |-- common.h
| | |-- cpu.h
| | |-- crc.h
| | |-- csp.h
| | |-- des.h
| | |-- detection_bbox.h
| | |-- dict.h
| | |-- display.h
| | |-- dovi_meta.h
| | |-- downmix_info.h
| | |-- encryption_info.h
| | |-- error.h
| | |-- eval.h
| | |-- ffversion.h
| | |-- fifo.h
| | |-- file.h
| | |-- film_grain_params.h
| | |-- frame.h
| | |-- hash.h
| | |-- hdr_dynamic_metadata.h
| | |-- hdr_dynamic_vivid_metadata.h
| | |-- hmac.h
| | |-- hwcontext.h
| | |-- hwcontext_cuda.h
| | |-- hwcontext_d3d11va.h
| | |-- hwcontext_drm.h
| | |-- hwcontext_dxva2.h
| | |-- hwcontext_mediacodec.h
| | |-- hwcontext_opencl.h
| | |-- hwcontext_qsv.h
| | |-- hwcontext_vaapi.h
| | |-- hwcontext_vdpau.h
| | |-- hwcontext_videotoolbox.h
| | |-- hwcontext_vulkan.h
| | |-- imgutils.h
| | |-- intfloat.h
| | |-- intreadwrite.h
| | |-- lfg.h
| | |-- log.h
| | |-- lzo.h
| | |-- macros.h
| | |-- mastering_display_metadata.h
| | |-- mathematics.h
| | |-- md5.h
| | |-- mem.h
| | |-- motion_vector.h
| | |-- murmur3.h
| | |-- opt.h
| | |-- parseutils.h
| | |-- pixdesc.h
| | |-- pixelutils.h
| | |-- pixfmt.h
| | |-- random_seed.h
| | |-- rational.h
| | |-- rc4.h
| | |-- replaygain.h
| | |-- ripemd.h
| | |-- samplefmt.h
| | |-- sha.h
| | |-- sha512.h
| | |-- spherical.h
| | |-- stereo3d.h
| | |-- tea.h
| | |-- threadmessage.h
| | |-- time.h
| | |-- timecode.h
| | |-- timestamp.h
| | |-- tree.h
| | |-- twofish.h
| | |-- tx.h
| | |-- uuid.h
| | |-- version.h
| | |-- video_enc_params.h
| | `-- xtea.h
| |-- libswresample
| | |-- swresample.h
| | |-- version.h
| | `-- version_major.h
| `-- libswscale
| |-- swscale.h
| |-- version.h
| `-- version_major.h
|-- lib
| |-- libavcodec.a
| |-- libavdevice.a
| |-- libavfilter.a
| |-- libavformat.a
| |-- libavutil.a
| |-- libswresample.a
| |-- libswscale.a
| `-- pkgconfig
| |-- libavcodec.pc
| |-- libavdevice.pc
| |-- libavfilter.pc
| |-- libavformat.pc
| |-- libavutil.pc
| |-- libswresample.pc
| `-- libswscale.pc
`-- share
|-- doc
| `-- ffmpeg
| |-- bootstrap.min.css
| |-- community.html
| |-- default.css
| |-- developer.html
| |-- faq.html
| |-- fate.html
| |-- ffmpeg-all.html
| |-- ffmpeg-bitstream-filters.html
| |-- ffmpeg-codecs.html
| |-- ffmpeg-devices.html
| |-- ffmpeg-filters.html
| |-- ffmpeg-formats.html
| |-- ffmpeg-protocols.html
| |-- ffmpeg-resampler.html
| |-- ffmpeg-scaler.html
| |-- ffmpeg-utils.html
| |-- ffmpeg.html
| |-- ffprobe-all.html
| |-- ffprobe.html
| |-- general.html
| |-- git-howto.html
| |-- libavcodec.html
| |-- libavdevice.html
| |-- libavfilter.html
| |-- libavformat.html
| |-- libavutil.html
| |-- libswresample.html
| |-- libswscale.html
| |-- mailing-list-faq.html
| |-- nut.html
| |-- platform.html
| `-- style.min.css
|-- ffmpeg
| |-- examples
| | |-- Makefile
| | |-- README
| | |-- avio_http_serve_files.c
| | |-- avio_list_dir.c
| | |-- avio_read_callback.c
| | |-- decode_audio.c
| | |-- decode_filter_audio.c
| | |-- decode_filter_video.c
| | |-- decode_video.c
| | |-- demux_decode.c
| | |-- encode_audio.c
| | |-- encode_video.c
| | |-- extract_mvs.c
| | |-- filter_audio.c
| | |-- hw_decode.c
| | |-- mux.c
| | |-- qsv_decode.c
| | |-- qsv_transcode.c
| | |-- remux.c
| | |-- resample_audio.c
| | |-- scale_video.c
| | |-- show_metadata.c
| | |-- transcode.c
| | |-- transcode_aac.c
| | |-- vaapi_encode.c
| | `-- vaapi_transcode.c
| |-- ffprobe.xsd
| |-- libvpx-1080p.ffpreset
| |-- libvpx-1080p50_60.ffpreset
| |-- libvpx-360p.ffpreset
| |-- libvpx-720p.ffpreset
| `-- libvpx-720p50_60.ffpreset
`-- man
|-- man1
| |-- ffmpeg-all.1
| |-- ffmpeg-bitstream-filters.1
| |-- ffmpeg-codecs.1
| |-- ffmpeg-devices.1
| |-- ffmpeg-filters.1
| |-- ffmpeg-formats.1
| |-- ffmpeg-protocols.1
| |-- ffmpeg-resampler.1
| |-- ffmpeg-scaler.1
| |-- ffmpeg-utils.1
| |-- ffmpeg.1
| |-- ffprobe-all.1
| `-- ffprobe.1
`-- man3
|-- libavcodec.3
|-- libavdevice.3
|-- libavfilter.3
|-- libavformat.3
|-- libavutil.3
|-- libswresample.3
`-- libswscale.3
19 directories, 235 files
lhj@lhj:~/FFmpeg$
PC编译
make clean
./configure --disable-x86asm --prefix=/home/lhj/opt/ffmpeg/win --enable-shared
make -j8 && make install
文件如下
lhj@lhj:~/FFmpeg$ tree /home/lhj/opt/ffmpeg/win/
/home/lhj/opt/ffmpeg/win/
|-- bin
| |-- ffmpeg
| |-- ffplay
| `-- ffprobe
|-- include
| |-- libavcodec
| | |-- ac3_parser.h
| | |-- adts_parser.h
| | |-- avcodec.h
| | |-- avdct.h
| | |-- avfft.h
| | |-- bsf.h
| | |-- codec.h
| | |-- codec_desc.h
| | |-- codec_id.h
| | |-- codec_par.h
| | |-- d3d11va.h
| | |-- defs.h
| | |-- dirac.h
| | |-- dv_profile.h
| | |-- dxva2.h
| | |-- jni.h
| | |-- mediacodec.h
| | |-- packet.h
| | |-- qsv.h
| | |-- vdpau.h
| | |-- version.h
| | |-- version_major.h
| | |-- videotoolbox.h
| | |-- vorbis_parser.h
| | `-- xvmc.h
| |-- libavdevice
| | |-- avdevice.h
| | |-- version.h
| | `-- version_major.h
| |-- libavfilter
| | |-- avfilter.h
| | |-- buffersink.h
| | |-- buffersrc.h
| | |-- version.h
| | `-- version_major.h
| |-- libavformat
| | |-- avformat.h
| | |-- avio.h
| | |-- version.h
| | `-- version_major.h
| |-- libavutil
| | |-- adler32.h
| | |-- aes.h
| | |-- aes_ctr.h
| | |-- ambient_viewing_environment.h
| | |-- attributes.h
| | |-- audio_fifo.h
| | |-- avassert.h
| | |-- avconfig.h
| | |-- avstring.h
| | |-- avutil.h
| | |-- base64.h
| | |-- blowfish.h
| | |-- bprint.h
| | |-- bswap.h
| | |-- buffer.h
| | |-- camellia.h
| | |-- cast5.h
| | |-- channel_layout.h
| | |-- common.h
| | |-- cpu.h
| | |-- crc.h
| | |-- csp.h
| | |-- des.h
| | |-- detection_bbox.h
| | |-- dict.h
| | |-- display.h
| | |-- dovi_meta.h
| | |-- downmix_info.h
| | |-- encryption_info.h
| | |-- error.h
| | |-- eval.h
| | |-- ffversion.h
| | |-- fifo.h
| | |-- file.h
| | |-- film_grain_params.h
| | |-- frame.h
| | |-- hash.h
| | |-- hdr_dynamic_metadata.h
| | |-- hdr_dynamic_vivid_metadata.h
| | |-- hmac.h
| | |-- hwcontext.h
| | |-- hwcontext_cuda.h
| | |-- hwcontext_d3d11va.h
| | |-- hwcontext_drm.h
| | |-- hwcontext_dxva2.h
| | |-- hwcontext_mediacodec.h
| | |-- hwcontext_opencl.h
| | |-- hwcontext_qsv.h
| | |-- hwcontext_vaapi.h
| | |-- hwcontext_vdpau.h
| | |-- hwcontext_videotoolbox.h
| | |-- hwcontext_vulkan.h
| | |-- imgutils.h
| | |-- intfloat.h
| | |-- intreadwrite.h
| | |-- lfg.h
| | |-- log.h
| | |-- lzo.h
| | |-- macros.h
| | |-- mastering_display_metadata.h
| | |-- mathematics.h
| | |-- md5.h
| | |-- mem.h
| | |-- motion_vector.h
| | |-- murmur3.h
| | |-- opt.h
| | |-- parseutils.h
| | |-- pixdesc.h
| | |-- pixelutils.h
| | |-- pixfmt.h
| | |-- random_seed.h
| | |-- rational.h
| | |-- rc4.h
| | |-- replaygain.h
| | |-- ripemd.h
| | |-- samplefmt.h
| | |-- sha.h
| | |-- sha512.h
| | |-- spherical.h
| | |-- stereo3d.h
| | |-- tea.h
| | |-- threadmessage.h
| | |-- time.h
| | |-- timecode.h
| | |-- timestamp.h
| | |-- tree.h
| | |-- twofish.h
| | |-- tx.h
| | |-- uuid.h
| | |-- version.h
| | |-- video_enc_params.h
| | `-- xtea.h
| |-- libswresample
| | |-- swresample.h
| | |-- version.h
| | `-- version_major.h
| `-- libswscale
| |-- swscale.h
| |-- version.h
| `-- version_major.h
|-- lib
| |-- libavcodec.a
| |-- libavcodec.so -> libavcodec.so.60.6.100
| |-- libavcodec.so.60 -> libavcodec.so.60.6.100
| |-- libavcodec.so.60.6.100
| |-- libavdevice.a
| |-- libavdevice.so -> libavdevice.so.60.2.100
| |-- libavdevice.so.60 -> libavdevice.so.60.2.100
| |-- libavdevice.so.60.2.100
| |-- libavfilter.a
| |-- libavfilter.so -> libavfilter.so.9.4.100
| |-- libavfilter.so.9 -> libavfilter.so.9.4.100
| |-- libavfilter.so.9.4.100
| |-- libavformat.a
| |-- libavformat.so -> libavformat.so.60.4.100
| |-- libavformat.so.60 -> libavformat.so.60.4.100
| |-- libavformat.so.60.4.100
| |-- libavutil.a
| |-- libavutil.so -> libavutil.so.58.3.100
| |-- libavutil.so.58 -> libavutil.so.58.3.100
| |-- libavutil.so.58.3.100
| |-- libswresample.a
| |-- libswresample.so -> libswresample.so.4.11.100
| |-- libswresample.so.4 -> libswresample.so.4.11.100
| |-- libswresample.so.4.11.100
| |-- libswscale.a
| |-- libswscale.so -> libswscale.so.7.2.100
| |-- libswscale.so.7 -> libswscale.so.7.2.100
| |-- libswscale.so.7.2.100
| `-- pkgconfig
| |-- libavcodec.pc
| |-- libavdevice.pc
| |-- libavfilter.pc
| |-- libavformat.pc
| |-- libavutil.pc
| |-- libswresample.pc
| `-- libswscale.pc
`-- share
|-- doc
| `-- ffmpeg
| |-- bootstrap.min.css
| |-- community.html
| |-- default.css
| |-- developer.html
| |-- faq.html
| |-- fate.html
| |-- ffmpeg-all.html
| |-- ffmpeg-bitstream-filters.html
| |-- ffmpeg-codecs.html
| |-- ffmpeg-devices.html
| |-- ffmpeg-filters.html
| |-- ffmpeg-formats.html
| |-- ffmpeg-protocols.html
| |-- ffmpeg-resampler.html
| |-- ffmpeg-scaler.html
| |-- ffmpeg-utils.html
| |-- ffmpeg.html
| |-- ffplay-all.html
| |-- ffplay.html
| |-- ffprobe-all.html
| |-- ffprobe.html
| |-- general.html
| |-- git-howto.html
| |-- libavcodec.html
| |-- libavdevice.html
| |-- libavfilter.html
| |-- libavformat.html
| |-- libavutil.html
| |-- libswresample.html
| |-- libswscale.html
| |-- mailing-list-faq.html
| |-- nut.html
| |-- platform.html
| `-- style.min.css
|-- ffmpeg
| |-- examples
| | |-- Makefile
| | |-- README
| | |-- avio_http_serve_files.c
| | |-- avio_list_dir.c
| | |-- avio_read_callback.c
| | |-- decode_audio.c
| | |-- decode_filter_audio.c
| | |-- decode_filter_video.c
| | |-- decode_video.c
| | |-- demux_decode.c
| | |-- encode_audio.c
| | |-- encode_video.c
| | |-- extract_mvs.c
| | |-- filter_audio.c
| | |-- hw_decode.c
| | |-- mux.c
| | |-- qsv_decode.c
| | |-- qsv_transcode.c
| | |-- remux.c
| | |-- resample_audio.c
| | |-- scale_video.c
| | |-- show_metadata.c
| | |-- transcode.c
| | |-- transcode_aac.c
| | |-- vaapi_encode.c
| | `-- vaapi_transcode.c
| |-- ffprobe.xsd
| |-- libvpx-1080p.ffpreset
| |-- libvpx-1080p50_60.ffpreset
| |-- libvpx-360p.ffpreset
| |-- libvpx-720p.ffpreset
| `-- libvpx-720p50_60.ffpreset
`-- man
|-- man1
| |-- ffmpeg-all.1
| |-- ffmpeg-bitstream-filters.1
| |-- ffmpeg-codecs.1
| |-- ffmpeg-devices.1
| |-- ffmpeg-filters.1
| |-- ffmpeg-formats.1
| |-- ffmpeg-protocols.1
| |-- ffmpeg-resampler.1
| |-- ffmpeg-scaler.1
| |-- ffmpeg-utils.1
| |-- ffmpeg.1
| |-- ffplay-all.1
| |-- ffplay.1
| |-- ffprobe-all.1
| `-- ffprobe.1
`-- man3
|-- libavcodec.3
|-- libavdevice.3
|-- libavfilter.3
|-- libavformat.3
|-- libavutil.3
|-- libswresample.3
`-- libswscale.3
19 directories, 261 files
lhj@lhj:~/FFmpeg$
开发板上部署
将生成的bin文件复制到windows下
cp /home/lhj/opt/ffmpeg/board/bin/* /mnt/d
将生成的lib文件复制到windows下
cp /home/lhj/opt/ffmpeg/board/lib/* /mnt/d
再将上述lib文件*.a,通过ssh登录使用rz导入到开发板的/usr/lib目录下
将ffmpeg和ffprobe通过ssh登录使用rz导入到开发板~目录下
测试
chmod +x ffmpeg ffprobe
root@myir-yg2lx:~# chmod +x ffmpeg ffprobe
root@myir-yg2lx:~# ./ffmpeg
ffmpeg version N-109968-gcc76e8340d Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
configuration: --cross-prefix=aarch64-linux-gnu- --enable-cross-compile --target-os=linux --cc=aarch64-linux-gnu-gcc --arch=arm64 --prefix=/home/lhj/opt/ffmpeg/board --enable-ffmpeg --disable-armv5te --disable-armv6 --disable-armv6t2
libavutil 58. 3.100 / 58. 3.100
libavcodec 60. 6.100 / 60. 6.100
libavformat 60. 4.100 / 60. 4.100
libavdevice 60. 2.100 / 60. 2.100
libavfilter 9. 4.100 / 9. 4.100
libswscale 7. 2.100 / 7. 2.100
libswresample 4. 11.100 / 4. 11.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
Use -h to get full help or, even better, run 'man ffmpeg'
root@myir-yg2lx:~# ./ffprobe
ffprobe version N-109968-gcc76e8340d Copyright (c) 2007-2023 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
configuration: --cross-prefix=aarch64-linux-gnu- --enable-cross-compile --target-os=linux --cc=aarch64-linux-gnu-gcc --arch=arm64 --prefix=/home/lhj/opt/ffmpeg/board --enable-ffmpeg --disable-armv5te --disable-armv6 --disable-armv6t2
libavutil 58. 3.100 / 58. 3.100
libavcodec 60. 6.100 / 60. 6.100
libavformat 60. 4.100 / 60. 4.100
libavdevice 60. 2.100 / 60. 2.100
libavfilter 9. 4.100 / 9. 4.100
libswscale 7. 2.100 / 7. 2.100
libswresample 4. 11.100 / 4. 11.100
Simple multimedia streams analyzer
usage: ffprobe [OPTIONS] INPUT_FILE
You have to specify one input file.
Use -h to get full help or, even better, run 'man ffprobe'.
root@myir-yg2lx:~#
性能测试
https://www.sample-videos.com/index.php#sample-mp4-video下下测试mp4视频
这里下载的是big_buck_bunny_720p_10mb.mp4。
开发板上
cd ~
导入视频big_buck_bunny_720p_10mb.mp4到开发板。
root@myir-yg2lx:~# ffmpeg -benchmark -i big_buck_bunny_720p_10mb.mp4 -f null -
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 8.3.0 (GCC)
configuration: --disable-stripping --enable-pic --enable-shared --enable-pthreads --cross-prefix=aarch64-poky-linux- --ld='aarch64-poky-linux-gcc -mtune=cortex-a55 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/recipe-sysroot' --cc='aarch64-poky-linux-gcc -mtune=cortex-a55 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/recipe-sysroot' --cxx='aarch64-poky-linux-g++ -mtune=cortex-a55 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/recipe-sysroot' --arch=aarch64 --target-os=linux --enable-cross-compile --extra-cflags=' -O2 -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map==/usr/src/debug/ffmpeg/4.2.2-r0 -fdebug-prefix-map==/usr/src/debug/ffmpeg/4.2.2-r0 -fdebug-prefix-map=/recipe-sysroot= -fdebug-prefix-map=/recipe-sysroot-native= -mtune=cortex-a55 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/recipe-sysroot' --extra-ldflags='-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z,relro,-z,now' --sysroot=/recipe-sysroot --libdir=/usr/lib64 --shlibdir=/usr/lib64 --datadir=/usr/share/ffmpeg --disable-mipsdsp --disable-mipsdspr2 --cpu=generic --pkg-config=pkg-config --disable-static --enable-alsa --enable-avcodec --enable-avdevice --enable-avfilter --enable-avformat --enable-avresample --enable-bzlib --disable-libfdk-aac --enable-gpl --disable-libgsm --disable-indev=jack --disable-libvorbis --enable-lzma --disable-libmfx --disable-libmp3lame --disable-openssl --enable-postproc --disable-sdl2 --disable-libspeex --enable-swresample --enable-swscale --enable-libtheora --disable-vaapi --disable-vdpau --disable-libvpx --enable-libx264 --disable-libx265 --disable-libxcb --disable-outdev=xv --enable-zlib
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 'big_buck_bunny_720p_10mb.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 1970-01-01T00:00:00.000000Z
encoder : Lavf53.24.2
Duration: 00:01:02.32, start: 0.000000, bitrate: 1347 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 959 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 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, 5.1, fltp, 383 kb/s (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : SoundHandler
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native))
Stream #0:1 -> #0:1 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, null, to 'pipe:':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.29.100
Stream #0:0(und): Video: wrapped_avframe, yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
encoder : Lavc58.54.100 wrapped_avframe
Stream #0:1(und): Audio: pcm_s16le, 48000 Hz, 5.1, s16, 4608 kb/s (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : SoundHandler
encoder : Lavc58.54.100 pcm_s16le
frame= 1557 fps= 41 q=-0.0 Lsize=N/A time=00:01:02.31 bitrate=N/A speed=1.65x
video:815kB audio:35052kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
bench: utime=32.622s stime=2.285s rtime=37.798s
bench: maxrss=28804kB
PC机上
lhj@lhj:~$ ffmpeg -benchmark -i big_buck_bunny_720p_10mb.mp4 -f null -
ffmpeg version N-109734-g806ecace91 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 9 (Ubuntu 9.4.0-1ubuntu1~20.04.1)
configuration: --disable-x86asm
libavutil 57. 44.100 / 57. 44.100
libavcodec 59. 60.100 / 59. 60.100
libavformat 59. 37.100 / 59. 37.100
libavdevice 59. 8.101 / 59. 8.101
libavfilter 8. 56.100 / 8. 56.100
libswscale 6. 8.112 / 6. 8.112
libswresample 4. 9.100 / 4. 9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'big_buck_bunny_720p_10mb.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 1970-01-01T00:00:00.000000Z
encoder : Lavf53.24.2
Duration: 00:01:02.31, start: 0.000000, bitrate: 1347 kb/s
Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 959 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native))
Stream #0:1 -> #0:1 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, null, to 'pipe:':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf59.37.100
Stream #0:0(und): Video: wrapped_avframe, yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 25 tbn (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
vendor_id : [0][0][0][0]
encoder : Lavc59.60.100 wrapped_avframe
Stream #0:1(und): Audio: pcm_s16le, 48000 Hz, 5.1, s16, 4608 kb/s (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : SoundHandler
vendor_id : [0][0][0][0]
encoder : Lavc59.60.100 pcm_s16le
frame= 1557 fps=0.0 q=-0.0 Lsize=N/A time=00:01:02.29 bitrate=N/A speed=67.5x
video:730kB audio:35052kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
bench: utime=5.981s stime=0.833s rtime=0.929s
bench: maxrss=94204kB
lhj@lhj:~$
测试结果对比
可以看到开发板720p,40帧处理没问题。
和PC相比差距10多倍,这相对于桌面级的DDR,SSD和CPU的综合环境来说,开发板的性能已经非常不错了。
开发板
PC
CPU
1/2xCortex-A55@1.2GHz
th Gen Intel(R) Core(TM) i5-12500H 2.50 GHz
maxrss
28804kB
94204kB
utime
32.622s
5.981s
Stime
2.285s
0.833s
Rtime
37.798s
0.929s
总结
本文进行了ffmpeg开发环境的搭建,并在开发板上测试了ffmpeg的性能。综上可以看出开发板的多媒体性能也是不错的,页非常适合多媒体终端的应用场景。
-
发表了主题帖:
【米尔MYD-YG2LX开发板】烧录系统
前言
官方提供了core版本和full版本系统,前者较小不含图形系统,后者较大含图形系统,又是需要根据实际选用
就需要重新烧录系统。
准备
安装teraterm
从https://osdn.net/projects/ttssh2/releases/下下载teraterm-4.106.exe 打开安装
默认选项即可
设置启动模式
拨码开关旁边有丝印说明启动模式配置
S1-S4为OFF OFF ON OFF 是下载模式
OFF OFF OFF OFF是EMMC启动模式
QSPI 启动(OFF/ON/OFF/OFF)
准备Win32DiskImager
https://sourceforge.net/projects/win32diskimager/下下载
打开安装
准备SD卡
准备8GB以上SD卡和读卡器
准备镜像
http://down.myir-tech.com/MYD-YG2LX/下下载
Full版本,解压得到MYD-YG2LX-8E2D-120-I_EMMC_FULL_L5.10.83_20230416.img
https://pan.baidu.com/s/12fe4STdUPnoQVU4_6nWYBQ?pwd=myir#list/path=%2F下
MYD-YG2LX-20230417\02_Images\QSPI_BOOT\qspi_1g下的文件,我们是1G版本所以下载对应1G版本的文件
制作文件系统烧录卡
先格式化TF卡
打开Win32DiskImager
选择TF卡对应的盘符,选择镜像文件,写入
少撸完成可看到文件如下
烧写 bootloader 到 qspi
打开Tera Term软件
选择串口
菜单栏点击设置->串口,设置波特率,点击New setting
先关闭SW开关
切换到 Download 启动方式(OFF/OFF/ON/OFF)
然后打开SW开关,长安ONOFF按键上电
打印如下
点击菜单栏
文件->发送文件->
选择文件Flash_Writer_SCIF_RZG2L_SMARC_PMIC_1GB_DDR4_1GB_1PCS.mot
传输完后输入XLS2回车
再输入11e00回车
继续输入0回车
接着继续发送bl2_bp-myir-yg2lx-1g_pmic.srec
输入y回车
输入XLS2回车
输入0回车
输入1d200回车
继续发送fip-myir-yg2lx-1g_pmic.srec
输入y
烧录完断电
烧录文件系统
先关闭SW开关
切换到 QSPI 启动(OFF/ON/OFF/OF
然后打开SW开关,长安ONOFF按键上电
打印如下
更新成功后,断电,拔掉tf卡,重新拨码 EMMC(OFF/OFF/OFF/OFF)上电启动即可。
总结
烧录过程还是比较复杂的,第一步先进入download模式,使用串口烧录boot文件到qspiflash,然后从qspiflash启动用刚才烧录的boot从tf卡中烧录文件系统到emmc。
- 2023-05-19
-
回复了主题帖:
颁奖:TI M0 精彩评论活动
xutong 发表于 2023-5-19 15:24
应该给你换成E金币了
也没有换成E币,你们有收到的吗
- 2023-05-15
-
回复了主题帖:
颁奖:TI M0 精彩评论活动
有收到的吗,怎么一直没有收到京东卡?
- 2023-05-11
-
回复了主题帖:
TI M0官方资料大搜集,在线蹲一个板子,想测评的顶起来
零漂移运算放大器、双路12位4MSPS ADC、高速比较器、12位1MSPS DAC.这配置我立马想到可以做一个微型掌上示波器了,待触发,带数字增益,带DAC简直该有的都可以有了。
- 2023-05-06
-
回复了主题帖:
测评入围名单: 米尔瑞萨RZ/G2系列64位MPU工业开发板
个人信息无误,确认可以完成评测计划
- 2023-05-01
-
发表了主题帖:
【可远程控制的 USB抓包工具tinySniffer】产品体验
本帖最后由 qinyunti 于 2023-5-1 11:08 编辑
使用过程记录
配置WIFI
Micro USB接PC,不接外设,会在PC枚举出NDIS网络设备
浏览器输入http://172.16.10.1/,可以登录设备,配置其连接WIFI
选择WIFI名,输入WIFI密码,点击ADD
设备连接好WIFI
远程登录
注册
使用google账户登录
点击Access进入命令行界面
用户名和密码是
sniff / tinySniffer
查看帮助
sniff -h
抓包
接上USB外设会自动抓包
但是没有sniffer.py 这个python文件,所以目前只能是插拔USB外设触发抓包
查看抓包文件信息
sniff -i
导出抓包文件
sniff -u tinySniffer.pcap
使用wireshark分析
如下是UVC项目设备枚举过程抓包的数据
打开wireshark
文件->打开 打开上面下载的文件
只抓到了简单的几个包,没有抓到整个枚举过程,所以很遗憾抓包功能都还不是很完善。
参考
https://www.usb7.net/products/tinySniffer
BUG
插拔USB外设,导致设备枚举失败,网页登录断开。
待改善问题
谷歌账户登录不适合国内用户
网页操作响应较慢
不能实时抓包显示分析
问题回答
在做usb开发时,遇到过那些问题,是否有抓包的需求?
USB开发核心需求是能稳定可靠的抓包,不丢包,完整记录整个总线事件和数据,然后能够进行较好的可视化,并且能进行协议解析。稍微高端一点的需要能够记录复位,挂起等一些底层的事件,上位机的协议分析是重点。
是否了解过USB抓包工具,是否购买过USB抓包工具(提供品牌型号)?
个人在使用高端力科USB分析仪(公司用) + 国产USB分析仪(个人用) + BusHound(纯软件抓包)覆盖了所有的使用需求。
在tinySniffer注册和配网时遇到了那些问题,那些地方是可以改进的?
光需要谷歌账户科学上网一点,就不可能在国内推广。
使用tinySniffer抓包解决了什么开发问题,请详细描述(提供使用tinySniffer抓包的图片和.pcap文件)?
目前来说无法替代我上述使用的三个工具的任何一个功能。TinySniffer可以做的目前都有更好的更直接可靠稳定,更低成本的方案替代。而其他方案能做的tinySniffer并不能做。
如果tinySniffer解决了你的问题,是否愿意花1350元购买这个产品?
目前来说不太可能,没有解决实际需求,并且成本并没有比其他更好的方案更低。
建议
USB分析仪的关键是在协议分析,当然稳定可靠的硬件抓包也很重要。
以一个目前在使用的硬件USB抓包分析工具USB Packet Viewer来说确实性价比不错,非常便宜可以抓USB2.0高速信号,至少作为个人使用可以替代力科做备份使用。但是实际上影响它卖更高价格的原因是稳定性和上位机。上位机很容易出现卡死,卡死必须重新插拔,软件必须重启,脚本进行协议解析所以会很卡,另外硬件设计是直接并联USB差分线进行抓取信号,所以会对原总线有一些影响,没有设计隔离。如果能解决这些问题,它这个产品至少可以定位到2000以上甚至更高,现在价格才700多,甚至今后可以做选配上位机模块做增值的售卖模式。另外作者也有自己的网站分享USB知识,是国内USB论坛做的最好的了,所以生态很重要。
说实话USB复杂的是协议层,底层只是一个硬件抓包一般需求可以由开发板,PC机,工控机等现成硬件实现(除非是做高端设备需要专用采集硬件设备),能把协议解析做到完善的,绝对就可以在市场上战胜大部分对手,不过国内目前还没有特别突出的。
给一个USB分析仪的设计方向
高端: 模数混合方向 集成示波器和USB分析仪的功能,类似周立功的一些示波器和CAN分析仪集成了逻辑分析仪和示波器的功能,优势是上位机,可以进行自动化测试,完善的协议解析等。可以记录整个总线的信号细节,进行功耗,信号等底层分析。
中端: USB抓包工具+上位机软件, 硬件抓包工具只需要抓包即可,没有信号级别的分析降低硬件成本,但是可以重点优化上位机协议分析能力,尽可能支持全的协议,并且做到GU体验优化。
低端:纯软 ,不需要硬件,类似于bust hound替代类似软件,重点也是协议分析,调试方便性等。
目前来看tinySniffer属于最后一类, ARM开发板抓包记录数据远程导出,然后使用wireshark分析, 可能创新点就是远程操作了,但是使用远程操作还不能实时显示分析抓包数据,而且还只能记录usb数据,并不能发送usb数据。这个方案怎么说都没有现成的使用BusHound+远程桌面的方案来的直接有效还不需要额外硬件,直接远程桌面还能直接实时抓包分析,还能发送usb数据进行调试,操作体验也比网页操作好,直接一台几百的x86工控机或者现有的工作pc即可。
另外从硬件上来说开源的各种pi也很多,直接树莓派即可,没必要花钱去买tinySniffer这个硬件,并且软件也没有什么创新,直接使用树莓派+云服务器自己就可简单的搭建类似的环境。
另外ARM开发板抓包的能力也有限,可能会丢包,抓不了大带宽数据。
所以目前个人总结的本方案唯一的一个卖点是可以使用本开发板,替代PC主机(但是还不能替代PC的可靠性和性能,比如数据存储量,实时性,设备兼容性等),进行抓包,然后远程下载(看起来好像还是必须远程不能本地操作?)硬件上来说为什么不直接选择树莓派自己搭建呢? 关键还有一点下载之后还是得需要pc使用wireshark进行分析,又并不能省掉PC,所以前面的替代PC得唯一卖点又没了,反而又要多买一个硬件?
1000多的成本,那么为什么不使用几百的X86的工控机呢?所以本产品没有从用户需求和痛点上解决任何问题,也没有性价比的优势,也没有性能或者某个方向的特点,比如大数据量抓包,比如不丢包的性能。远程操作的创新实际现在就有免费低成本方案替代(远程桌面+低成本工控机)而且体验更好,也没有协议解析等关键的软实力提升,使用的wireshark做解析,实际上并不能解决协议分析的痛点,并且wireshark直接支持usb抓包根本不需要使用tinySniffer进行抓包再导入抓包文件离线分析,直接使用wireshark就可以直接在线实时抓包分析,远程的方案直接使用远程桌面即可,无需各种注册登录下载离线操作,尤其是谷歌账号和科学上网还有违法风险直接劝退了。
以上都是作为usb开发人员的一些真实体验感受,说的都比较直接,一些想法供参考。一定要找到痛点,先不求全,哪怕能解决一个痛点都是有市场的,就从不做硬件单纯做软件的角度,能做一款能解析所有主流USB设备协议,并且提供友好的GUI的上位机,就能替代BusHound,wireshark等,抢占不少市场,如果还能加上发送数据调试等功能又是一大优势。
就好比哪怕是一款串口调试助手,能做到添加各种校验码,任意数据发送,数据可视化显示曲线等小功能的软件都是有市场前景的,所以一定要找准需求解决痛点。
当然如果有时候需要远程简单记录个USB包,并不需要实时显示,可以事后再找台电脑分析,并且只能登录网页的话,那么还是可以一试。
- 2023-04-25
-
回复了主题帖:
测评入围名单:可远程控制的 USB抓包工具tinySniffer
个人信息无误,确认可以完成评测计划
-
回复了主题帖:
找人试用一个usb抓包工具,有报酬
USB分析仪的关键是在协议分析,当然稳定可靠的硬件抓包也重要。
USB Packet Viewer确实性价比不错,非常便宜可以抓USB2.0高速信号,目前在使用,至少作为个人使用可以替代力科做备份使用。
但是实际上影响它卖更高价格的原因是稳定性和上位机。上位机很容易出现卡死,卡死必须重新插拔,软件必须重启,脚本进行协议解析所以会很卡,另外硬件设计是直接并联USB差分线进行抓取信号,所以会对原总线有一些影响,没有设计隔离。如果能解决这些问题,它这个产品至少可以定位到2000以上甚至更高,现在价格才700多,甚至今后可以做选配上位机模块做增值的售卖模式。另外作者也有自己的网站分享USB知识,是国内USB论坛做的最好的了,所以生态很重要。
说实话USB复杂的是协议层,底层只是一个硬件抓包,能把协议解析做到完善的,绝对就可以在市场上战胜大部分对手,不过国内目前还没有特别突出的。
给一个USB分析仪的设计方向
高端: 模数混合方向 集成示波器和USB分析仪的功能,类似周立功的一些示波器和CAN分析仪集成了逻辑分析仪和示波器的功能,优势是上位机,可以进行自动化测试,完善的协议解析等。可以记录整个总线的信号细节,进行功耗,信号等底层分析。
终端: USB抓包工具+上位机软件, 硬件抓包工具只需要抓包即可,没有信号级别的分析,但是可以重点优化上位机协议分析能力,尽可能支持全的协议,并且做到GU体验优化。
低端:纯软 ,不需要硬件,类似于bust hound替代类似软件,重点也是协议分析,调试方便性。
- 2023-04-10
-
回复了主题帖:
【得捷电子Follow me第1期】+ 1.熟悉thonny软件与micropython的基本语法
秦天qintian0303 发表于 2023-4-10 11:20
串口下载会不会比较慢?
还可以,1M以内的文件基本感觉不到太多延迟,PicoW实际用的是USB枚举的串口。
-
回复了主题帖:
【得捷电子Follow me第1期】+5.扩展项目:基于PicoW的入侵检测报警器
秦天qintian0303 发表于 2023-4-10 11:16
TOF模块可以实现几个点的检测?
在检测范围内只要有移动物体就可以,
测试看角度范围还挺大的,坐在侧面,稍微点一点头都能检测到,不过可能是在房子里有反射,所以检测角度范围变大了。
-
发表了主题帖:
【得捷电子Follow me第1期】+5.扩展项目:基于PicoW的入侵检测报警器
本帖最后由 qinyunti 于 2023-4-10 16:08 编辑
[localvideo]dabc17bd48673827dc48a9800239421d[/localvideo]
前言
前面各篇我们通过各模块玩转了PicoW,进行了LED,蜂鸣器,OLED,网络等相关的测试,
其中也有一些比较有意思的玩法,比如使用蜂鸣器演奏”两只老虎”等。
这一篇我们基于以上外设再实现一个综合的Demo:基于PicoW的入侵检测监视器。
概要设计
总体框图如下
通过TOF模块检测到人员接近,
然后将GPS的位置时间和人员接近信息通过WIFI上报给服务端,
同时通过声光的OLED,BEEP,LED等进行告警指示。
实现
TOF人员接近检测
用的TOF模块型号为HLK-LD116S-24G
检测到人员移动时会输出高,否则输出低。
使用GPIO18作为IO输入,检测TOF的输出
测试代码如下
from machine import Pin
import time
led = Pin("LED",Pin.OUT)
tof = Pin(18,Pin.IN)
led.value(0)
while True:
time.sleep(0.1)
print(tof.value())
测试如下
LED指示
当检测到人员接近时,LED点亮用于告警指示,否则熄灭。
测试代码如下
from machine import Pin
import time
led = Pin("LED",Pin.OUT)
tof = Pin(18,Pin.IN)
led.value(0)
while True:
time.sleep(0.1)
print(tof.value())
if(tof.value()):
led.value(1)
else:
led.value(0)
测试用手接近时,LED点亮,移开时熄灭。
蜂鸣器告警
当检测到人员接近时,蜂鸣器鸣叫告警,否则不鸣叫。
测试代码如下
from machine import Pin
import time
from machine import PWM
led = Pin("LED",Pin.OUT)
tof = Pin(18,Pin.IN)
pwm = PWM(Pin(16))
pwm.freq(1000)
led.value(0)
while True:
time.sleep(0.1)
print(tof.value())
if(tof.value()):
led.value(1)
pwm.duty_u16(1000)
else:
led.value(0)
pwm.duty_u16(0)
OLED显示
当检测到人员接近时,OLED显示告警信息。
测试代码如下
from machine import Pin
import time
from machine import PWM
from machine import I2C
from ssd1306 import SSD1306_I2C
WIDTH = 128
HEIGHT = 64
i2c = I2C(0)
oled = SSD1306_I2C(WIDTH, HEIGHT, i2c)
led = Pin("LED",Pin.OUT)
tof = Pin(18,Pin.IN)
pwm = PWM(Pin(16))
pwm.freq(1000)
led.value(0)
pwm.duty_u16(0)
while True:
time.sleep(0.1)
print(tof.value())
if(tof.value()):
led.value(1)
pwm.duty_u16(1000)
oled.fill(0)
oled.text("Warning!Intruder!",5,20)
oled.show()
else:
led.value(0)
pwm.duty_u16(0)
oled.fill(0)
oled.text("Safety!",5,20)
oled.show()
检测到尤文接近时显示arning!Intruder!,否则显示Safety!
网络上报
当检测到人员接近时,OLED将检测到的状态,GPS位置,当前时间等信息上报服务端。
测试
完整代码如下
from machine import Pin
import time
from machine import PWM
from machine import I2C
from ssd1306 import SSD1306_I2C
from micropyGPS import MicropyGPS
from machine import UART
import network
import socket
ssid = 'qiqiqiqi'
password = 'cqmygysdss'
host='192.168.31.236' #服务器IP地址
port = 10000 #服务器端口
my_gps = MicropyGPS()
WIDTH = 128
HEIGHT = 64
i2c = I2C(0)
oled = SSD1306_I2C(WIDTH, HEIGHT, i2c)
uart0 = UART(0, baudrate=9600, tx=Pin(0), rx=Pin(1))
led = Pin("LED",Pin.OUT)
tof = Pin(18,Pin.IN)
pwm = PWM(Pin(16))
pwm.freq(1000)
led.value(0)
pwm.duty_u16(0)
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(ssid, password)
# 网络连接
# Wait for connect or fail
max_wait = 10
while max_wait > 0:
if wlan.status() < 0 or wlan.status() >= 3:
break
max_wait -= 1
print('waiting for connection...')
time.sleep(1)
# Handle connection error
if wlan.status() != 3:
raise RuntimeError('network connection failed')
else:
print('connected')
status = wlan.ifconfig()
print( 'ip = ' + status[0] )
#建立Socket连接
s=socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
#Socket属性
s.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
while True:
time.sleep(0.1)
#print(tof.value())
if uart0.any():
stat = my_gps.update(uart0.read(1).decode('utf-8')) # Note the conversion to to chr, UART outputs ints normally
if stat:
print('Latitude:', my_gps.latitude_string())
print('Longitude:', my_gps.longitude_string())
print('Speed:', my_gps.speed_string('kph'), 'or', my_gps.speed_string('mph'), 'or', my_gps.speed_string('knot'))
print('Date (Long Format):', my_gps.date_string('long'))
print('Date (Short D/M/Y Format):', my_gps.date_string('s_dmy'))
print('timestamp (Short [H,M,S] Format):', my_gps.timestamp)
sstr = 'Warning!Intruder!' + my_gps.latitude_string() + my_gps.longitude_string() + my_gps.date_string('s_dmy') + '\r\n'
s.sendto(sstr,(host,port))
stat = None
if(tof.value()):
led.value(1)
pwm.duty_u16(1000)
oled.fill(0)
oled.text("Warning!Intruder!",5,20)
oled.show()
else:
led.value(0)
pwm.duty_u16(0)
oled.fill(0)
oled.text("Safety!",5,20)
oled.show()
总结
以上我们先进行了概要设计,然后根据模块划分对各模块进行测试,最后综合实现设计目标。
从整个过程来看,由于之前对每个模块都进行过了充分的测试,所以本篇实际就是’组装’的过程,
有了设计框图,按照概要设计进行实现,比较顺利。
本次活动非常有意义,熟悉了PicoW的相应的开发,进行了各个模块的驱动,
并实现了一些有意思的测试最终实现了一个综合的Demo,收获满满。
最后有一点小小的建议,可以再丰富一点免费的外设模块,这样可以发挥更多的创意。
- 2023-04-09
-
回复了主题帖:
【得捷电子Follow me第1期】+0.提交内容
Jacktang 发表于 2023-4-9 08:50
有不了解这些代码的用途的,应该说明一下
感谢提醒,后面再补充下
-
回复了主题帖:
【得捷电子Follow me第1期】+4.实现定位功能
Jacktang 发表于 2023-4-9 16:47
定位功能怎么实现的,代码没有个注释啊
从串口接收到GPS发出得NMEA 报文中解析, 使用micropyGPS.py这个库进行解析。
感谢提醒,后面代码可以多添加下注释。