【问题标题】:How to Write ffmpeg code according to video data如何根据视频数据编写ffmpeg代码
【发布时间】:2020-04-25 16:47:29
【问题描述】:
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              : Main@L3.1
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】:

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

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

    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
    

    【讨论】:

    • 感谢我正在对视频进行测试的代码。我不能分享图片我不知道为什么。我希望我有机会和你聊天。所以我可以提供有关它的详细信息。
    • i.stack.imgur.com/XKzpE.png 这些是视频的详细信息。
    • @Tevfik 1) 我不确定我在看什么。是您要模拟的细节,还是您要转换的输入文件的细节? 2) 请不要对文字进行截图。复制和粘贴文本总是更好。然后您可以编辑您的问题以包含它或提供指向 pastebin 站点的链接。文本图像比纯文本更难使用。 3)我的回答没有为您的原始问题提供解决方案吗?
    • 不是真的@Ilogan。这些信息来自一个渲染的视频。
    • @Tevfik 目前还不清楚你到底想要什么,所以我不得不猜测一下。查看更新的答案。
    猜你喜欢
    • 2017-07-12
    • 1970-01-01
    • 2014-05-13
    • 1970-01-01
    • 1970-01-01
    • 2011-11-07
    • 1970-01-01
    • 2015-02-23
    • 2011-04-15
    相关资源
    最近更新 更多