Combining music or video files?

J

John Salerno

Before I try this and destroy my computer :) I just wanted to see if
this would even work at all. Is it possible to read a binary file such
as an mp3 or an avi, put its contents into a new file, then read another
such file and append its contents to this same new file as well, thereby
making, for example, a single long video instead of two smaller ones?

Thanks.
 
J

Jason Scheirer

Before I try this and destroy my computer :) I just wanted to see if
this would even work at all. Is it possible to read a binary file such
as an mp3 or an avi, put its contents into a new file, then read another
such file and append its contents to this same new file as well, thereby
making, for example, a single long video instead of two smaller ones?

Thanks.

This works with basic mpeg videos, but pretty much nothing else.
You're going to need some video editing software.
 
D

Dan Upton

This works with basic mpeg videos, but pretty much nothing else.
You're going to need some video editing software.

I actually don't know what would happen if you concatenated even MP3s
with the ID3 tags that are stored at the end... I know with some DivX
files at least you could approximate this by running a separate
program on them that would recreate whatever index it needed. (At
least, you could recreate the index for files that cut off early, I
guess it could figure out what to do if it found a second index
halfway through the file.)
 
P

Python.Arno

This works with basic mpeg videos, but pretty much nothing else.
You're going to need some video editing software.

you can't just edit mpeg (including mp3)...
mpeg is a stream. it sets a "key" frame for the first frame
followed by motion vectors from the changes from that frame
until the next keyframe.
If you cut in the middle of the vectors the keyframe is lost
and the vector frames don;t make any sense anymore.

avi is not a video codec, it's a container like quicktime.
so it depends...

I come from a Mac background and use quicktime a lot.
there are some basic editing features that quicktime can do.
And Apple has a nice quicktime python module in OSX.
I bet there's something for windows too...

best thing to do is convert the video o a framesequence and
the audio to an uncompressed format like wav or aiff
then combine in quicktime or <something in windows>

cheers,
Arno
 
P

Paul Boddie

Before I try this and destroy my computer :) I just wanted to see if
this would even work at all. Is it possible to read a binary file such
as an mp3 or an avi, put its contents into a new file, then read another
such file and append its contents to this same new file as well, thereby
making, for example, a single long video instead of two smaller ones?

Probably not, as people have pointed out, but I imagine you could use
GStreamer and a few processing pipelines, as I pointed out in a
comment on the following article (for another task):

http://jessenoller.com/2008/05/06/lazyweb-question-python-video-manipulation-libraries/

This is probably as close as you can get to treating the files as if
they were simple things which can be concatenated.

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top