日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ffmpeg教程

發布時間:2025/4/16 编程问答 45 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ffmpeg教程 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一、命名格式

ffmpeg input(s) [codec options] output(s)

輸入(input)

參數 -i Input.file/stream_url 輸入可以為一個文件,也可以是一個視頻流地址。
“-re” 選項標識以實時方式讀取文件;這允許使用文件作為 "live” 數據源。

編碼器(Codecs)

A huge array of options is available here, however we’ll only cover two things: Copying codecs and changing codecs to H264 for video and AAC for audio. H264/AAC 是最常用的編碼器are the most common codecs at the moment there’s a good chance you already have these in your files, otherwise re-encoding them to H264/AAC with the default settings of ffmpeg will almost certainly give you what you want. If not feel free to check out the ffmpeg documentation here.
使用-c:v設置視頻編碼;
使用-c:a設置音頻編碼;
使用-c設置音頻和視頻編碼。

Copying codecs (options)

The copying of codecs couldn’t be easier with ffmpeg. You only need to use -c copy to copy both the video and audio codecs. Copying the codecs allows you to ingest a media file/stream and record it or change it to a different format. You can also only copy a specific codec like this: -c:v copy for video and -c:a copy for audio. The neat thing about using the copy option is that it will not re-encode your media data, making this an extremely fast operation.

Encoding to H264/AAC (options)

Ffmpeg允許改變video and audio track separately. You can copy a video track while only editing the audio track if you wish. Copying is always done with the copy codec. An encode to H264/AAC is done by using the option -c:a aac -strict -2 -c:v h264. Older versions of ffmpeg might require the equivalent old syntax -acodec aac -strict -2 -vcodec h264 instead.

輸出(output)

The output of ffmpeg can either be a file or a push over a stream url. To record it to a file use outputfile.ext; almost any media type can be chosen by simply using the right extension. To push over a stream use -f FORMAT STREAM_URL. The most commonly used format for live streaming will be RTMP, but RTMP streams internally use the FLV format. That means you’ll have to use -f flv rtmp://SERVERIP:PORT/live/STREAMNAME for this. Other stream types may auto-select their format based on the URL, similar to how this works for files.

案例

(1)攝像頭信息采集和錄制推流

攝像頭名稱要通過這個命令拿到,然后替換掉下面的“Integrated Camera”這個名稱即可推流或者錄制成文件

ffmpeg -list_devices true -f dshow -i dummy
ffmpeg -f dshow -i video=“Integrated Camera” -vcodec libx264 -acodec copy -preset:v ultrafast -tune:v zerolatency -f flv rtmp://eguid.cc:1935/rtmp/eguid

(2)桌面屏幕錄制

1、屏幕錄制并保存成文件

ffmpeg -f gdigrab -i desktop eguid.mp4

2、屏幕錄制并推流

ffmpeg -f gdigrab -i desktop -vcodec libx264 -preset:v ultrafast
-tune:v zerolatency -f flv rtmp://eguid.cc:1935/rtmp/destop

(3)視頻文件推流

ffmpeg -re -i eguid.flv -vcodec copy -acodec copy -f flv -y
rtmp://eguid.cc:1935/rtmp/eguid

四、轉流(rtsp轉rtmp為例)

ffmpeg -i rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov
-rtsp_transport tcp -vcodec h264 -acodec aac -f flv rtmp://eguid.cc:1935/rtmp/eguid

五、拉流

ffmpeg -i rtmp://eguid.cc:1935/rtmp/eguid -vcodec h264 -f flv -acodec
aac -ac 2 eguid.flv

(6)音頻推流

ffmpeg -f mp3 -i sender.mp3 -acodec libmp3lame -ab 128k -ac 2 -ar
44100 -re -f rtp rtp://10.14.35.23:1234

流媒體服務

livego

Nginx RMTP模塊

RED5

客戶端

VLC media player

總結

以上是生活随笔為你收集整理的ffmpeg教程的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: 国产精品一区二区无线 | 婷婷在线一区 | 阿v免费视频 | 色人阁五月天 | 欧美一区二区三区电影 | 熟女人妻aⅴ一区二区三区60路 | 精品国产一区二区三区久久久 | 天堂在线中文网 | 天天操天天干天天操 | 欧洲精品码一区二区三区免费看 | 日韩人妻无码精品久久免费 | 久久久国产网站 | 白石茉莉奈番号 | 欧美 日韩 国产 成人 在线 | 国产精品后入内射日本在线观看 | 国产色网站 | 最新中文字幕免费视频 | 黄色av一级| 欧美成人午夜精品免费 | 丰满人妻一区二区三区精品高清 | 国产一级在线观看 | 欧美日韩在线免费 | 日本免费精品视频 | 国产精品久久久久久久久晋中 | 91干| 少妇精品一区 | 亚洲精品在线电影 | 日韩中文字幕在线一区 | 在线看免费av | 三上悠亚久久 | 久久精品av | 一级片免费的 | 久久久久久无码午夜精品直播 | 色人人 | 性插插视频 | 伊人色图| 欧美精品日韩在线观看 | av片手机在线观看 | 亚洲免费观看av | 91夜色视频 | 国产一区视频在线播放 | 欧美 日韩 国产 成人 在线 91 | 亚洲 欧美 激情 另类 校园 | 怡红院一区二区三区 | 高清国产在线 | 黄色片视频免费 | 国产精品久久久久久久久久东京 | 亚洲欧美中日韩 | 一区二区日韩欧美 | 国产高清一区二区 | 日本在线免费观看 | 色呦呦国产 | 福利视频一二区 | 日日干天天 | 草草在线影院 | 一级淫片a | 欧美人与禽zozzozzo | 李丽珍毛片| 女同调教视频 | 久久免费视频1 | 欧美日韩首页 | 青青草原国产视频 | 精品伊人 | 午夜一区二区三区在线 | 国产主播在线一区 | 中文字幕视频在线播放 | 亚洲一区二区三区在线 | 偷拍亚洲另类 | 国产一区在线不卡 | 日本丰满大乳奶做爰 | 亚洲女人av | 九九热这里有精品视频 | av污在线观看 | 蜜臀av在线观看 | 日韩视频免费在线播放 | 久久美女精品 | eeuss鲁片一区二区三区在线观看 | 波多野结衣av电影 | 欧美日韩国产三级 | 成人蜜桃视频 | 国产一级黄色av | 日本久久影视 | 精品在线视频一区二区三区 | 日韩精品久久一区二区 | 魔性诱惑 | 久久综合第一页 | 欧美a在线播放 | 国产对白在线 | 亚洲精品午夜精品 | 91蜜桃网| 91国视频| 精品视频大全 | 成人做受黄大片 | 久久福利小视频 | 日韩理论在线 | 亚洲欧美在线视频观看 | 欧美成人午夜精品免费 | av第一福利| 青青草原成人 |