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

歡迎訪問 生活随笔!

生活随笔

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

编程问答

ffmpeg 声音参数_ffmpeg转换参数和压缩输出大小的比率

發布時間:2024/10/6 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ffmpeg 声音参数_ffmpeg转换参数和压缩输出大小的比率 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

該樓層疑似違規已被系統折疊?隱藏此樓查看此樓

ffmpeg 轉換壓縮比例

FFMPEG如果是壓縮為FLV文件 3個編碼可選

1. -c:v flv 標準FLV編碼 這個好處是速度快 清晰度高的話 視頻文件會比較大

2. -c:v vp6 VP6編碼 這個大家都很少使用 其實這個也算不錯

3. -c:v libx264 H.264編碼 估計使用這個的比較多 優點是同等清晰度 視頻文件更小 缺點就是轉換慢的吐血

以1.11G大小的電影 轉換為例子

libx264 500k 出片為 572.36M

flv編碼 清晰度5 出片為 872.94M

2個看起來flv的清晰度 還不如libx264的

竟然大了足足300M……

音頻都是一樣 都是Pass 1

下面是以前的備注文檔 貼出來共享下

壓縮配置選項

===============================

512Kbps

視頻bitrate 設置為 360k 最大416k 音頻設置為64k

1Mbps

視頻bitrate 設置為720k 最大832k 音頻設置為 128k

2Mbps HD

視頻bitrate 設置為1550k 最大1792k 音頻設置為128k

視頻壓縮大小

===============================

出片 Bitrate 10分鐘的視頻

320p 180 kbit/s ~13 MB

360p 300 kbit/s ~22 MB

480p 500 kbit/s ~37 MB

576p 850 kbit/s ~63 MB (SD/PAL)

720p 1000 kbit/s ~75 MB

FFMPEG參數

===============================================

-i 輸入文件 test.avi 或其他

-c:v libx264 使用h.264 編碼

-vcodec libx264 強制指定視頻編碼模式

-profile:v high 使用H.264的High模式 比較消耗資源

-pre slow 使用慢速模式 耗時間 清晰度高

//該參數還可選擇 ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow, placebo

-b:v 360k / 720k / 1550k 視頻比特率 (該參數比較重要 如果是轉換Web用途 是否正確直接影響視頻播放流暢程度)

-maxrate 500k 最大比特率

-bufsize 1000k 比特率緩衝大小

-s 000×000

視頻大小 建議值

240P 320×240 //Mobile iPhone MP4

360P 640×360 //SD FLV

480P 864×480 //HD MP4

720P 960×720 //HD MP4

-threads 0 處理器核心利用數量

-aspect 16:9 / 4:3 視頻比例

-pass N 1-3可選

音頻

-acodec libfaac 強制指定音頻處理模式

-ac 2 聲道選擇

-ar 44100 音頻赫茲

-ab 128k 比特率 64k/128k

-acodec libfaac -ac 2 -ar 44100 -ab 64k

In this article we show how to resize any video file.This method is one of the bests ways to resize a video file in Linux systems (almost any distribution), and an excellent alternative to Windows and Mac users.

Changing the resolution of a video file will be one of the most common operations that we will perform when working with video files, and as such ffmpeg is able to do it perfectly. There are several reasons why we should want to change the resolution of a video file, for example:

To reduce the size of the video. This is possible by reducing the resolution of the video. If we take for example a video in HD (1920x1080 pixels) but we know that we will never see on a screen that supports a higher resolution than say 1024x768, we can reduce the video resolution to adapt to this new resolution, saving plenty of storage space and if used on Internet, saving bandwidth also.

Many times the resolution is changed on video files to standardize its format. That is, if we have several videos and we want them all in the same resolution, will have to go through this process of changing resolution.

In the development of modern websites it is quite useful to have the videos in various resolutions depending on where they appear. We can develop sites with responsive designs in which the most suitable video for the user plays. For example, if we have a video in various formats-we say 1920x1080, 1280x720, and 640x360- we can design a responsive site that makes visitors reproduce the proper video resolution depending on visitor browser saving bandwith (keep in mind that mobile users usually pay for transferred data so it is better to transfer as less traffic as possible)

In this example we will reduce the resolution of a video in HD format (1920x1080 pixels) to 640x360 (this is a fairly used configuration for aspect ratio 16:9):

ffmpeg -i video_1920.mp4 -vf scale=640:360 video_640.mp4 -hide_banner

It is only necessary to indicate the scale video filter with the new desired resolution (640:360) with -vf scale=640:360. To consider:

We can indicate any resolution we want, but the resulting video will always have the same aspect ratio. That is, it will not distort the images, if video is in 16:9 aspect ratio, it will keep the video in 16:9 aspect ratio. The program will adjust the resulting video so it can fit in the resolution that we have given.

When changing resolution, the video must go throught the encoding process another time, so the process can be slow depending on the output format and the codec you're using for the output.

We have not mentioned it, but most of the time it does not make sense to transform a video to a higher resolution because, there can't be any improvement in video quality.

Changing the video aspect ratio

If we want to change the look of the video, knowing that the image will appear distorted, we can use an additional filter "setdar". Imagine that in the previous case we want to change the 16:9 aspect ratio to 4:3, and therefore the video at a resolution of 4:3 aspect ratio, which in this case it will be 640x480. The ffmpeg command to make this transformation would be:

