Hey Guys -

I need to split an mpeg2 file by frame number.

I haven't found anything that will satisfactorily do this for me from the
command line, so I'm just going to write something myself.

My plan is to read through the packets in the stream and decode them one by
one, adding the packet or frame data to a buffer array in order that they
were decoded. If a keyframe is found, I'd like to append the buffer to a
file on disk (obviously, making a new one if it doesn't exist yet), clear
it, and fill another group of frames, continuing until I have the correctly
sized split.

Since I want the new file to be playable, how should I do the copying?

Should I copy the packet or frame data to the buffer? And, when I write the
buffer to disk, do I need to use anything "special" instead of the normal C
I/O functions?

Thanks for any guidance anyone can give me,

Sam Gardner
-- 
View this message in context: 
http://www.nabble.com/Copying-packets-or-frames-tp23549172p23549172.html
Sent from the libav-users mailing list archive at Nabble.com.

_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to