Coder Social home page Coder Social logo

ffmpeg's Introduction

ffmpeg

ffmpeg 安装,转视频格式为m3u8,压缩视频

ffmpeg 安装

直接安装:

apt-get install ffmpeg

运行 ffmpeg 看是否出现版本号以判断是否安装成功

如果不成功运行full-ffmpeg.sh

./full-ffmpeg.sh

ffmpeg转视频格式为m3u8

ffmpeg -i test.mp4 -codec:v libx264 -codec:a mp3 -map 0 -f ssegment -segment_format mpegts -segment_list playlist.m3u8 -segment_time 10 out%03d.ts

-i : 引入视频源 -codec:v : 视频格式 -codec:a : 音频格式 segment_format: 来指定输出格式为mpegts
segment_list: 用来配置输出的列表文件名 segment_time: 切片的时长 详见:https://www.ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-ssegment/

ffmpeg压缩视频

ffmpeg -i test.mp4 -vcodec libx264 -preset fast -crf 24 -y -vf "scale=1920:-1" -acodec libmp3lame -ab 128k 12.min.mp4

详见:https://segmentfault.com/a/1190000002502526/

参考:

http://elkpi.com/topics/ffmpeg-f-hls.html/
http://www.cnblogs.com/top5/archive/2009/12/30/1636352.html/

ffmpeg's People

Contributors

saysmy avatar

Stargazers

Noa Himesaka avatar  avatar  avatar  avatar luxixiang avatar ShareTrip avatar etall avatar eJoyHao avatar YoungDone avatar 土拨鼠 avatar NT Pte Ltd avatar

Watchers

James Cloos avatar YoungDone avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.