How to Split a Video in h264 Format

Asked 2 years ago, Updated 2 years ago, 86 views

I'd like to know how to split the video.

Previously, ffmpeg was used to win AVI-style video files.
With this in mind, I would like to use ffmpeg to divide the h264 format video.

ffmpeg-ss 00:00:00-itest.h264-to 00:00:10-c:vayuv thumbnail-000.h264

I tried various options such as -f, -c:vayuv, etc., but only empty videos are output.
(Output file is empty, nothing was encoded)

I'm looking for a site that might be helpful, but I sometimes find common items such as avi, but it seems difficult with h264.

So, I have a question,
1. Is it possible to split the h264 format video using ffmpeg?
2. If possible, what commands should I fill in?

Incidentally, the h264 video does not contain sound.

ubuntu ffmpeg

2022-09-30 16:22

1 Answers

(According to the question comment, it has been solved by itself, but until the information is provided)

Yes, it's possible.FFmpeg's basic data processing takes the flow of decoding (decoding; decompressing) input videos and then encoding (encoding; compression) in a specified format."Regardless of the input/output file format, we handle video and audio data internally (to some extent).

The commands in the self-resolving comment decode the read input file into H.264 video, extract the 45 second length from the content location 00:03:05 and then export the H.264 video encoding to the output file.

ffmpeg-i "test.h264" -ss 00:03:05 -t 00:00:45.0 "video.h264"

Video codecs are re-encoded, which can significantly change image quality and file size (bit rate).

Note that the command-line option specification order is also meaningful in FFmpeg.For example, writing the -ss option before or after the input file specification -i changes the behavior slightly.(
ffmpeg Documentation, 5.4 Main optionsSee also


2022-09-30 16:22

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.