Concat video too long ffmpeg

2019-09-20 14:12发布

I have similar problem to this guy After merge videos, the duration is too long - ffmpeg but I have no idea how to make videos same format 1 video:

>     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 video:

>  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.

标签: ffmpeg
1条回答
神经病院院长
2楼-- · 2019-09-20 15:01

All segments must have the same parameters. To conform outputhigh.mp4 parameters to 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

Make inputs.txt:

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

Then concatenate:

ffmpeg -f concat -i input.txt -c copy output.mp4
查看更多
登录 后发表回答