视频切片技术【转载】

最近接触视频的比较多,发现一种视频转码,有助于防止浏览器获得视频的链接,以防止下载视频(适用于数量不多的视频上传)Ffmpeg:是一套可以用来记录、转换数字音频、视频,并能将其转化为流的开源计算机程序。采用LGPL或GPL许可证。它提供了录制、转换以及流化音视频的完整解决方案。

  • Windows下安装ffmpeg:

1.FFmpeg下载:http://ffmpeg.zeranoe.com/builds/

图片[1]-视频切片技术【转载】-嗨皮网(Hpeak.cn)

2.下载并解压FFmpeg文件夹,它会生成一个类似名为“ffmpeg-20170605-4705edb-win64-static.zip”的新文件夹,解压到d盘。

3.配置FFmpeg环境变量:

点击“开始菜单”,再点击“控制面板”,再点击“系统”,然后点击“高级系统设置”,跳出“系统属性”窗口后,最后点击“环境变量”按钮,在“Path”变量原有变量值内容上加上“;d:\ffmpeg\bin”:(如下图所示)

图片[2]-视频切片技术【转载】-嗨皮网(Hpeak.cn)

 

4.打开命令提示符窗口(cmd)。输入命令“ffmpeg –version”。如果命令提示窗口返回FFmpeg的版本信息(如下图所示),那么就说明安装成功了,你可以在命令提示行中任意文件夹下运行FFmpeg。

图片[3]-视频切片技术【转载】-嗨皮网(Hpeak.cn)

 

  • 使用:MP4转为m3u8我也是初学,只了解了一点点下面是MP4转为m3u8的代码,贴出来,讲讲其中参数的含义ffmpeg -i 1.mp4 -f segment -segment_time 60 -segment_format mpegts -segment_list list_file.m3u8 -c copy -bsf:v h264_mp4toannexb -map 0 output_file-%d.ts
  • 参数说明:
  • -i : 引入视频源 (1.mp4: 视频名称)
  • -segment_time: 切片的时长 (60秒)
  • -segment_format: 来指定输出格式为mpegts
  • -segment_list: 用来配置输出的列表文件名 (输出list_file.m3u8文件)
  • -c copy: 拷贝原文件
  • -map file:stream 设置输入流映射
  • -codec:v : 视频格式
  • -codec:a : 音频格式

本文转载于:https://blog.yayuanzi.com/21482.html

© 版权声明
THE END
喜欢就支持一下吧
点赞0赞赏
分享
评论 共8条

请登录后发表评论

    • HF的头像-嗨皮网(Hpeak.cn)
    • dizi0
      As a Newbie, I am permanently searching online for articles that can aid me. Thank you Carolee Woodie Rochkind
      8月前
    • HF的头像-嗨皮网(Hpeak.cn)
    • mp30
      After looking over a handful of the articles on your site, I really appreciate your way of writing a blog. I added it to my bookmark website list and will be checking back in the near future. Please visit my web site as well and let me know your opinion. Darda Thorpe Ferro
      8月前
    • HF的头像-嗨皮网(Hpeak.cn)
    • dizi0
      Simply wanna state that this is handy , Thanks for taking your time to write this. Jonis Maje Mattheus
      8月前
    • HF的头像-嗨皮网(Hpeak.cn)
    • watch0
      I loved as much as you will receive carried out right here. The sketch is tasteful, your authored material stylish. nonetheless, you command get bought an impatience over that you wish be delivering the following. unwell unquestionably come more formerly again as exactly the same nearly very often inside case you shield this hike. Hermina Tracey Royden
      8月前
    • HF的头像-嗨皮网(Hpeak.cn)
    • hindi movie0
      Very nice post. I definitely love this site. Continue the good work! Etti Willie Bozovich
      8月前
    • HF的头像-嗨皮网(Hpeak.cn)
    • diziler0
      Great, thanks for sharing this blog. Really thank you! Want more. Lanette Arni Mair
      8月前
    • HF的头像-嗨皮网(Hpeak.cn)
    • hindi movie0
      Quality articles, I am waiting for your next article. keep working Stoddard Munmro Broome
      8月前
    • HF的头像-嗨皮网(Hpeak.cn)
    • online0
      whoah this weblog is magnificent i like reading your articles. Keep up the great work! You already know, a lot of persons are looking round for this info, you could aid them greatly. Doro Emmit Utta
      8月前