[PD] using pd with mplayer udp sync

Hans-Christoph Steiner hans at at.or.at
Mon Nov 9 13:19:07 CET 2015


Hey all,

Briefly back in Pd for a little bit, we're doing a minor overhaul of Terre Natale: EXIT (http://at.or.at/hans/terrenatale).  I just found out an awesome new feature in mplayer (ok, maybe not so new;):   The UDP master/slave sync mode.  Its really easy to use either as master or slave with Pd. For mplayer as master:

  mplayer -udp-master mycoolvideo.mp4

Then receive UDP on port 23867.  For mplayer as slave:

  mplayer -udp-slave mycoolvideo.mp4

Then send UDP on port 23867.  Here are my patches:

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer-udp-master.pd
Type: application/octet-stream
Size: 1041 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20151109/ad148d3b/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer-udp-slave.pd
Type: application/octet-stream
Size: 365 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20151109/ad148d3b/attachment-0001.obj>
-------------- next part --------------


The only data to send/receive is the frame to play, in units of seconds.  So with a 30fps video, the data stream looks like this:

0.033333
0.066667
0.1
0.133333
0.166667
0.2
0.233333
0.266667
0.3
0.333333
0.366667
0.4
0.433333
0.466667
0.5
0.533333
0.566667
0.6
0.633333
0.666667
0.7
0.733333
0.766667
0.8
0.833333
0.866667
0.9
0.933333
0.966667
1
1.03333
1.06667
1.1
1.13333
1.16667
1.2
1.23333
1.26667
1.3
1.33333
1.36667
1.4
1.43333
1.46667
1.5
1.53333
1.56667
1.6
1.63333
1.66667
1.7
1.73333
1.76667
1.8
1.83333
1.86667
1.9
1.93333
1.96667
2
2.03333
2.06667
2.1
2.13333
2.16667
2.2
2.23333
2.26667
2.3
2.33333
2.36667
2.4
2.43333
2.46667
2.5
2.53333
2.56667
2.6
2.63333
2.66667
2.7
2.73333
2.76667
2.8
2.83333
2.86667
2.9
2.93333
2.96667
3
3.03333
3.06667
3.1
3.13333
3.16667
3.2
3.23333
3.26667
3.3
3.33333
3.36667
3.4
3.43333
3.46667
3.5
3.53333
3.56667
3.6
3.63333
3.66667
3.7
3.73333
3.76667
3.8
3.83333
3.86667
3.9
3.93333
3.96667
4
4.03333
4.06667
4.1
4.13333
4.16667
4.2
4.23333
4.26667
4.3
4.33333



More information about the Pd-list mailing list