Question

I am uploading a video using a form and want to parse the video info from a uploaded temporary file. The temporary file contains some form information at the start of the file and the remain is video bytes. Can ffmpeg parse the file from the position where the video bytes start?How? Many thanks!

Was it helpful?

Solution

If you're just looking to script together pieces probably the easiest approach is to use the dd(1) tool to extract only the data you're interested in. It would look something like this:

dd if=/path/to/temp/file ibs=<size to skip> skip=1 | ffmpeg --whatever

It won't be perfect, since it'll use that block size for all input operations; something larger and a multiple of a power of two would be ideal compared to however much space you're wasting at the beginning, but it ought to be better enough than creating a new file with nearly identical contents.

OTHER TIPS

Try the -skip_initial_bytes <bytecount> parameter.

http://trac.ffmpeg.org/ticket/1909

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top