How to cut video and audio without re-encoding using ffmpeg

ffmpeg -i source_video.mp4 -t 50 -c copy output_video.mp4

This cuts the first 50 seconds of the video named source_video.mp4 and outputs them without any re-encoding to output_video.mp4

Another example for audio files:

ffmpeg -i input_file.mp3 -ss 00:00:05 -t 00:00:21 -c copy output_file.mp3

This cuts the audio file from the 5th second to the 21st second and places it in a file named output_file.mp3, no re-encoding done whatsoever.

Source: https://ubuntuforums.org/showthread.php?t=2027333

 

About SoCRaT

Systems Engineer, OSS & Linux Geek
This entry was posted in Linux and tagged , , , . Bookmark the permalink.

1 Response to How to cut video and audio without re-encoding using ffmpeg

  1. Thank you. Also good to know: If you want to cut to miliseconds, the format becomes 00:00:21.213

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s