如何根据视频数据编写ffmpeg代码?

问题描述 投票:0回答:1
Format                      : MPEG-4
Format profile              : Base Media / Version 2
Codec ID                    : mp42 (isom/mp42)
File size                   : 337 MiB
Duration                    : 1 h 23 min
Overall bit rate mode       : Variable
Overall bit rate            : 562 kb/s
Encoded date                : UTC 2020-04-23 00:22:37
Tagged date                 : UTC 2020-04-23 00:22:37
gsst                        : 0
gstd                        : 5034271

Video
ID                          : 1
Format                      : AVC
Format/Info                 : Advanced Video Codec
Format profile              : [email protected]
Format settings             : CABAC / 3 Ref Frames
Format settings, CABAC      : Yes
Format settings, Reference  : 3 frames
Codec ID                    : avc1
Codec ID/Info               : Advanced Video Coding
Duration                    : 1 h 23 min
Bit rate                    : 431 kb/s
Width                       : 1 280 pixels
Height                      : 720 pixels
Display aspect ratio        : 16:9
Frame rate mode             : Constant
Frame rate                  : 23.976 (24000/1001) FPS
Color space                 : YUV
Chroma subsampling          : 4:2:0
Bit depth                   : 8 bits
Scan type                   : Progressive
Bits/(Pixel*Frame)          : 0.019
Stream size                 : 258 MiB (77%)
Title                       : ISO Media file produced by Google Inc. Created on: 04/22/2020.
Writing library             : x264 core 155 r2901 7d0ff22
Encoded date                : UTC 2020-04-23 00:22:37
Tagged date                 : UTC 2020-04-23 00:22:37
Color range                 : Limited
Color primaries             : BT.709
Transfer characteristics    : BT.709
Matrix coefficients         : BT.709
Codec configuration box     : avcC

Audio
ID                          : 2
Format                      : AAC LC
Format/Info                 : Advanced Audio Codec Low Complexity
Codec ID                    : mp4a-40-2
Duration                    : 1 h 23 min
Bit rate mode               : Variable
Bit rate                    : 128 kb/s
Channel(s)                  : 2 channels
Channel layout              : L R
Sampling rate               : 44.1 kHz
Frame rate                  : 43.066 FPS (1024 SPF)
Compression mode            : Lossy
Stream size                 : 76.8 MiB (23%)
Title                       : ISO Media file produced by Google Inc. Created on: 04/22/2020.
Encoded date                : UTC 2020-04-23 00:22:37
Tagged date                 : UTC 2020-04-23 00:22:37

我有这些信息,我想用ffmpeg得到同样的结果。我应该怎么做?我必须使用什么代码?

先谢谢你...

video ffmpeg encode
1个回答
0
投票

不知道你为什么要这样做,但使用这些命令将模拟大多数细节。

命令模拟你的问题中显示的信息

ffmpeg -i input.mp4 -c:v libx264 -preset slow -profile:v main -level 3.1 -refs 3 -color_primaries bt709 -colorspace bt709 -color_trc bt709 -vf "scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:-1:-1,setsar=1,fps=24000/1001,format=yuv420p" -b:v 431k -c:a aac -ac 2 -ar 44100 -movflags +faststart -brand mp42 output.mp4

命令模仿你对我的回答的评论中的信息。

ffmpeg -i input.mp4 -c:v libx264 -level 4 -refs 3 -color_primaries bt709 -colorspace bt709 -color_trc bt709 -vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:-1:-1,setsar=1,fps=24,format=yuv420p" -c:a aac -ac 2 -ar 44100 -movflags +faststart output.mp4
© www.soinside.com 2019 - 2024. All rights reserved.