I am trying to trim multiparts from single video using ffmpeg 4.3
here is the command i used
`ffmpeg -i input.mp4 -filter_complex \
"[0:v]trim=start=4:end=22,setpts=PTS-STARTPTS[v0]; \
[0:a]atrim=start=4:end=22,asetpts=PTS-STARTPTS[a0]; \
[0:v]trim=start=26:end=100,setpts=PTS-STARTPTS[v1]; \
[0:a]atrim=start=26:end=100,asetpts=PTS-STARTPTS[a1]; \
[v0][a0][v1][a1]concat=n=2:v=1:a=1[v][a]" \
-map "[v]" -map "[a]" output.mp4`
Getting this error in FFMPEG 4.3 latest
[mpeg4 @ 0x2b14e80] Invalid pixel aspect ratio 3875/3864, limit is 255/255 reducing
please help if anyone have solution for ffmpeg 4.3
here is the log for the above command , please check
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-23)
configuration: --enable-openssl
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
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isom
Duration: 00:09:00.67, start: 0.000000, bitrate: 218 kb/s
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 322x400 [SAR 3875:3864 DAR 155:192], 168 kb/s, 24 fps, 24 tbr, 90k tbn, 48 tbc (default)
Stream #0:1(und): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 47 kb/s (default)
File 'output.mp4' already exists. Overwrite? [y/N] y
Stream mapping:
Stream #0:0 (h264) -> trim
Stream #0:0 (h264) -> trim
Stream #0:1 (aac) -> atrim
Stream #0:1 (aac) -> atrim
concat:out:v0 -> Stream #0:0 (mpeg4)
concat:out:a0 -> Stream #0:1 (aac)
Press [q] to stop, [?] for help
[mpeg4 @ 0x25c4880] Invalid pixel aspect ratio 3875/3864, limit is 255/255 reducing
Output #0, mp4, to 'output.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isom
encoder : Lavf58.45.100
Stream #0:0: Video: mpeg4 (mp4v / 0x7634706D), yuv420p, 322x400 [SAR 255:254 DAR 8211:10160], q=2-31, 200 kb/s, SAR 3875:3864 DAR 155:192, 24 fps, 12288 tbn, 24 tbc (default)
Metadata:
encoder : Lavc58.91.100 mpeg4
Side data:
cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
encoder : Lavc58.91.100 aac
frame= 2208 fps=566 q=16.1 Lsize= 3970kB time=00:01:32.01 bitrate= 353.5kbits/s speed=23.6x
video:2480kB audio:1442kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.204748%
[aac @ 0x25d9180] Qavg: 215.673
Your ffmpeg
was not compiled to include support for any H.264 encoders, so it is forced use the encoder named mpeg4 which outputs the old format MPEG-4 Part 2 video. This is a legacy format which was common before H.264.
Your device/player/app/browser probably doesn't support MPEG-4 Part 2 video.
Output H.264 instead.
Download an already compiled ffmpeg
that has what you need. Put it in your PATH
(see FAQ), or provide the full path to the new ffmpeg
in your script.
Or re-compile ffmpeg
with --enable-gpl --enable-libx264
. See FFmpeg Wiki: Compile & Install FFmpeg on CentOS/RHEL/Red Hat.