1. When I split videos by file size, I only got one file.
2. When I split videos by keyframes, the videos are longer than they're supposed to be.
How do I fix these problems?
Code:ffmpeg -i input.mp4 -fs 200M -c copy output_segment_%03d.mp4Code:ffmpeg -i input.mp4 -f segment -segment_time 0 -c copy output%03d.mp4
+ Reply to Thread
Results 1 to 17 of 17
-
Last edited by TitleScreenOP; 11th May 2024 at 22:23.
-
When I split videos by file size, I only got one file.Code:
-fs 200M
-fs limit_size (output)
Set the file size limit, expressed in bytes. No further chunk of bytes is written after the limit is exceeded. The size of the output file is slightly more than the requested file size.
Code:-segment_time 0
segment_time time
Set segment duration to time, the value must be a duration specification. Default value is "2". See also the segment_times option.
Note that splitting may not be accurate, unless you force the reference stream key-frames at the given time. See the introductory notice and the examples below.
Did you read https://ffmpeg.org/ffmpeg-formats.html#segment_002c-stream_005fsegment_002c-ssegment ?
Also notice that splitting will only occur on key/idr frames (if no reencoding is done), thus independent of how you split, it's likely to be inaccurate.
Additionally, if your content uses open-gop, you might not be able to split it at all.
If you want to split an mp4 into 200MB chunks, using MP4Box might be better suited:
Code:mp4box -split-size 200000 input.mp4
Cu SelurLast edited by Selur; 12th May 2024 at 05:26.
users currently on my ignore list: deadrats, Stears555, marcorocchini -
Will splitting videos by using MP4Box be lossless? As well as remuxing mkv files to mp4? What if I used -crf 0 for splitting H.265 videos to H.264? How do I make it not cut at keyframes?
-
Will splitting videos by using MP4Box be lossless?
As well as remuxing mkv files to mp4?
If you want to cut mkv files you could use mkvtoolnix gui. (cut will be lossless and only on key frames)
What if I used -crf 0 for splitting H.265 videos to H.264?
How do I make it not cut at keyframes?
Cu Selurusers currently on my ignore list: deadrats, Stears555, marcorocchini -
No clue about PotPlayer,...
How did you split them? (hopefully not using '-f segment' since that is not really meant for all containers,....
stream_segment is a variant of the muxer used to write to streaming output formats, i.e. which do not require global headers, and is recommended for outputting e.g. to MPEG transport stream segments. ssegment is a shorter alias for stream_segment.users currently on my ignore list: deadrats, Stears555, marcorocchini -
-
mp4/mov -> mp4box
mkv -> mkvtoolnix (mkvmerge if you use the command line)
Cu Selur
Ps.: with some scripting setting start&end points it might also be possible using ffmpeg (there might be a script for it somewhere in the forum)Last edited by Selur; 12th May 2024 at 08:51.
users currently on my ignore list: deadrats, Stears555, marcorocchini -
-
-
users currently on my ignore list: deadrats, Stears555, marcorocchini
-
Last edited by TitleScreenOP; 12th May 2024 at 09:55.
-
And splitting them with re-encoding using ffmpeg?ffmpeg has no option for 'smart encoding', thus without re-encoding it can only cut on key-frames.You seek to the position you want to start and then set the number of frames (or length of the clip) you want to output. (read the Seeking page,...)users currently on my ignore list: deadrats, Stears555, marcorocchini
-
Similar Threads
-
Losslessly Compress GIFs
By Sound Master in forum Newbie / General discussionsReplies: 28Last Post: 1st Apr 2024, 00:32 -
Losslessly Extract Keyframes
By Jay123210599 in forum Newbie / General discussionsReplies: 28Last Post: 9th Nov 2023, 22:14 -
Tool to split and join AC-3 losslessly?
By orlydb in forum AudioReplies: 5Last Post: 16th May 2020, 07:31 -
Losslessly Convert 2.0 to 5.1
By koberulz in forum Newbie / General discussionsReplies: 3Last Post: 5th Sep 2019, 11:05