Skip to content

Commit cd37701

Browse files
Merge pull request #78 from VMannello/master
Added aspect-mode as a native omxplayer-sync option
2 parents 94d90d0 + eeb3104 commit cd37701

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

README.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,21 @@ Options:
2020
-l, --slave
2121
-x DESTINATION, --destination=DESTINATION
2222
-u, --loop
23-
-v, --verbose
23+
-v, --verbose
24+
-o ADEV, --adev=ADEV
25+
-a ASPECT, --aspect=ASPECT Aspect Mode - fill, letterbox, stretch
2426
```
2527

26-
**master**
28+
**Master**
2729

2830
```
29-
omxplayer-sync -muv movie1.mp4 movie2.mp4 /movies/*
31+
omxplayer-sync -m movie1.mp4
3032
```
3133

32-
**slave**
34+
**Slave**
3335

3436
```
35-
omxplayer-sync -luv movie1.mp4 movie2.mp4 /movies/*
37+
omxplayer-sync -l movie1.mp4
3638
```
3739

3840

@@ -45,21 +47,25 @@ A recent build of omxplayer from [Sergio Conde](http://omxplayer.sconde.net).
4547

4648
Installation on Raspbian
4749
------------------------
50+
Perform on both master and slave.
4851
```
49-
su -
52+
sudo su
5053
apt-get remove omxplayer
5154
rm -rf /usr/bin/omxplayer /usr/bin/omxplayer.bin /usr/lib/omxplayer
5255
apt-get install libpcre3 fonts-freefont-ttf fbset libssh-4 python3-dbus
53-
wget http://omxplayer.sconde.net/builds/omxplayer_0.3.7~git20160713~66f9076_armhf.deb
54-
dpkg -i omxplayer_0.3.7~git20160713~66f9076_armhf.deb
56+
wget http://omxplayer.sconde.net/builds/omxplayer_0.3.7~git20170130~62fb580_armhf.deb
57+
dpkg -i omxplayer_0.3.7~git20170130~62fb580_armhf.deb
5558
wget -O /usr/bin/omxplayer-sync https://github.com/turingmachine/omxplayer-sync/raw/master/omxplayer-sync
5659
chmod 0755 /usr/bin/omxplayer-sync
5760
wget https://github.com/turingmachine/omxplayer-sync/raw/master/synctest.mp4
61+
```
5862

59-
# start on master
63+
Start on Master (-u loop, -v verbose)
64+
```
6065
omxplayer-sync -muv synctest.mp4
61-
62-
# start on slave
66+
```
67+
Start on Slave (-u loop, -v verbose)
68+
```
6369
omxplayer-sync -luv synctest.mp4
6470
```
6571

omxplayer-sync

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ except ImportError:
3333
SYNC_TOLERANCE = .05
3434
SYNC_GRACE_TIME = 5
3535
SYNC_JUMP_AHEAD = 3
36+
ASPECT_OPTIONS = ('fill', 'stretch', 'letterbox')
3637

3738
OMXPLAYER = 'omxplayer'
3839
OMXPLAYER_DBUS_ADDR='/tmp/omxplayerdbus.%s' % getpass.getuser()
@@ -142,6 +143,7 @@ class OMXPlayerSync():
142143
p.add_option('--loop', '-u', action='store_true')
143144
p.add_option('--verbose', '-v', action='store_true')
144145
p.add_option('--adev', '-o', default='both')
146+
p.add_option('--aspect', '-a', default=None, help="Aspect Mode - fill, letterbox, stretch")
145147
self.options, arguments = p.parse_args()
146148

147149
for argument in arguments:
@@ -155,6 +157,10 @@ class OMXPlayerSync():
155157

156158
if self.options.loop and len(self.playlist) == 1:
157159
self.omxplayer_options.append("--loop")
160+
161+
if self.options.aspect is not None:
162+
if self.options.aspect in ASPECT_OPTIONS:
163+
self.omxplayer_options.append("--aspect-mode %s" % self.options.aspect)
158164

159165
if not filter(lambda x: os.path.isfile(x), self.playlist):
160166
print("ERROR: none of the supplied filenames are found")

0 commit comments

Comments
 (0)