Feature request: batch encoding / decoding
Hi @osamu620, hope all is well! Have you considered adding support for encoding or decoding a folder of images ? As HTJ2K shows promise for video encoding, I think it would be interesting to see how the workflow might run for a batch of images, to simulate a video stream. What do you think ?
Fortunately, C++17 supports platform-independent method to list files
#include <string>
#include <iostream>
#include <filesystem>
namespace fs = std::filesystem;
int main()
{
std::string path = "/path/to/directory";
for (const auto & entry : fs::directory_iterator(path))
std::cout << entry.path() << std::endl;
}
@boxerab Hi, It would be interesting to support the batch processing. One thing that comes to my mind is this work would probably lead to implementing JPEG 2000 Part 3 (Motion JPEG 2000). I'm not familiar with the Part 3 spec, so it would take some amount of time.
If separate output codestreams are acceptable for now, it might not take longer :)
If separate output codestreams are acceptable for now, it might not take longer :)
Thanks, @osamu620 . Yes, it would be great for first step to have separate codestreams for each input image. This would show how codec performs on "video" work flow.
@boxerab OK. I will try to create a new app (video_enc) to compress image sequences in a folder/directory. It will be a very simple one (like a shell script to do the same thing) Anyhow, it would be a starting point :)
thanks, @osamu620 . What do you think about adding three new command line args
ImageDirectory : OutputFormat (j2k or jp2 or jpc) OutputDirectory
then this new feature could be added to the existing encoder.