【问题标题】:I Can't Upload This Video File (mp4) To Twitter我无法将此视频文件 (mp4) 上传到 Twitter
【发布时间】:2020-03-22 05:20:09
【问题描述】:

我尝试将视频文件 (mp4) 上传到 Twitter,但该网站抱怨无法上传。 Twitter似乎有一些条件才能允许上传视频:

File Type: MP4 or MOV
Max Time: 2 minutes and 20 seconds
Minimum Resolution: 32 x 32
Maximum Resolution: 1920 x 1200
Aspect Ratios: 1:2.39 - 2.39:1 range (inclusive)
Maximum Frame rate: 40 fps
Maximum Video Bitrate: 25 Mbps

这里是关于我试图上传的视频的一般信息,但 Twitter 一直说在处理它时出现问题(我通过 mediainfo 获得的信息):

General
Complete name                            : tmp03.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/mp41)
File size                                : 6.71 MiB
Duration                                 : 2mn 15s
Overall bit rate mode                    : Constant
Overall bit rate                         : 417 Kbps
Encoded date                             : UTC 1904-01-01 00:00:00
Tagged date                              : UTC 1904-01-01 00:00:00
Writing application                      : Lavf58.29.100

Video
ID                                       : 1
Format                                   : MPEG-4 Visual
Format profile                           : Simple@L1
Format settings, BVOP                    : No
Format settings, QPel                    : No
Format settings, GMC                     : No warppoints
Format settings, Matrix                  : Default (H.263)
Codec ID                                 : 20
Duration                                 : 2mn 15s
Bit rate mode                            : Constant
Bit rate                                 : 281 Kbps
Width                                    : 720 pixels
Height                                   : 405 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 29.970 (30000/1001) fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.032
Stream size                              : 4.52 MiB (67%)
Writing library                          : Lavc58.54.100
Encoded date                             : UTC 1904-01-01 00:00:00
Tagged date                              : UTC 1904-01-01 00:00:00

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 2mn 15s
Duration_LastFrame                       : -19ms
Bit rate mode                            : Constant
Bit rate                                 : 129 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Frame rate                               : 46.875 fps (1024 spf)
Compression mode                         : Lossy
Stream size                              : 2.07 MiB (31%)
Default                                  : Yes
Alternate group                          : 1
Encoded date                             : UTC 1904-01-01 00:00:00
Tagged date                              : UTC 1904-01-01 00:00:00

你能告诉我视频文件有什么问题吗?

最好的问候!

【问题讨论】:

    标签: video twitter ffmpeg


    【解决方案1】:

    Twitter 不接受 MPEG-4 Part 2 视频。这是一种旧的视频格式。重新编码为 H.264:

    ffmpeg -i input.mp4 -c:v libx264 -crf 20 -preset slow -vf format=yuv420p -c:a aac -movflags +faststart output.mp4
    
    • 如果您收到not divisible by 2 错误,请参阅this answer
    • 如果您的输入包含 AAC 音频,您可以 stream copy 而不是通过将 -c:a aac 更改为 -c:a copy 来重新编码以保持音频质量。
    option explanation
    -c:v libx264 Chooses video encoder libx264
    -crf 20 x264 quality level
    -preset slow x264 encoding speed vs compression efficiency preset
    -vf format=yuv420p Ensures YUV 4:2:0 chroma subsampling for compatibility
    -c:a aac Chooses audio encoder aac
    -movflags +faststart Enables fast start: may allow Twitter to begin processing faster

    【讨论】:

    • 感谢您的回答!尽管它没有解决我的问题,但它引导我找到了解决方案。我从源代码安装了 ffmpeg,但我没有使用 ffmpeg 正确转换/操作媒体文件所需的所有标志来编译它。我按照官方的ffmpeg安装指南(trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu),现在问题解决了!感谢您对我的帮助!
    【解决方案2】:

    我很难将 Facebook 上的视频发布到 Twitter 上。对我来说,这个工作:

    ffmpeg -i video.mov -r 30 -c:v libx264 -b:v 1M -vf scale=640:-1 video.mp4
    

    找到here

    【讨论】:

      【解决方案3】:

      最大的问题可能是奇数高度。他们会将其转换为 H264,并且必须是均匀的。

      该文件不是首选格式,H264 High Profile,这可能是另一个问题。

      【讨论】:

        【解决方案4】:

        我遇到了这个上传问题,但原因不同。就我而言,这是因为 CTTS 无效,即使文件在本地播放良好。您可以使用ffprobe media_file.mp4检查文件中的错误

        【讨论】:

          【解决方案5】:

          就我而言,我错过了这个选项:-pix_fmt yuv420p

          https://twittercommunity.com/t/ffmpeg-mp4-upload-to-twitter-unsupported-error/68602 有更多想法,我认为如果您检查 JSON 响应,您可能会看到更具体的错误。

          【讨论】:

            猜你喜欢
            • 2021-07-18
            • 2016-10-30
            • 2016-06-09
            • 2011-12-22
            • 1970-01-01
            • 2023-04-01
            • 2013-04-22
            • 2020-04-09
            • 1970-01-01
            相关资源
            最近更新 更多