My goal is to split a XDCAM or a H264 video, frame-accurately, with ffmpeg. I guess that the problem comes from its long GOP structure, but I'm looking for a way to split the video without re-encoding it. I apply an offset to encode only a specific section of the video (let say from the 10th second to the end of the media) Any ideas ?
相关问题
- JQ: Select when attribute value exists in a bash a
- bash print whole line after splitting line with if
- “command not found” errors in expect script execut
- grep using grep results
- UNIX Bash - Removing double quotes from specific s
相关文章
- Check if directory exists on remote machine with s
- Handling ffmpeg library interface change when upgr
- How to use a framework build of Python with Anacon
- Reverse four length of letters with sed in unix
- Launch interactive SSH bash session from PHP
- BASH: Basic if then and variable assignment
- Bash script that creates a directory structure
- Test if File/Dir exists over SSH/Sudo in Python/Ba
I`m not sure if it possible to do by 1 pass with ffmpeg, but 2-3
1st pass: you just dump raw frames to file 2nd pass: you find closed gop(mxdcam)/idr frame (h264) with index <= index of frame you want to start
in case indexes equal you can start mux. otherwise you need to decode sequense from closed gop/idr frame to next closed gop/idr frame and encode starting frame you want
Please refer to the ffmpeg documentation. You will find an option
-frames
. That option can be use to specify for a given input stream (in the following the stream 0:0 is the 1st input file, first video stream) the number of frame to record. That option can be combined with other options to start somewhere in the input file (time offset, etc ....)that command demux and remux only the first 100 frame of the video (no re-encoding).
as said you can combine it with a jump. Using ' ‘-ss offset (input)’ ' you can specify a "Frame Accurate" position ie. frame 14 after 1min10seconds = 0:1:10:14. that option should be use before the input like below.
ffmpeg discard the first 10 second and bypass 100 frame to the muxer.