Ale*_*eda 6 video ffmpeg video-processing
My simplified ffmpeg command (the longer one has over 300 files) is the following.
ffmpeg -i "v1.mp4" -i "v2.mp4" -i "v3.mp4"
-filter_complex "[0:v:0][1:v:0][2:v:0]concat=n=3:v=1:a=0,fps=fps=30[cv1];
[0:a:0][1:a:0][2:a:0]concat=n=3:v=0:a=1,asetpts=N/SR/TB[ca1];
[cv1]setpts=0.25*PTS[v4];
[ca1]atempo=4,asetpts=N/SR/TB[a4]"
-c:v h264_nvenc -map "[v4]" -map "[a4]" x4_output_0.mp4
Run Code Online (Sandbox Code Playgroud)
The video encoding is working but then breaks and the output file seems to be truncated. The output files are nearly of the size as they should be but they can't be read.
Video encoding failed\r\n
[aac @ 00000248a7856840] Qavg: 325.600\r\n
[aac @ 00000248a7856840] 2 frames left in the queue on closing\r\n
[aac @ 00000248a78595c0] Qavg: 236.279\r\n[aac @ 00000248a78595c0]
2 frames left in the queue on closing\r\n
[aac @ 00000248a7855140] Qavg: 2729.299\r\n
[aac @ 00000248a7855140] 2 frames left in the queue on closing\r\n
[aac @ 00000248a785bec0] Qavg: 1158.664\r\n
[aac @ 00000248a785bec0] 2 frames left in the queue on closing\r\n
Conversion failed!\r\n")
Run Code Online (Sandbox Code Playgroud)
aac @ ...? Qavg mean in the error message?codec_time_base and the time_base (see the differences in the video attributes frequencies below)?Below are the frequencies of the video attributes for all videos that have more than 1 distinct value. It's of the form [(value, frequency), (value, frequency),...].
codec_time_base --- [('1/60', 384), ('1001/60000', 7), ('50/2997', 1)]
has_b_frames --- [(0, 336), (2, 56)]
level --- [(31, 336), (30, 56)]
r_frame_rate --- [('30/1', 384), ('30000/1001', 7), ('2997/100', 1)]
avg_frame_rate --- [('30/1', 384), ('30000/1001', 7), ('2997/100', 1)]
time_base --- [('1/30', 383), ('1/30000', 7), ('1/2997', 1), ('1/15360', 1)]
Run Code Online (Sandbox Code Playgroud)
The same for the audio attributes in all those video files.
codec_time_base --- [('1/48000', 386), ('1/44100', 6)]
sample_rate --- [('48000', 386), ('44100', 6)]
time_base --- [('1/48000', 386), ('1/44100', 6)]
Run Code Online (Sandbox Code Playgroud)
小智 11
我的视频在 0:08 开始,无法再往前查找,尽管 0:08 是我大致想要的开始时间。
修复我的错误的是添加参数:
-max_muxing_queue_size 9999
Run Code Online (Sandbox Code Playgroud)
这也解决了我的错误Too many packets buffered for output stream 0:1.
这似乎是初始音频和视频不同步造成的帧速率问题(奇怪的帧速率或时间奇怪),调整该-r值也可以修复它。
我得到答案的线程有更多的技术细节,解释了为什么会发生这种情况,以及这个 3 年多的错误报告的替代解决方案https://trac.ffmpeg.org/ticket/6375
祝你好运!
| 归档时间: |
|
| 查看次数: |
3988 次 |
| 最近记录: |