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

可以做软文的网站聊城网站建设首选天成网络

可以做软文的网站,聊城网站建设首选天成网络,怎么创建网页链接快捷方式,库尔勒网站建设公司目录 1、播放异常比对 2、视频编码检查 2.1、正常视频解析 2.2、海康视频解析 2.3、比对工具 3、转码 3.1、maven依赖 3.2、实现代码 4、验证 在前面的文章#xff08;海康威视-按时间下载录像文件_海康威视 sdk 下载录像 大小0-CSDN博客#xff09;中#xff0c;通…目录 1、播放异常比对 2、视频编码检查 2.1、正常视频解析 2.2、海康视频解析 2.3、比对工具 3、转码 3.1、maven依赖 3.2、实现代码 4、验证 在前面的文章海康威视-按时间下载录像文件_海康威视 sdk 下载录像 大小0-CSDN博客中通过按时间段下载指定的录像视频。 在实际的播放中VLC工具可以播放而放到浏览器中则无法播放 1、播放异常比对 海康视频播放错误 出现 206 返回码则视频下载完成无法播放 普通视频播放正常 虽然出现206但播放正常。 所以考虑到可能是通过设备网络SDK下载的视频编码存在问题 2、视频编码检查 使用ffprobe工具进行视频的详细内容检查 ffprobe.exe -v quiet -print_format json -show_format -show_streams 3.mp4 2.1、正常视频解析 {     streams: [         {             index: 0,             codec_name: h264,             codec_long_name: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10,             profile: High,             codec_type: video,             codec_tag_string: avc1,             codec_tag: 0x31637661,             width: 960,             height: 720,             coded_width: 960,             coded_height: 720,             closed_captions: 0,             film_grain: 0,             has_b_frames: 2,             sample_aspect_ratio: 1:1,             display_aspect_ratio: 4:3,             pix_fmt: yuv420p,             level: 31,             color_range: tv,             color_space: bt470bg,             color_transfer: smpte170m,             color_primaries: bt470bg,             chroma_location: left,             field_order: progressive,             refs: 1,             is_avc: true,             nal_length_size: 4,             id: 0x1,             r_frame_rate: 25/1,             avg_frame_rate: 25/1,             time_base: 1/90000,             start_pts: 0,             start_time: 0.000000,             duration_ts: 22518000,             duration: 250.200000,             bit_rate: 645258,             bits_per_raw_sample: 8,             nb_frames: 6255,             extradata_size: 48,             disposition: {                 default: 1,                 dub: 0,                 original: 0,                 comment: 0,                 lyrics: 0,                 karaoke: 0,                 forced: 0,                 hearing_impaired: 0,                 visual_impaired: 0,                 clean_effects: 0,                 attached_pic: 0,                 timed_thumbnails: 0,                 captions: 0,                 descriptions: 0,                 metadata: 0,                 dependent: 0,                 still_image: 0             },             tags: {                 language: und,                 handler_name: VideoHandler,                 vendor_id: [0][0][0][0],                 encoder: Lavc58.134.100 libwz264             }         },         {             index: 1,             codec_name: aac,             codec_long_name: AAC (Advanced Audio Coding),             profile: LC,             codec_type: audio,             codec_tag_string: mp4a,             codec_tag: 0x6134706d,             sample_fmt: fltp,             sample_rate: 44100,             channels: 2,             channel_layout: stereo,             bits_per_sample: 0,             id: 0x2,             r_frame_rate: 0/0,             avg_frame_rate: 0/0,             time_base: 1/44100,             start_pts: 0,             start_time: 0.000000,             duration_ts: 11032761,             duration: 250.175986,             bit_rate: 128311,             nb_frames: 10776,             extradata_size: 2,             disposition: {                 default: 1,                 dub: 0,                 original: 0,                 comment: 0,                 lyrics: 0,                 karaoke: 0,                 forced: 0,                 hearing_impaired: 0,                 visual_impaired: 0,                 clean_effects: 0,                 attached_pic: 0,                 timed_thumbnails: 0,                 captions: 0,                 descriptions: 0,                 metadata: 0,                 dependent: 0,                 still_image: 0             },             tags: {                 language: und,                 handler_name: SoundHandler,                 vendor_id: [0][0][0][0]             }         }     ],     format: {         filename: .\\2319539678.mp4,         nb_streams: 2,         nb_programs: 0,         format_name: mov,mp4,m4a,3gp,3g2,mj2,         format_long_name: QuickTime / MOV,         start_time: 0.000000,         duration: 250.200000,         size: 24396491,         bit_rate: 780063,         probe_score: 100,         tags: {             major_brand: isom,             minor_version: 512,             compatible_brands: isomiso2avc1mp41,             encoder: Lavf58.76.100,             comment: zy-libx264,vid:2319539678         }     } } 2.2、海康视频解析 {     streams: [         {             index: 0,             codec_name: hevc,             codec_long_name: H.265 / HEVC (High Efficiency Video Coding),             profile: Main,             codec_type: video,             codec_tag_string: [0][0][0][0],             codec_tag: 0x0000,             width: 2560,             height: 1440,             coded_width: 2560,             coded_height: 1440,             closed_captions: 0,             film_grain: 0,             has_b_frames: 0,             pix_fmt: yuv420p,             level: 153,             color_range: tv,             chroma_location: left,             refs: 1,             id: 0x1e0,             r_frame_rate: 25/1,             avg_frame_rate: 25/1,             time_base: 1/90000,             start_pts: 7612160776,             start_time: 84579.564178,             duration_ts: 899820,             duration: 9.998000,             extradata_size: 88,             disposition: {                 default: 0,                 dub: 0,                 original: 0,                 comment: 0,                 lyrics: 0,                 karaoke: 0,                 forced: 0,                 hearing_impaired: 0,                 visual_impaired: 0,                 clean_effects: 0,                 attached_pic: 0,                 timed_thumbnails: 0,                 captions: 0,                 descriptions: 0,                 metadata: 0,                 dependent: 0,                 still_image: 0             }         },         {             index: 1,             codec_name: pcm_alaw,             codec_long_name: PCM A-law / G.711 A-law,             codec_type: audio,             codec_tag_string: [0][0][0][0],             codec_tag: 0x0000,             sample_fmt: s16,             sample_rate: 8000,             channels: 1,             channel_layout: mono,             bits_per_sample: 8,             id: 0x1c0,             r_frame_rate: 0/0,             avg_frame_rate: 0/0,             time_base: 1/90000,             start_pts: 7612153756,             start_time: 84579.486178,             duration_ts: 900000,             duration: 10.000000,             bit_rate: 64000,             disposition: {                 default: 0,                 dub: 0,                 original: 0,                 comment: 0,                 lyrics: 0,                 karaoke: 0,                 forced: 0,                 hearing_impaired: 0,                 visual_impaired: 0,                 clean_effects: 0,                 attached_pic: 0,                 timed_thumbnails: 0,                 captions: 0,                 descriptions: 0,                 metadata: 0,                 dependent: 0,                 still_image: 0             }         }     ],     format: {         filename: .\\3.mp4,         nb_streams: 2,         nb_programs: 0,         format_name: mpeg,         format_long_name: MPEG-PS (MPEG-2 Program Stream),         start_time: 84579.486178,         duration: 10.076000,         size: 3798048,         bit_rate: 3015520,         probe_score: 52     } } 2.3、比对工具 使用BCompare 比对工具检查两个json的差异性。共有三处主要的不同 左边为正常视频、右边为海康视频 第一处 海康转码后的格式 MPEG-H Part2/HEVC(H.265)(hevc) 第二处 第三处 3、转码 通过上图的对比优先考虑将海康视频转码为H.264 格式 3.1、maven依赖 dependencygroupIdws.schild/groupIdartifactIdjave-core/artifactIdversion2.4.5/version/dependency!-- 核心包--dependencygroupIdws.schild/groupIdartifactIdjave-native-win64/artifactIdversion2.4.5/version/dependency!-- 这个是在windows环境下的jar,使用不同的环境会调用不同的jar文件--dependencygroupIdws.schild/groupIdartifactIdjave-native-linux64/artifactIdversion2.4.5/version/dependency!-- 这个是在linux环境下的jar-- 3.2、实现代码 public static void convertH264() throws EncoderException {//源视频位置File file new File(G:\\video\\ffmpeg\\3.mp4);//目标视频位置File file1 new File(G:\\video\\ffmpeg\\4.mp4);// 创建转码器AudioAttributes audio new AudioAttributes();//指定编码audio.setCodec(aac);audio.setBitRate(new Integer(128000));//通道audio.setChannels(new Integer(2));audio.setSamplingRate(new Integer(44100));VideoAttributes video new VideoAttributes();//设置编解码器video.setCodec(h264);video.setX264Profile(VideoAttributes.X264_PROFILE.BASELINE);video.setBitRate(new Integer(1024*1024 * 2));//设置帧率video.setFrameRate(new Integer(25));//设置大小//video.setSize(new VideoSize(2560, 1440));EncodingAttributes attrs new EncodingAttributes();//格式attrs.setFormat(mp4);//attrs.setAudioAttributes(audio);attrs.setVideoAttributes(video);// 进行转码Encoder encoder new Encoder();encoder.encode(new MultimediaObject(file), file1, attrs);} 根据实际需要设置转码中是否需要音频 调整视频清晰度通过设置 video.setBitRate 大小实际测试值为1024*1024*44M大小较清晰。 但是转码时间较长10秒的3.7M视频 需要7秒转换完成最终大小4.3M 4、验证 转码后视频可以通过浏览器播放。对应的视频详情如下 {     streams: [         {             index: 0,             codec_name: h264,             codec_long_name: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10,             profile: Constrained Baseline,             codec_type: video,             codec_tag_string: avc1,             codec_tag: 0x31637661,             width: 2560,             height: 1440,             coded_width: 2560,             coded_height: 1440,             closed_captions: 0,             film_grain: 0,             has_b_frames: 0,             pix_fmt: yuv420p,             level: 50,             chroma_location: left,             field_order: progressive,             refs: 1,             is_avc: true,             nal_length_size: 4,             id: 0x1,             r_frame_rate: 25/1,             avg_frame_rate: 25/1,             time_base: 1/12800,             start_pts: 0,             start_time: 0.000000,             duration_ts: 128000,             duration: 10.000000,             bit_rate: 3599484,             bits_per_raw_sample: 8,             nb_frames: 250,             extradata_size: 39,             disposition: {                 default: 1,                 dub: 0,                 original: 0,                 comment: 0,                 lyrics: 0,                 karaoke: 0,                 forced: 0,                 hearing_impaired: 0,                 visual_impaired: 0,                 clean_effects: 0,                 attached_pic: 0,                 timed_thumbnails: 0,                 captions: 0,                 descriptions: 0,                 metadata: 0,                 dependent: 0,                 still_image: 0             },             tags: {                 language: und,                 handler_name: VideoHandler,                 vendor_id: [0][0][0][0]             }         }     ],     format: {         filename: .\\4.mp4,         nb_streams: 1,         nb_programs: 0,         format_name: mov,mp4,m4a,3gp,3g2,mj2,         format_long_name: QuickTime / MOV,         start_time: 0.000000,         duration: 10.000000,         size: 4501211,         bit_rate: 3600968,         probe_score: 100,         tags: {             major_brand: isom,             minor_version: 512,             compatible_brands: isomiso2avc1mp41,             encoder: Lavf58.20.100         }     } }
http://www.ho-use.cn/article/10812191.html

