Skip to content

Commit

Permalink
Merge pull request #20 from LukasBommes/new_test_video
Browse files Browse the repository at this point in the history
New test video
  • Loading branch information
LukasBommes authored Aug 26, 2022
2 parents ac53924 + b542e9c commit 75424af
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ jobs:
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.manylinux_image }}
#CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.manylinux_image }}
CIBW_BUILD_FRONTEND: build
CIBW_TEST_COMMAND: VIDEO_URL={project}/vid.mp4 python3 {project}/tests/tests.py
CIBW_TEST_COMMAND: VIDEO_URL={project}/vid_h264.mp4 python3 {project}/tests/tests.py
CIBW_BUILD_VERBOSITY: 1

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
path: ./wheelhouse/*.whl
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ COPY setup.py /home/video_cap
COPY src /home/video_cap/src/

# Install Python package
COPY vid.mp4 /home/video_cap
RUN python3.10 -m pip install --upgrade pip build && \
python3.10 -m pip install 'pkgconfig>=1.5.1' 'numpy>=1.17.0'

Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ include LICENSE
include pyproject.toml
include extract_mvs.py
include setup.py
include vid.mp4
include vid_h264.mp4
include vid_mpeg4_part2.mp4
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ Note, that we currently provide the package only for x86-64 linux, such as Ubunt

### Step 2: Extract Motion Vectors

Download the example video `vid.mp4` from the repo and place it somewhere. To extract the motion vectors, open a terminal at the same location and run
Download the example video `vid_h264.mp4` from the repo and place it somewhere. To extract the motion vectors, open a terminal at the same location and run
```
extract_mvs vid.mp4 --preview --verbose
extract_mvs vid_h264.mp4 --preview --verbose
```

The extraction script provides command line options to store extracted motion vectors to disk, and to enable/disable graphical output. For all options type
Expand All @@ -64,7 +64,7 @@ extract_mvs -h
```
For example, to store extracted frames and motion vectors to disk without showing graphical output run
```
extract_mvs vid.mp4 --dump
extract_mvs vid_h264.mp4 --dump
```


Expand Down
16 changes: 8 additions & 8 deletions release.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Create a new release

### Step 1) Push code
### Step 1) Bump version

Make changes, commit and push. The build workflow starts automatically and builds the Docker image and wheels. The Docker image is automatically pushed to Dockerhub. The wheels need to be manually uploaded to PyPI as explained below.
Bump the version in `setup.py`

### Step 2) Bump version
### Step 2) Push code

Bump the version in `setup.py`
Make changes, commit and push. The build workflow starts automatically and builds the Docker image and wheels. The Docker image is automatically pushed to Dockerhub. The wheels need to be manually uploaded to PyPI as explained below.

### Step 2) Create tag and release
### Step 3) Create tag and release

Now, create a tag with the same version just entered in the `setup.py` and push that tag to the remote.
```
Expand All @@ -18,7 +18,7 @@ git push origin vx.x.x

Then create a release on GitHub using this tag.

### Step 3) Upload wheels to PyPI
### Step 4) Upload wheels to PyPI

First, make sure you have the most recent version of twine installed on the host
```
Expand All @@ -30,7 +30,7 @@ Then, download and extract the wheels from the (successfully completed) workflow
python3 -m twine upload dist/*
```

#### Step 4) Tag Docker image with correct version
#### Step 5) Tag Docker image with correct version

When pushing changes, a Docker image `lubo1994/mv-extractor:dev` is being build and pushed to DockerHub. Upon a release, this image should be tagged with the correct release version and the `latest` tag. To this end, first pull the `dev` image
```
Expand All @@ -43,4 +43,4 @@ sudo docker push lubo1994/mv-extractor:vx.x.x
sudo docker tag lubo1994/mv-extractor:vx.x.x lubo1994/mv-extractor:latest
sudo docker push lubo1994/mv-extractor:latest
```
where `vx.x.x` is replaced with the version of the release.
where `vx.x.x` is replaced with the version of the release.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
setup(name='motion-vector-extractor',
author='Lukas Bommes',
author_email=' ',
version="1.0.5",
version="1.0.6",
license='MIT',
url='https://github.com/LukasBommes/mv-extractor',
description=('Reads video frames and MPEG-4/H.264 motion vectors.'),
Expand Down
4 changes: 2 additions & 2 deletions src/mvextractor/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def main(args=None):
args = sys.argv[1:]

parser = argparse.ArgumentParser(description='Extract motion vectors from video.')
parser.add_argument('video_url', type=str, nargs='?', default="vid.mp4", help='File path or url of the video stream')
parser.add_argument('video_url', type=str, nargs='?', help='File path or url of the video stream')
parser.add_argument('-p', '--preview', action='store_true', help='Show a preview video with overlaid motion vectors')
parser.add_argument('-v', '--verbose', action='store_true', help='Show detailled text output')
parser.add_argument('-d', '--dump', action='store_true', help='Dump frames, motion vectors, frame types, and timestamps to output directory')
Expand Down Expand Up @@ -111,4 +111,4 @@ def main(args=None):


if __name__ == "__main__":
sys.exit(main())
sys.exit(main())
4 changes: 2 additions & 2 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from mvextractor.videocap import VideoCap


video_url = os.getenv('VIDEO_URL', 'vid.mp4')
video_url = os.getenv('VIDEO_URL', 'vid_h264.mp4')


def validate_timestamp(timestamp, tolerance=10.0):
Expand Down Expand Up @@ -153,4 +153,4 @@ def test_timings(self):


if __name__ == '__main__':
unittest.main()
unittest.main()
File renamed without changes.
Binary file added vid_mpeg4_part2.mp4
Binary file not shown.

0 comments on commit 75424af

Please sign in to comment.