ffmpeg之图片串流h264视频
生活随笔
收集整理的這篇文章主要介紹了
ffmpeg之图片串流h264视频
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
0 背景
在圖像開發過程中,需要將圖片編碼成視頻做一些測試,使用 opencv 是一種方式,但是默認不支持 h264 編碼格式,還需要做一次轉換,而使用 ffmpeg 指令可以快速實現這一功能,減少開發量
1 環境配置
本文在嵌入式 linux 系統中做測試,使用 apt 安裝即可
sudo apt install ffmpeg2 測試
指令格式
ffmpeg ?-r 25 -pattern_type glob -i './no_object/*.jpg' -c:v libx264 out.mp4
其中:
- -i 指定序列圖片的位置
- -vcode 指定視頻的編碼格式
- -r 指定視頻幀率
- -y 覆蓋同名的視頻
其它的可設置的參數含義如下
Video options: -vframes number set the number of video frames to output -r rate set frame rate (Hz value, fraction or abbreviation) -s size set frame size (WxH or abbreviation) -aspect aspect set aspect ratio (4:3, 16:9 or 1.3333, 1.7777) -bits_per_raw_sample number set the number of bits per raw sample -vn disable video -vcodec codec force video codec ('copy' to copy stream) -timecode hh:mm:ss[:;.]ff set initial TimeCode value. -pass n select the pass number (1 to 3) -vf filter_graph set video filters -ab bitrate audio bitrate (please use -b:a) -b bitrate video bitrate (please use -b:v) -dn disable data總結
以上是生活随笔為你收集整理的ffmpeg之图片串流h264视频的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: [vue] `<template></t
- 下一篇: [html] 什么是本地存储的有效期?