Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix extract_all.sh and add new script to extract all videos in one run #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@ Otherwise, just install the requirements on your main Python environment using `
pip install -r requirements
```

Extract all frames from video files.
You can copy all your videos to the `data` folder and run the scrip to extract all videos in the folder by using
```
sh extract_all_videos_files.sh
```
or you can use the below script to extract one file
```
sh extract_all.sh data/video_file.MOV
```


Finally, open the GUI using:
```bash
python -m ultimatelabeling.main
Expand Down
8 changes: 6 additions & 2 deletions extract_all.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/bin/sh

mkdir $2
ffmpeg -i $1 -vf "select=not(mod(n\,5))" -vsync vfr -qscale:v 2 -start_number 0 $2/%05d.jpg
input_path=$1
output_path=${input_path%.*}

mkdir $output_path
echo $output_path
ffmpeg -i $1 -vf "select=not(mod(n\,5))" -vsync vfr -qscale:v 2 -start_number 0 $output_path/%05d.jpg
9 changes: 9 additions & 0 deletions extract_all_videos_files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

for filename in data/*.MOV; do
input_path=$filename
output_path1=${input_path%.*}
echo "$output_path1"
mkdir $output_path1
ffmpeg -i $input_path -vf "select=not(mod(n\,5))" -vsync vfr -qscale:v 2 -start_number 0 "$output_path1"/%05d.jpg
done