Skip to content

Commit

Permalink
[ci skip] Add convert utility script
Browse files Browse the repository at this point in the history
  • Loading branch information
araffin committed Jun 15, 2018
1 parent bd4c184 commit 06c5e40
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ omit =
teleop/teleop_client.py
# Needs an input video
train/split_video.py
train/convert_video.py

[report]
exclude_lines =
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ python -m train.test -f path/to/dataset/folder -w cnn_model_tmp.pth
#### Recommended : Use an image with everything already installed

0. You need a 16GB micro sd card (warning, all data on that card will be overwritten)
WARNING: for a smaller sd card, you need to resize the image before writing it (this [link](https://github.com/billw2/rpi-clone) may help)
WARNING: for a smaller sd card, you need to resize the image before writing it (this [link](https://softwarebakery.com/shrinking-images-on-linux) and [repo](https://github.com/billw2/rpi-clone) may help)

1. Download the image [here](https://drive.google.com/open?id=1CUmSKOQ7i_XTrsLCRntypK9KcVaVwM4h)

Expand Down
11 changes: 11 additions & 0 deletions train/convert_video.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""
Convert h264 videos (in the current folder) to mp4 using MP4Box
"""
import os
import subprocess

files = [f for f in os.listdir(".") if f.endswith(".h264")]

for f in files:
print("Converting {}".format(f))
ok = subprocess.call(['MP4Box', '-add', f, f[:-4] + "mp4"])

0 comments on commit 06c5e40

Please sign in to comment.