I've recreated this using the Python bindings to libvlc as shown below.
The file which is being played back is being captured using multicat, and is growing (confirmed with watch ls -l ....).
Notes:
- The output from VLC is left intact. I didn't create a context for the player so only the audio was rendered, but this was sufficient for the test.
Findings:
- get_position reports positions > 1.0 when playback passes the original duration of the file
- it is NOT possible to set a position > 1.0 - VLC simply plays from position 1.0
- get_length consistently reports the original length of the clip
Code: Select all
$ export VLC_PLUGIN_PATH=/Applications/VLC.app/Contents/MacOS/plugins/
$ python
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import vlc
>>> instance = vlc.Instance()
>>> player = instance.media_player_new()
>>> media = instance.media_new("file:///Volumes/captures/bbcnew_1_1466406091/407336.ts")
>>> player.set_media(media)
>>> player.play()
0
>>> [00007fc802f544c8] macosx vout display error: No drawable-nsobject nor vout_window_t found, passing over.
[00007fc80389deb8] core video output error: video output creation failed
[00007fc8030a62b8] core decoder error: failed to create video output
>>> vlc.libvlc_media_player_get_position(player)
0.10156689584255219
>>> vlc.libvlc_media_player_get_length(player)
1176666
>>> vlc.libvlc_media_player_get_length(player)
1176666
>>> vlc.libvlc_media_player_get_length(player)
1176666
>>> vlc.libvlc_media_player_get_length(player)
1176666
>>> vlc.libvlc_media_player_get_length(player)
1176666
>>> vlc.libvlc_media_player_get_length(player)
1176666
>>> vlc.libvlc_media_player_get_length(player)
1176666
>>> vlc.libvlc_media_player_get_length(player)
1176666
>>> import time
>>> while True:
... vlc.libvlc_media_player_get_position(player)
... time.sleep(1)
...
0.2612680494785309
0.262220561504364
0.2629339098930359
0.26387032866477966
0.26477792859077454
0.26570072770118713
0.2663840651512146
0.26731234788894653
0.2681690752506256
0.268882691860199
0.2698352336883545
0.27076664566993713
0.271470308303833
0.2724232077598572
0.2733567953109741
^CTraceback (most recent call last):
File "<stdin>", line 3, in <module>
KeyboardInterrupt
>>> vlc.libvlc_media_player_set_position(player, .98)
>>> [00007fc802d78ca8] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 4, expected 13) for PID 0
[00007fc802d78ca8] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 0, expected 9) for PID 500
[00007fc802d78ca8] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 10, expected 1) for PID 17
[00007fc802d78ca8] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 8, expected 2) for PID 20
>>>
>>> while True:
... vlc.libvlc_media_player_get_position(player)
... time.sleep(1)
...
0.9883562326431274
0.9893091917037964
0.9900230169296265
0.9909444451332092
0.9918898940086365
0.9927594661712646
0.9932050704956055
0.9943660497665405
0.9952577352523804
0.9959721565246582
0.9968942999839783
0.9978464245796204
0.9985599517822266
0.999513566493988
1.0004348754882812
1.0011491775512695
1.002070426940918
1.0027828216552734
^CTraceback (most recent call last):
File "<stdin>", line 3, in <module>
KeyboardInterrupt
>>> vlc.libvlc_media_player_set_position(player, 1.05)
>>> [00007fc802d78ca8] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 8, expected 7) for PID 0
[00007fc802d78ca8] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 4, expected 3) for PID 500
[00007fc802d78ca8] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 1, expected 14) for PID 17
vlc.while True:
... vlc.libvlc_media_player_get_position(player)
... time.sleep(1)[00007fc802d78ca8] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 10, expected 11) for PID 20
...
1.0063832998275757
1.0073349475860596
1.0080195665359497
1.0088791847229004
1.0098339319229126
1.0105475187301636
^[[A^[[A1.0114997625350952
^CTraceback (most recent call last):
File "<stdin>", line 3, in <module>
KeyboardInterrupt
>>> vlc.libvlc_media_player_set_position(player, 1.4)
>>> [00007fc802d78ca8] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 6, expected 9) for PID 0
[00007fc802d78ca8] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 2, expected 5) for PID 500
[00007fc802d78ca8] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 1, expected 8) for PID 17
vlc.
KeyboardInterrupt
>>>
>>>
>>>
>>> while True:
... vlc.libvlc_media_player_get_position(player)[00007fc802d78ca8] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 10, expected 11) for PID 20
... time.sleep(1)
...
1.0086743831634521
1.009626030921936
1.0105475187301636
1.0112614631652832
1.0121963024139404
1.0128976106643677
1.013848900794983
^CTraceback (most recent call last):
File "<stdin>", line 3, in <module>
KeyboardInterrupt
>>> vlc.libvlc_media_player_get_position(player)
1.0611735582351685
>>> vlc.libvlc_media_player_get_position(player)
1.0630782842636108
>>> vlc.libvlc_media_player_get_position(player)
1.0640308856964111
>>> vlc.libvlc_media_player_set_position(player, 1.06)
>>> [00007fc802d78ca8] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 1, expected 15) for PID 17
[00007fc802d78ca8] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 10, expected 15) for PID 0
[00007fc802d78ca8] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 6, expected 11) for PID 500
vlc.libvlc_media_player_set_get_position(player)
1.0034089088439941
>>> [00007fc802d78ca8] ts demux error: libdvbpsi error (PSI decoder): TS discontinuity (received 10, expected 0) for PID 20