Concat视频太长了ffmpeg

时间:2019-03-16 22:06:00

标签: ffmpeg

我与此人After merge videos, the duration is too long - ffmpeg有类似的问题,但我不知道如何制作相同格式的视频 1个视频:

>     Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'outputhigh.mp4':   Metadata:
>     major_brand     : isom
>     minor_version   : 512
>     compatible_brands: isomiso2avc1mp41
>     encoder         : Lavf58.10.100   Duration: 00:03:14.96, start: 0.000000, bitrate: 110 kb/s
>     Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), y uvj444p(pc), 816x456 [SAR 1:1 DAR 34:19], 108 kb/s, 25
> fps, 25 tbr, 12800 tbn, 5 0 tbc (default)
>     Metadata:
>       handler_name    : VideoHandler

2个视频:

>  Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'fireplace.mp4':   Metadata:
>     major_brand     : mp42
>     minor_version   : 0
>     compatible_brands: isommp42
>     creation_time   : 2018-12-11T15:34:07.000000Z   Duration: 00:17:45.00, start: 0.000000, bitrate: 1632 kb/s
>     Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709) , 1280x720 [SAR 1:1 DAR 16:9], 1499 kb/s, 29.97
> fps, 29.97 tbr, 30k tbn, 59.94 t bc (default)
>     Metadata:
>       creation_time   : 2018-12-11T15:34:07.000000Z
>       handler_name    : ISO Media file produced by Google Inc. Created on: 12/11 /2018.
>     Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, flt p, 128 kb/s (default)
>     Metadata:
>       creation_time   : 2018-12-11T15:34:07.000000Z
>       handler_name    : ISO Media file produced by Google Inc. Created on: 12/11 /2018.

1 个答案:

答案 0 :(得分:0)

所有段必须具有相同的参数。使outputhigh.mp4参数符合fireplace.mp4

ffmpeg -i outputhigh.mp4 -f lavfi -i anullsrc=sample_rate=44100:channel_layout=stereo -filter_complex "[0:v]scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1,format=yuv420p,fps=30000/1001[v]" -map "[v]" -map 1:a -c:v libx264 -profile:v main -c:a aac -video_track_timescale 30k -shortest outputhigh2.mp4

制作inputs.txt

file "outputhigh2.mp4"
file "fireplace.mp4"

然后串联:

ffmpeg -f concat -i input.txt -c copy output.mp4