当前位置: 首页 > news >正文

html的制作网站的优点天猫网站左侧菜单向右滑出的导航菜单

html的制作网站的优点,天猫网站左侧菜单向右滑出的导航菜单,一个wordpress模版几个网站,cookies因预料之外的输出被阻止 wordpress背景 最近整理视频编解码的代码#xff0c;早前在jetson上封装了jetson multimedia作为视频编解码的类#xff0c;供其他同事和其他组使用#xff0c;但该解码接口有一个问题#xff0c;无法首先获取视频宽高信息#xff0c;更无法直接获取视频的帧率、比特率等信息。 解…背景 最近整理视频编解码的代码早前在jetson上封装了jetson multimedia作为视频编解码的类供其他同事和其他组使用但该解码接口有一个问题无法首先获取视频宽高信息更无法直接获取视频的帧率、比特率等信息。 解决方法 使用ffmpeg库命令行参数不适合代码集成使用ffmpeg的API接口进行封装 源码实现 // ffmpeg_videoinfo.h#ifndef FFMPEG_VIDEOINFO_H #define FFMPEG_VIDEOINFO_H#include iostream #include memorystruct VideoAsset {float width; float height;float fps;float bitrate; /** bit per second */float duration; /** seconds */ };#ifdef __cplusplus extern C { #endif /* __cplusplus */int GetVideoInfo(const char *in_file, std::shared_ptrVideoAsset info);#ifdef __cplusplus }; #endif#endif // FFMPEG_VIDEOINFO_H// ffmpeg_videoinfo.cpp#include ffmpeg_videoinfo.h#ifdef __cplusplus extern C { #endif /* __cplusplus */#include libavformat/avformat.h #include libavcodec/avcodec.h #include libavutil/avutil.hint GetVideoInfo(const char *in_file, std::shared_ptrVideoAsset info){// 注册所有格式和编解码器av_register_all();// 创建一个格式上下文Format ContextAVFormatContext* formatContext nullptr;if (avformat_open_input(formatContext, in_file, nullptr, nullptr) ! 0) {fprintf(stderr, Could not open input file %s, in_file);return -1;}// 获取流信息if (avformat_find_stream_info(formatContext, nullptr) 0) {fprintf(stderr, Could not find stream information %s, in_file);return -1;}// 查找视频流int videoStreamIndex -1;for (unsigned i 0; i formatContext-nb_streams; i) {if (formatContext-streams[i]-codecpar-codec_type AVMEDIA_TYPE_VIDEO) {videoStreamIndex i;break;}}if (videoStreamIndex -1) {fprintf(stderr, Could not find video stream %s, in_file);return -1;}// 获取视频流的编码参数AVCodecParameters* codecParameters formatContext-streams[videoStreamIndex]-codecpar;AVStream* videoStream formatContext-streams[videoStreamIndex];info-fps av_q2d(videoStream-avg_frame_rate);info-width codecParameters-width;info-height codecParameters-height;int64_t totalSize 0;int64_t totalDuration 0;AVPacket packet;while (av_read_frame(formatContext, packet) 0) {if (packet.stream_index 0) {totalSize packet.size;totalDuration packet.duration;}av_packet_unref(packet);}AVRational timeBase videoStream-time_base; /** 时间基 */info-duration (float)totalDuration * av_q2d(timeBase);info-bitrate (totalDuration 0) ? (totalSize * 8.0 / info-duration) : 0.0;// 清理avformat_close_input(formatContext);return 0; } #ifdef __cplusplus }; #endif// 测试脚本 test_single_videoinfo.cpp#include ffmpeg_videoinfo.hint main(int argc, char **argv) {if(argc2){return 1;}const std::string input_h264argv[1];std::shared_ptrVideoAsset video_info_ptr std::make_sharedVideoAsset();// VideoAsset video_info;int status_code GetVideoInfo(input_h264.c_str(), video_info_ptr);if (status_code 0) {printf(GetVideoInfo failed\n);return -1;}printf(bitrate:%f, duration:%f, fps:%f, height:%f, width:%f\n,video_info_ptr-bitrate, video_info_ptr-duration, video_info_ptr-fps, video_info_ptr-height, video_info_ptr-width);return 1; } # CMakelist.txt核心add_executable(test_video_info test_single_videoinfo.cpp ffmpeg_videoinfo.h ffmpeg_videoinfo.cpp) target_compile_features(test_video_info PRIVATE cxx_std_14) target_link_libraries(test_video_info avcodec avutil avformat) # 测试./test_video_info /data/videos/l4t.h264# 输出信息示例 [h264 0xaaaac14b16a0] Stream #0: not enough frames to estimate rate; consider increasing probesize bitrate:30681866.000000, duration:164.490005, fps:20.000000, height:2160.000000, width:3840.000000 后记 本人对ffmpeg接口并不熟悉以上根据文档及搜索结果进行的实现不敢保证没有bug如果各位遇到问题可以留言交流
http://www.dnsts.com.cn/news/182479.html

相关文章:

  • 重庆夹夹虫网络公司网站建设WordPress部署商城
  • 百度搜索官方网站WordPress通讯目录
  • 怎么做网站账号注册机做蔬菜线上的网站
  • cms网站开发涉及的知识网站建设项目实施计划书
  • 网站管理工具做网站推广产品
  • 旅游投资公司网站建设wordpress带会员中心
  • 浙江学院网站建设中国执行信息公开网官网
  • 网站内容策划书西安广告设计与制作公司
  • 厦门市建设保障性住房局网站计算机应用技术主要学什么
  • 怎么用we做网站企业网站建站元素
  • 军用棉被门网站建设建网站首选公司
  • php网站开发干嘛的搜索引擎推广一般包括( )
  • 天津做网站建设公司做网站成功案例
  • 关于计算机网站开发的论文题目手机端原神
  • 单人做网站需要掌握哪些知识商贸信息网站
  • 怎么找网站济南房产信息网站官网
  • 常州建设局网站打不开比特币做空网站
  • 网站购物车设计嘉兴seo推广优化
  • 沈阳火车站阿里巴巴黄页网站
  • 编辑网站的软件手机软件腾讯企业邮箱怎么开通注册
  • 即墨做网站浦口区网站建设技术指导
  • 建站哪家好网站广告位怎么做
  • 教人做衣服得网站有哪些做网站资料准备什么
  • 展览网站制作东台网站设计
  • 网站title写法高端的科技网站建设
  • 音乐介绍网站怎么做的做外贸需要浏览外国网站
  • 一学一做教育视频网站机关网站建设考核测评总结
  • 有关网站开发的创意网站建设费用贵不贵
  • 上传网站源码google永久免费的服务器
  • 都有哪些网站网络管理系统逻辑模型