Skip to content

Just a nifty alias to make it automatically display in browser #442

@Manamama

Description

@Manamama

Problem/Use Case

Just an alias to make it display asap, independent of the input filename. May come in handy for some or can be added as a switch in later versions.

Proposed Implementation:

alias scenedetectme='function _scenedetect() {
    OUTPUT_FILE="$(dirname "$1")/$(basename "${1%.*}")-Scenes.html"
    time scenedetect -i "$1" --verbosity info save-images -o "$(dirname "$1")"  export-html                                   
    echo "Exported to: $OUTPUT_FILE. Opening it with Google Chrome ...".
    google-chrome "$OUTPUT_FILE"
}; _scenedetect'

Output:

~$ scenedetectme "/TOSH-P2_Data_Public/Video/Test_detect/Military robots clearing.mp4"
[PySceneDetect] PySceneDetect 0.6.4
[PySceneDetect] Image output format set: JPEG [Quality: 95]
[PySceneDetect] Image output directory set:
  /TOSH-P2_Data_Public/Video/Test_detect
[PySceneDetect] HTML file name format:
 $VIDEO_NAME-Scenes.html
[PySceneDetect] Downscale factor set to 4, effective resolution: 256 x 144
[PySceneDetect] Detecting scenes...                                                                                                                                                                                
  Detected: 5 | Progress: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 748/748 [00:02<00:00, 337.08frames/s]
[PySceneDetect] Processed 748 frames in 2.3 seconds (average 330.48 FPS).
[PySceneDetect] Detected 6 scenes, average shot length 5.0 seconds.
[PySceneDetect] Generating output images (3 per scene)...
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 18/18 [00:02<00:00,  6.30images/s]
[PySceneDetect] Exporting to html file:
 /TOSH-P2_Data_Public/Video/Test_detect/Military robots clearing-Scenes.html:

real	0m7.356s
user	0m22.813s
sys	0m2.058s
Exported to: /TOSH-P2_Data_Public/Video/Test_detect/Military robots clearing-Scenes.html. Opening it with Google Chrome ....
Opening in existing browser session.

Environment:
Any, methinks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions