Is there a Byte Offset in FFmpeg for source Files?

1.8k views Asked by At

I am working on an C++ Application (running on Ubuntu) that opens FFmpeg for video conversion and reads the output through popen(). This works fine but now i need FFmpeg to start reading the source File at a specific Byte Offset. Is there any way to archive this? I already searched for a solution / command line parameter but couldn't find anything usefull. So is there any solution for this?

By the way: I already know there is a parameter for time offset but i need a byte offset.

2

There are 2 answers

1
πάντα ῥεῖ On BEST ANSWER

If you're working on you might pipe your ffmpeg input file through dd and skip to a specific offset. Something like:

> dd if=myfile.mp2 skip=<myoffset-in-block-size> ibs=<block-size> | ffmpeg -i pipe:0 ...

or prepare another input file for ffmpeg without piping.


If you're working under , you can use MSys 1.0, that also supports dd.

1
Non-maskable Interrupt On

I don't think FFmpeg support such special purpose feature.

However, it's easy to build your custom version of FFmpeg with a trivial avio input filter to skip bytes.

If you absolutely don't want to mess with FFmpeg, call FFmpeg to encode from pipe (stdin) and feed it with your file reader - but then you are limited to single input stream.