use python to split a video file into a set of parts

Dave Angel davea at davea.name
Tue May 7 08:10:08 EDT 2013


On 05/07/2013 07:15 AM, iMath wrote:
> I use the following python code to split a FLV video file into a set of parts ,when finished ,only the first part video can be played ,the other parts are corrupted.I wonder why and Is there some correct ways to split video files
>

There are two parts to answering the question.  First, did it accurately 
chunk the file into separate pieces.  That should be trivial to test -- 
simply concatenate them back together (eg. using copy /b) and make sure 
you get exactly the original.  (using md5sum, for example) I think you will.

And second, why the arbitrary pieces don't play in some unspecified 
video player.  That one's more interesting, but hasn't anything to do 
with Python.  I'm curious why you would expect that it would play.  It 
won't have any of the header information, and the compressed data will 
be missing its context information.  To split apart a binary file into 
useful pieces requires a lot of knowledge about the file format.



-- 
DaveA



More information about the Python-list mailing list