OpenHTJ2K icon indicating copy to clipboard operation
OpenHTJ2K copied to clipboard

Feature request: batch encoding / decoding

Open boxerab opened this issue 4 years ago • 4 comments

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 avatar Nov 01 '21 14:11 boxerab

@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 :)

osamu620 avatar Nov 04 '21 09:11 osamu620

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 avatar Nov 04 '21 12:11 boxerab

@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 :)

osamu620 avatar Nov 08 '21 09:11 osamu620

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.

boxerab avatar Nov 09 '21 14:11 boxerab