无需重新编码即可将 AVI 转换为 MKV

无需重新编码即可将 AVI 转换为 MKV
Complete name                            : Killing.Time.S01E01.HUN.WEB-DL.XviD-DART.avi
Format                                   : AVI
Format/Info                              : Audio Video Interleave
File size                                : 359 MiB
Duration                                 : 44 min 25 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 1 129 kb/s
Writing application                      : Lavf56.3.100

Video
ID                                       : 0
Format                                   : MPEG-4 Visual
Format profile                           : Advanced Simple@L5
Format settings                          : BVOP2
Format settings, BVOP                    : 2
Format settings, QPel                    : No
Format settings, GMC                     : No warppoints
Format settings, Matrix                  : Default (H.263)
Muxing mode                              : Packed bitstream
Codec ID                                 : XVID
Codec ID/Hint                            : XviD
Duration                                 : 44 min 25 s
Bit rate                                 : 989 kb/s
Width                                    : 624 pixels
Height                                   : 352 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 25.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.180
Stream size                              : 314 MiB (88%)
Writing library                          : XviD 1.2.1 (UTC 2008-12-04)

Audio
ID                                       : 1
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 3
Format settings                          : Joint stereo / MS Stereo
Codec ID                                 : 55
Codec ID/Hint                            : MP3
Duration                                 : 44 min 25 s
Bit rate mode                            : Variable
Bit rate                                 : 128 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Compression mode                         : Lossy
Stream size                              : 40.6 MiB (11%)
Alignment                                : Aligned on interleaves
Interleave, duration                     : 24  ms (0.60 video frame)
Interleave, preload duration             : 6  ms
Writing library                          : LAME3.99.5

我想将此 AVI 文件的容器更改为 MKV,无需编码。

ffmpeg -i Killing.Time.S01E01.HUN.WEB-DL.XviD-DART.avi -c:v copy -c:a copy Killing.Time.S01E01.HUN.WEB-DL.XviD-DART.mkv

尝试了这个命令,但是它不起作用。:(

Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[matroska @ 0x558ae70e69c0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[matroska @ 0x558ae70e69c0] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument
frame=    1 fps=0.0 q=-1.0 Lsize=       1kB time=00:00:00.00 bitrate=7600.0kbits/s speed=9.09x    
video:2kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!

答案1

AVI 没有可供转换的内部时间戳,使用 -fflags +genpts 让 ffmpeg 创建它们。

ffmpeg -fflags +genpts -i input.avi -c:v copy -c:a copy output.mkv

相关内容