Discussion:
[vlc-devel] MediaPlayer().audio_set_delay() not working properly.
Jeff Hoogland
2014-10-06 04:34:02 UTC
Permalink
Howdy,

I am having an issue with the audio_set_delay function on a vlc.MediaPlayer
object. Essentially I am setting the delay and then confirming it is set
properly by calling the audio_get_delay function, but for some reason the
player isn't having the pts delay set properly. Example output:

CODE: SELECT ALL <https://forum.videolan.org/viewtopic.php?f=32&t=122045#>
jeff at hoogland-clevo:/media/jeff/Storage/qAndora$ python qAndora.py
Playing song live from URL
2500
[0x2f12148] main input error: ES_OUT_SET_(GROUP_)PCR is called too late
(pts_delay increased to 1000 ms)
[0x2f12148] main input error: ES_OUT_RESET_PCR called

The 2500 is the printed audio_get_delay output for the MediaPlayer object.
I am confused why if the object is confirming the audio delay is set to
2500 MS, why the player is reporting that it is moving the delay to 1000 ms
(lower than the 2500).

You can see where I create the player object and assign the media in the
function starting on line 164 here
<https://github.com/JeffHoogland/qAndora/blob/master/playerVLC/playerVLC.py>.
I set the audio delay on line 186.

Am I doing something wrong/not understanding something here? I really want
to use VLC as the backend for my software, but not being able to set the
delay causes the tracks to skip a few times when they first start.

I am having this delay issue on both Ubuntu 14.04 with VLC 2.1.4 and on
Windows 7 with the latest VLC download from the video lan home page.

Thanks for your time,
--
~Jeff Hoogland <http://jeffhoogland.com/>
My Projects on GitHub <https://github.com/JeffHoogland>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20141005/6ce3ae83/attachment.html>
Rémi Denis-Courmont
2014-10-06 06:20:17 UTC
Permalink
Hello,
Post by Jeff Hoogland
I am having an issue with the audio_set_delay function on a
vlc.MediaPlayer object. Essentially I am setting the delay and then
confirming it is set properly by calling the audio_get_delay
function,
but for some reason the player isnt having the pts delay set
properly.
To be clear, the PTS delay and the audio delay are separate things. You
cannot control the PTS delay from LibVLC directly at the moment.
--
R?mi Denis-Courmont
Jeff Hoogland
2014-10-06 14:20:33 UTC
Permalink
Is there ANY way of increasing the PTS delay by default? I am streaming
media from the internet and I am getting stuttering until the delay is
increased to 2500 or so.
Post by Rémi Denis-Courmont
Hello,
Post by Jeff Hoogland
I am having an issue with the audio_set_delay function on a
vlc.MediaPlayer object. Essentially I am setting the delay and then
confirming it is set properly by calling the audio_get_delay function,
but for some reason the player isnt having the pts delay set properly.
To be clear, the PTS delay and the audio delay are separate things. You
cannot control the PTS delay from LibVLC directly at the moment.
--
R?mi Denis-Courmont
_______________________________________________
vlc-devel mailing list
https://mailman.videolan.org/listinfo/vlc-devel
--
~Jeff Hoogland <http://jeffhoogland.com/>
My Projects on GitHub <https://github.com/JeffHoogland>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20141006/22dd9561/attachment.html>
Rémi Denis-Courmont
2014-10-06 14:25:03 UTC
Permalink
Post by Jeff Hoogland
Is there ANY way of increasing the PTS delay by default? I am streaming
media from the internet and I am getting stuttering until the delay is
increased to 2500 or so.
I am not sure if this is a good idea, but I guess you could set the "network-
caching" option on the media item.
--
R?mi Denis-Courmont
http://www.remlab.net/
Jeff Hoogland
2014-10-09 06:15:48 UTC
Permalink
The libvlc_media_add_option() keeps giving me a segfault whenever I try to
call it. For example I am running:

vlc.libvlc_media_add_option( self.player, "--network-caching 2500")

Where self.player is my vlc.MediaPlayer instance.

Any other suggestions? VLC works great for this streaming media once the
pts_delay gets to a proper level. Really wish the API allowed me to just
set this value directly. Sadly I think I need to start looking for other
media backend options.

On Thu, Oct 9, 2014 at 1:14 AM, Jeff Hoogland <JeffHoogland at linux.com>
The libvlc_media_add_option() keeps giving me a segfault whenever I try
vlc.libvlc_media_add_option( self.player, "--network-caching 2500")
Where self.player is my vlc.MediaPlayer instance.
On Mon, Oct 6, 2014 at 9:54 AM, R?mi Denis-Courmont <remi at remlab.net>
That function doesn't support just setting the PTS delay? Could you
provide
an example on how to set network caching and what type of inputs it
accepts?
I don't have any example at hand. I'm not even sure if it works.
--
R?mi Denis-Courmont
http://www.remlab.net/
--
~Jeff Hoogland <http://jeffhoogland.com/>
My Projects on GitHub <https://github.com/JeffHoogland>
--
~Jeff Hoogland <http://jeffhoogland.com/>
My Projects on GitHub <https://github.com/JeffHoogland>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20141009/efe3ef25/attachment.html>
Tim Walker
2014-10-09 07:01:26 UTC
Permalink
Post by Jeff Hoogland
vlc.libvlc_media_add_option( self.player, "--network-caching 2500")
Where self.player is my vlc.MediaPlayer instance.
/**
* Add an option to the media.
*
* This option will be used to determine how the media_player will
* read the media. This allows to use VLC's advanced
* reading/streaming options on a per-media basis.
*
* \note The options are listed in 'vlc --long-help' from the command line,
* e.g. "-sout-all". Keep in mind that available options and their semantics
* vary across LibVLC versions and builds.
* \warning Not all options affects libvlc_media_t objects:
* Specifically, due to architectural issues most audio and video options,
* such as text renderer options, have no effects on an individual media.
* These options must be set through libvlc_new() instead.
*
* \param p_md the media descriptor
* \param psz_options the options (as a string)
*/
LIBVLC_API void libvlc_media_add_option(
libvlc_media_t *p_md,
const char * psz_options );

I suspect your vlc.MediaPlayer instance is of type libvlc_media_player_t?

Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20141009/9dd6febd/attachment.html>
Loading...