Skip to content

Commit 6c9a897

Browse files
committed
fix readme
1 parent 3c83657 commit 6c9a897

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

README.md

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ Inspired by [PySceneDetect](https://github.com/Breakthrough/PySceneDetect), Shut
1111
- **Flexible**: Supports both rule-based and machine-learning-based approaches.
1212

1313
## Installation
14-
15-
### Build from Source
1614
Ensure that FFmpeg, OpenCV, and CMake are installed.
1715
```
1816
sudo apt install libopencv-dev ffmpeg cmake
@@ -47,17 +45,35 @@ See [documentation](docs/cli_documentation.md) for details.
4745

4846
## API
4947
### Python
50-
Install `libshutoh` by running:
48+
Install Shutoh by running:
5149
```
5250
pip install git+https://github.com/awkrail/shutoh.git
5351
```
5452
To detect scenes with `ContentDetector()`, run the following code:
5553
```python
5654
from libshutoh import detect, ContentDetector
57-
detector = ContentDetector.initialize_detector()
55+
detector = ContentDetector.initialize_detector(threshold=27, min_scene_len=15)
56+
scenes = detect('video/input.mp4', detector)
57+
for i, scene in enumerate(scene_list):
58+
print('Scene %2d: Start %s / Frame %d, End %s / Frame %d' % (
59+
i+1,
60+
scene[0].get_timecode(), scene[0].get_frames(),
61+
scene[1].get_timecode(), scene[1].get_frames(),))
62+
```
63+
Using `scenedetect.split_video_ffmpeg`, we can also split the video into each scene:
64+
```python
65+
from libshutoh import detect, ContentDetector
66+
from scenedetect import split_video_ffmpeg
67+
detector = ContentDetector.initialize_detector(threshold=27, min_scene_len=15)
5868
scenes = detect('video/input.mp4', detector)
69+
split_video_ffmpeg('vide/input.mp4', scenes, show_progress=True)
5970
```
60-
See [Python API documentation](docs/python_documentation.md) for details.
71+
If you want to use other detectors, replace the detector with the new one:
72+
```python
73+
from libshutoh import AdaptiveDetector
74+
detector = AdaptiveDetector.initialize_detector()
75+
```
76+
**Detector list:** AdaptiveDetector, ContentDetector, HashDetector, HistogramDetector, ThresholdDetector
6177

6278
### C++
6379
The simpletest code is as follow:
@@ -98,14 +114,6 @@ FetchContent_Declare(
98114
FetchContent_MakeAvailable(shutoh)
99115
target_link_libraries(YOUR_LIBRARY PUBLIC shutoh OTHER_LIBRARIES)
100116
```
101-
See [C++ API documentation](docs/cpp_documentation.md) for details.
102-
103-
## Tests
104-
Run test using `ctest`:
105-
```shell
106-
cd build
107-
ctest
108-
```
109117

110118
## Contribution
111119
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

docs/cpp_documentation.md

Whitespace-only changes.

docs/python_documentation.md

Whitespace-only changes.

0 commit comments

Comments
 (0)