diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf77ccf..0238e44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 \ No newline at end of file + path: ./wheelhouse/*.whl diff --git a/Dockerfile b/Dockerfile index 2b418bd..6916579 100755 --- a/Dockerfile +++ b/Dockerfile @@ -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' diff --git a/MANIFEST.in b/MANIFEST.in index 98b3aef..0b9a5cc 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -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 diff --git a/README.md b/README.md index fad286c..dedeec2 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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 ``` diff --git a/release.md b/release.md index fab59c5..e7320dc 100644 --- a/release.md +++ b/release.md @@ -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. ``` @@ -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 ``` @@ -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 ``` @@ -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. \ No newline at end of file +where `vx.x.x` is replaced with the version of the release. diff --git a/setup.py b/setup.py index a5877f8..1e9a94e 100755 --- a/setup.py +++ b/setup.py @@ -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.'), diff --git a/src/mvextractor/__main__.py b/src/mvextractor/__main__.py index 28d9880..1e148d1 100644 --- a/src/mvextractor/__main__.py +++ b/src/mvextractor/__main__.py @@ -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') @@ -111,4 +111,4 @@ def main(args=None): if __name__ == "__main__": - sys.exit(main()) \ No newline at end of file + sys.exit(main()) diff --git a/tests/tests.py b/tests/tests.py index a50ec37..ca6e89e 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -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): @@ -153,4 +153,4 @@ def test_timings(self): if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main() diff --git a/vid.mp4 b/vid_h264.mp4 similarity index 100% rename from vid.mp4 rename to vid_h264.mp4 diff --git a/vid_mpeg4_part2.mp4 b/vid_mpeg4_part2.mp4 new file mode 100644 index 0000000..6bca095 Binary files /dev/null and b/vid_mpeg4_part2.mp4 differ