Thomasyse / BDMatch

An automatic subtitle shifter from a video to another. 将字幕由一个视频匹配到另一个的自动时间轴平移工具。
MIT License
46 stars 3 forks source link

[Feature] Simplify port to other OS #4

Closed Subarashii-no-Fansub closed 4 years ago

Subarashii-no-Fansub commented 4 years ago

Is your feature request related to a problem? Please describe.

For users of other platforms, BDMatchCore, including the core functions of the project, can be modified and compiled into a command-line executable.

I read that, try to analyze, and see that here https://github.com/Thomasyse/BDMatch/blob/def4130173baa0ac7d1acd47dea407768412ed24/BDMatchCore/headers/targetver.h#L7-L11 I can put an ifdef win32 to avoid problem on Linux

But your file https://github.com/Thomasyse/BDMatch/blob/131c6370d5c51c1c90c09fb55bfbcf9e2eea34a5/BDMatchCore/include/instructionset.h at line 4 and with CPU command seems really windows-related

Describe the solution you'd like

Help to create a cross project by putting ifdef condition, thanks

Thomasyse commented 4 years ago

The file "instructionset.h" is just for detecting the support of intrinsics of a CPU, which is Windows-specific. For other platforms, you can just ignore this file and specify the parameter manually. An example of command line usage is in BDMatchCore.cpp.

Subarashii-no-Fansub commented 4 years ago

Hello Thanks for your comment, but I need more information. So to sum up:

If yes, I have theses errors:

no instance of constructor "BDMatchCore::BDMatchCore" matches the argument list -- argument types are: (std::atomic_flag *)

Edit: Moreover, BDMatchCore.h has a dependency with language_pack, and that broke my gcc :D

Thomasyse commented 4 years ago

Hello I've made a new commit for compilation on other platforms including some code changes. A makefile and a new example of CLI usage are provided. They had been verified on Ubuntu 18.04. Hope it will help you!

Subarashii-no-Fansub commented 4 years ago

Thanks for helping me a lot :)

$ make CXX=g++ FFmpeg_include=/usr/include fftw_headers=/usr/include

/usr/include are my location of header of ffmpeg and fftw (and this works)

I'm closing the issue as it seems to be fixed (and working) now, but:

$ ./bdmatch 
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_M_construct null not valid
Aborted (core dumped)
Thomasyse commented 4 years ago

There is a small bug lol. Try the latest commit.