相关文章:

  • 前端网站开发框架广告制作公司经营范围有哪些
  • 人才招聘网站模板html微信小程序开发教程书
  • 哪个做网站wordpress数据结构
  • 本地主机做网站服务器wordpress 搜索 标题 内容
  • 找工作哪个网站好智联招聘网站建设与管理教程视频
  • 信阳做网站的江苏建设网官方网站
  • 本地手机网站建设学校网站建设需求分析
  • 通信部门网站备案证明建筑工程 网络图
  • php 公司网站水果网站模板
  • 网站建设的费用报价高端网站推广
  • 公司注册网站有什么好处求职简历在哪个网站做
  • 奉贤集团公司网站建设wordpress 添加用户组
  • 如何免费自己做个网站临沂门户网站制作
  • 网站备案 不关站wordpress实现动态功能
  • 网页制作相关网站苏州网站建设caiyiduo
  • 南宁百度网站建设阿里logo设计网站
  • 编程猫的网站是什么手机如何制作小程序
  • 图片生成链接的网站木渎网站制作
  • 手机网站移动应用高端网站建设的要求
  • 西安网站建设-中国互联网站备案和不备案有什么区别
  • 建设网站赚钱吗建设网站 法律责任
  • 深圳网站建设 合作品牌百度一下首页网页
  • 惠州市两学一做网站网络营销专业学什么
  • 网站域名建设怎么填写响应式设计网站
  • wordpress双语站品牌营销策划十大要点
  • 连云港市建设工程安全监督站网站首页2免费八度电影院
  • 手机怎么制作自己的网站顺德新网站建设
  • 深圳 手机网站万素网
  • 产品做网站如何谁来维护价格自助友链平台
  • 做网站的图片房产许柯wordpress