ffmpeg-python icon indicating copy to clipboard operation
ffmpeg-python copied to clipboard

How to use dump_attachment with ffmpeg-python?

Open cansik opened this issue 1 year ago • 2 comments

I would like to extract the following "stream" and I found out that attachments can be dumped to a file using the dump_attachment argument.

Stream #0:3: Attachment: none
    Metadata:
      filename        : calibration.json
      mimetype        : application/octet-stream
      K4A_CALIBRATION_FILE: calibration.json

The command itself would look like this, which seems not possible to construct in ffmpeg-python, because the -dump_attachment:t:0 "" has to be before the input. And also colons (:) are not allowed in variables (yes there would be a workaround with dictionaries).

ffmpeg -dump_attachment:t:0 "" -i test.mkv

I couldn't find any other issue about dump_attachment. And yes, of course I could just run a subprocess with the correct command, but still. Also, it would be interesting, if there is a way using ffmpeg to extract attachments as octet-stream instead of dumping them to a file and read them again.

cansik avatar Dec 07 '23 21:12 cansik

"Also, it would be interesting, if there is a way using ffmpeg to extract attachments as octet-stream instead of dumping them to a file and read them again."

did you figure out a solution for this?

SnowSquire avatar Nov 27 '24 09:11 SnowSquire

@SnowSquire Not really, I am still using the temp file solution.

cansik avatar Nov 27 '24 17:11 cansik