Is there a way to split a video into segments of specified length? Ie 60 minute video into 12×5 mins.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Afaik, you will need to develop your own “segmenter”. This is similar to what you need to create HTTP Live streaming files. There might be a simpler solution, but here is what I would do:
You can make a relative small program (in python) using multifilesink next-file=buffer (or next-file marker, if segments can’t fit in memory).
You’ll need to encode or demux your input stream, and mux the stream back. Cut the muxed stream on key-frame when the desired duration is reached, and push the aggregated buffer (or mark a fake key frame, for example, to force sink to create a new file). Reinitialize the muxer (or append muxer streamheader) to get file with correct header than can be played seperately (depending on the muxer).