Q: How to split MPEGTS(H264) video stream into file chunks?
问:如何将MPEGTS(H264)视频流分割成文件块?
Searching the way of splitting MPEGTS video stream encoded to H264 into accurate file chunks. The challenge is that the stream need to be saved 24/7 and no data should be lost.
搜索将编码为H264的MPEGTS视频流拆分为精确文件块的方式。挑战在于需要每周7天,每天24小时保存流,不会丢失任何数据。
Thinking about split(1), but there is a problem with video frames. If video frame will be cut in the middle, than video data will be lost.
考虑分裂(1),但视频帧存在问题。如果视频帧将在中间被剪切,则视频数据将丢失。
Another problem is the keyframes...
另一个问题是关键帧......
For now I am thinking about some fork of split(1) which is react on marker (the beginning of keyframe) and cut after only that.
现在我正在思考一些分裂(1)的分叉,它对标记(关键帧的开头)作出反应并且仅在那之后进行切割。
2 个解决方案
#1
#2
Its actually can be done with segmenter easily http://svn.assembla.com/svn/legend/segmenter/segmenter.c
它实际上可以通过分段器轻松完成http://svn.assembla.com/svn/legend/segmenter/segmenter.c
#1
From here:
Mencoder makes it easy to trim the end or the beginning of a file, or split it in several parts.
Mencoder可以轻松修剪文件的结尾或开头,或将其拆分为多个部分。
Mencoder can be found here.
Mencoder可以在这里找到。
#2
Its actually can be done with segmenter easily http://svn.assembla.com/svn/legend/segmenter/segmenter.c
它实际上可以通过分段器轻松完成http://svn.assembla.com/svn/legend/segmenter/segmenter.c