[Tutor] Can one use python to concatenate n media files?

Alan Gauld alan.gauld at btinternet.com
Mon Oct 12 14:12:39 EDT 2015


On 12/10/15 05:15, Fast Primes wrote:
>
> If so, could someone present an example?

Yes, and Emile has shown how for a trivial, pure
binary case.

But to make the catenation sensible you need to know
the file type. Many media files hold the actual media
data inside an envelope of header information. To do
a sensible job you need to know where the data starts
and how you want to process the meta data in the headers.

It's all possible and helper modules exist for many types
of file/metadata. But without knowing the types of
media you are trying to catenate its effectively
impossible to give working examples.

And if you want to catenate different types of media
file (eg a .WMA, an .MP3 and a .AU) then you also need
to do data conversions etc. Its all possible but
its mostly non trivial.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list