ffmpeg -i video_1920.mp4 -vf scale=640:480,setdar=4:3 video_640x480.mp4 -hide_banner

The video output that we get in this case video_640x480.mp4 changes the appearance of the original video and has distorted images a bit, but it will get the resolution we want with new look.

If on the other hand, we do not want to rely on using an aspect ratio which could be "more normal" (4:3, 16:9) or if we want to make changes to other resolutions with undefined aspect ratio and we are not afraid of possible deformations of images that will appear, we can use the "setsar" filter that will save you from having to keep those aspect ratios. In this way we could transform the previous video to a resolution of 200x400 for example, with the following command:

ffmpeg -i video_1920.mp4 -vf scale=200:400,setsar=1:1 video_200x400.mp4 -hide_banner

The result in 200x400 resolution from 1920x1080 resolution makes the video output to have a distorted appearance.

Examples of video resizing

We are going to see some examples of video resizing using ffmpeg. We have an original video with a resolution of 320x180 pixels. Here it is.

As we have seen previously we can resize the video to half its original size. We are resizing it from a 320x180 pixels resolution to a 160x90 pixels resolution with the following command:

ffmpeg -i video_320x180.mp4 -vf scale=160:90 video_180x90.mp4 -hide_banner

The video has gone from a size of 1.18MB to a 354KB video (one quarter). Here is the result:

Note that the video is smaller, but we can tell the browser to make it bigger with some loss of quality compared to the original.

Now let's change the original video aspect ratio from 16:9 to 4:3. To do this we are resizing video from 320x180 to 320x240 with the following command:

ffmpeg -i video_320x180.mp4 -vf scale=320:240,setdar=4:3 video_320x240.mp4 -hide_banner

And here is the result (you can see that images appear distorted):

And now at last we will resize the video as if it has to fit in a vertical screen, so we resize from 320x180 pixels to 180x320 pixels. Here is the command which will do the task:

ffmpeg -i video_320x180.mp4 -vf scale=180:320,setsar=1:1 video_180x320.mp4 -hide_banner

And here is the distorted result:

Note that in this videos I have also included a source in webm format for maximum compatibility. I have done this way so if your browser is not able to work directly with mp4 files you can see the results in a similar webm file.

總結

以上是生活随笔為你收集整理的ffmpeg 声音参数_ffmpeg转换参数和压缩输出大小的比率的全部內容,希望文章能夠幫你解決所遇到的問題。

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

主站蜘蛛池模板: 女同一区二区三区 | 欧美在线视频一区二区三区 | 女人夜夜春 | 99re8在线精品视频免费播放 | 成人动漫av在线 | 91免费精品 | 国产乱淫a∨片免费视频 | 欧美成人免费一级人片100 | 一区二区三区在线观看视频 | 日韩电影精品 | 国产精品人成 | 欧美11一13sex性hd | 亚洲一片 | 伊人网站在线观看 | 欧美整片第一页 | 少妇超碰| 18无码粉嫩小泬无套在线观看 | 国产伦精品一区二区三区免费迷 | 五月天色网站 | 久久精品一区二区三区不卡牛牛 | 中文字幕在线观看欧美 | 精品少妇人妻av免费久久洗澡 | 欧美日韩1区2区 | 午夜视频网址 | 里番精品3d一二三区 | 96精品在线 | 性欧美ⅴideo另类hd | 色综合久久网 | 青草视频在线看 | 污片免费看 | 97视频一区| 18成人免费观看网站 | 久久综合一区 | 巨胸大乳www视频免费观看 | 欧美一级欧美三级 | 亚洲一级黄色 | 岳睡了我中文字幕日本 | 中文字幕人妻一区二区在线视频 | 国产一精品一aⅴ一免费 | 亚洲一区二区三区视频在线 | 欧美乱淫 | 欧美日韩123 | 不卡的av网站 | 噜噜噜在线视频 | 在线观看涩涩视频 | av电影在线不卡 | xxx麻豆 | 黄片毛片在线 | 中文在线永久免费观看 | 亚洲综合国产 | 羞羞动漫免费观看 | 夜色视频网| 国产偷拍一区二区 | wwwxxoo| 欧美性生活在线视频 | 亚洲欧美激情另类校园 | a天堂资源在线 | 超碰999 | 免费大片av | 国产一级一片 | 丰满人妻一区二区三区精品高清 | 国产精品乱码久久久久久久久 | 国产成人免费视频 | 国产又大又硬又粗 | 中文字幕av一区二区三区 | 欧美人与野 | 日本极品少妇 | 欧美久久久精品 | 丁香综合| 性做久久久久久免费观看欧美 | 在线观看av网页 | 亚洲自拍三区 | 亚洲久视频 | 久久9久久 | 222aaa| 午夜激情啪啪 | 欧美欧美欧美 | 99中文字幕 | 国产久精品 | 在线观看国产三级 | 精品三级| 女同亚洲精品一区二区三 | 91免费污视频 | 草久免费视频 | 欧美激情一区在线 | 男人的天堂aa | 五月激情综合 | 激情黄色小视频 | 尤物在线观看 | 中文字幕国产在线观看 | 国产在线欧美 | 欧美精品在线一区二区 | 麻豆免费电影 | 在线视频综合网 | 成人福利av | 亚洲成人精品一区二区 | 久久精品久久久精品美女 | 古装做爰无遮挡三级 | 久久久久国 |