Possible improvement?
Do you think it would be possible to parse the output directly from stdout rather than parsing the ffmetadata ini so that multiple input files could be processed with a single instance of ffmpeg?
This would provide a significant performance gain when reading metadata for a large collection, right?
I could probably hack on it if you can't think of any major caveats to this approach.
Ex:
ffmpeg -i 01.mp3 -i 02.mp3 -i 03.mp3..
What do you mean by "parse the output directly from stdout rather than parsing the ffmetadata ini"? The module currently parses the ffmetadata ini output from ffmpeg stdout.
Support for multiple input files would be great though! I am not sure what the ffmpeg output would look like with multiple -i inputs, but I imagine it would just be multiple concatenated ffmetadata inis? That should be easy to parse as long as the order is consistent.
Yeah, as far as I can tell -f ffmetadata works only on the first input file so the metadata would have to be read directly from the output of ffmpeg (no -f) which would be more difficult to parse.
I am not sure what the limit of input files is, but I tested a single album with 20 songs and it was very fast. It would also save the expense of spawning huge numbers of ffmpeg processes while iterating over a large collection.
Yeah, as far as I can tell -f ffmetadata works only on the first input file so the metadata would have to be read directly from the output of ffmpeg (no -f) which would be more difficult to parse.
Ah ok, I understand now.
I am not sure what the limit of input files is, but I tested a single album with 20 songs and it was very fast. It would also save the expense of spawning huge numbers of ffmpeg processes while iterating over a large collection.
Sounds great - I would gladly entertain a patch.