gpt4 book ai didi

ffmpeg - 无法写入时间戳未知的数据包 av_interleaved_write_frame() : Invalid argument

转载 作者:行者123 更新时间:2023-12-04 22:45:07 25 4
gpt4 key购买 nike

我正在尝试将带有此输出的 .ts 文件转换为 mkv:

ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with Apple clang version 12.0.0 (clang-1200.0.32.27)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1_4 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
[mp3float @ 0x7fbd6282b200] Header missing
[mpegts @ 0x7fbd62809000] PES packet size mismatch
[mpegts @ 0x7fbd62809000] Packet corrupt (stream = 2, dts = 7125804577).
[mpegts @ 0x7fbd62809000] PES packet size mismatch
[mpegts @ 0x7fbd62809000] Packet corrupt (stream = 2, dts = 7125804577).
[mpegts @ 0x7fbd62809000] PES packet size mismatch
[mpegts @ 0x7fbd62809000] Packet corrupt (stream = 1, dts = 7125790091).
Input #0, mpegts, from '/Users/"User"/Downloads/input.ts':
Duration: 02:11:32.82, start: 71283.837456, bitrate: 17149 kb/s
Program 1
Stream #0:0[0x1004]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuvj420p(pc, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 2.08 tbr, 90k tbn, 100 tbc
Stream #0:1[0x1104](swe): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 256 kb/s
Stream #0:2[0x704](swe): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, 5.1(side), fltp, 640 kb/s
为此,我使用以下命令:
ffmpeg -i input.ts -c copy output.mkv
但是转换失败并出现以下错误:
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:2 -> #0:1 (copy)
Press [q] to stop, [?] for help
[matroska @ 0x7fb8c1808200] 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 @ 0x7fb8c1808200] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument
[matroska @ 0x7fb8c1808200] Can't write packet with unknown timestamp
Error writing trailer of output.mkv: Invalid argument
frame= 27 fps=0.0 q=-1.0 Lsize= 74kB time=00:00:00.85 bitrate= 705.5kbits/s speed= 99x
video:1092kB audio:35kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!
我应该怎么做才能解决这个问题?我已经尝试在开始时添加 -fflags +genpts 但它还是失败了。
编辑:我确实通过使用 MKVToolNix 来解决它。

最佳答案

对于其他遇到此问题的人,我有一个类似的问题,通过添加 -fflags +genpts 解决了在输入之前并让它为我生成缺少的时间戳。

ffmpeg -fflags +genpts -i input.ts -c copy output.mkv

关于ffmpeg - 无法写入时间戳未知的数据包 av_interleaved_write_frame() : Invalid argument,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66013483/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com