簡體   English   中英

使用 FFMPEG 連接視頻:Glitchy\\Desync 輸出

[英]Concatenate Videos using FFMPEG : Glitchy\Desync output

我有一個包含多個視頻剪輯的文件夾(包括 Outro,它是一個 mp4 視頻)。 我正在運行此代碼來連接視頻:

os.system("(for %i in (*.mp4) do @echo file '%i') > mylist.txt")
os.system('more +1 "mylist.txt" > "Final_List.txt"')
os.system("echo file 'Outro.mp4' >> Final_List.txt") #Final_list.txt will contain all the videos' paths, and will have the outro's path on its last line.
os.system("ffmpeg -f concat -i Final_List.txt -c copy output.mp4")

執行后,我得到一個名為 output.mp4 的視頻,其中包含我連接的所有剪輯,但 outro 非常有問題:原始 outro.mp4 視頻持續 9 秒,但在最終視頻中,它只持續 2 秒,聲音是加速了很多。

https://gofile.io/d/zqadc2 #你會在這里找到outro.mp4文件,以及一些正確連接的剪輯

https://gofile.io/d/G9Zbjo #你會在這里找到 output.mp4 視頻

輸入文件信息:

ffmpeg -i Ready_clip7.mp4 -i Ready_clip15.mp4 -i Outro.mp4
...
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Ready_clip7.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.51.101
  Duration: 00:00:06.40, start: 0.000000, bitrate: 1476 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1339 kb/s, SAR 24251:24253 DAR 388016:218277, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'Ready_clip15.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.51.101
  Duration: 00:00:18.11, start: 0.000000, bitrate: 1125 kb/s
    Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 2043:2048 DAR 227:128], 1009 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 108 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from 'Outro.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.51.101
  Duration: 00:00:32.02, start: 0.000000, bitrate: 188 kb/s
    Stream #2:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 52 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #2:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 129 kb/s (default)
    Metadata:
      handler_name    : SoundHandler

為了獲得最佳結果,所有輸入必須具有相同的屬性。

您的寬度、高度、幀速率和音頻采樣率各不相同。

符合Outro.mp4使其與其他文件匹配:

ffmpeg -i Outro.mp4 -vf "scale=1280:720,fps=30" -ar 48000 Outro2.mp4

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM