[FFmpeg-user] cutting mp4 with ffmpeg

Def Etienne shaker.doc at gmail.com
Sat Jan 13 19:57:07 EET 2024


Sent from my iPhone

> On 13 Jan 2024, at 15:44, Andrew Randrianasulu <randrianasulu at gmail.com> wrote:
> 
> I compiled new ffmpeg I tried to cut mp4
> 
> -to parameter was coming from mpv:
> 
> bash-5.1$ mpv ~/6029.mp4
> (+) Video --vid=1 (*) (h264 720x400 25.000fps)
> (+) Audio --aid=1 (*) (aac 2ch 48000Hz)
> AO: [alsa] 48000Hz stereo 2ch float
> VO: [gpu] 720x400 yuv420p
> (Paused) AV: 00:01:04.600 / 01:28:31.600 (1%) A-V:  0.000
> 
> 1 min + 4 seconds +0.600 milliseconds = 64.600 ?
> 
> bash-5.1$ /dev/shm/ffmpeg/ffmpeg -i ~/6029.mp4  -copyts -c:v copy -c:a
> copy -ss 0.0 -to 64.600 /dev/shm/6029_cut.mp4

I think the command intends a logic in its use. 

If you intend to cut out the first 64.6 seconds then you do not need to use  the “-ss” parameter. 

Using -t 64.6  before the output file would have been good enough. 

If you had needed to start from another time which is not the 0th second then an -ss parameter is needed which _must come_ before the input file on the command line and the “-to” mist have followed the -ss command before the input file. 

Try  

ffmpeg -i ~/6029.mp4  -copyts  c:v copy -c:acopy -t 64.600 dev/shm/6029_cut.mp4

Def



More information about the ffmpeg-user mailing list