Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set option stream-lavf-o / stream-lavf-o-append? #291

Closed
Aiayalethe opened this issue Dec 3, 2024 · 2 comments
Closed

How to set option stream-lavf-o / stream-lavf-o-append? #291

Aiayalethe opened this issue Dec 3, 2024 · 2 comments

Comments

@Aiayalethe
Copy link

Aiayalethe commented Dec 3, 2024

import mpv
options = {
    "stream-lavf-o-append": "reconnect_on_network_error=yes"
}
player = mpv.MPV(log_handler=print, input_default_bindings=True, input_vo_keyboard=True, **options)
print(player["stream-lavf-o"])
AttributeError: ('mpv option does not exist', -5, (<MpvHandle object at 0x7fd87d421910>, b'stream-lavf-o-append', b'reconnect_on_network_error=yes'))

import mpv
# --stream-lavf-o-append=reconnect_on_http_error=4xx,5xx
# --stream-lavf-o-append=reconnect_delay_max=30
# --stream-lavf-o-append=reconnect_streamed=yes
# --stream-lavf-o-append=reconnect_on_network_error=yes
options = {
    "stream-lavf-o": "reconnect_on_http_error=4xx,5xx reconnect_delay_max=30 reconnect_streamed=yes reconnect_on_network_error=yes"
}
player = mpv.MPV(log_handler=print, input_default_bindings=True, input_vo_keyboard=True, **options)
print(player["stream-lavf-o"])
{'reconnect_on_http_error': '4xx', '5xx reconnect_delay_max': '30 reconnect_streamed=yes reconnect_on_network_error=yes'}
@Aiayalethe
Copy link
Author

they need to be separated with comma:

import mpv
options = {
    "stream-lavf-o": "reconnect_on_http_error=4xx,5xx,reconnect_delay_max=30,reconnect_streamed=yes,reconnect_on_network_error=yes"
}
player = mpv.MPV(log_handler=print, input_default_bindings=True, input_vo_keyboard=True, **options)
print(player["stream-lavf-o"])
{'reconnect_on_http_error': '4xx', '5xx,reconnect_delay_max': '30', 'reconnect_streamed': 'yes', 'reconnect_on_network_error': 'yes'}

now only issue left is escaping comma...

@Aiayalethe
Copy link
Author

import mpv
options = {
    "stream-lavf-o": "reconnect_on_http_error=\"4xx,5xx\",reconnect_delay_max=\"30\",reconnect_streamed=\"yes\",reconnect_on_network_error=\"yes\""
}
player = mpv.MPV(log_handler=print, input_default_bindings=True, input_vo_keyboard=True, **options)
print(player["stream-lavf-o"])
{'reconnect_on_http_error': '4xx,5xx', 'reconnect_delay_max': '30', 'reconnect_streamed': 'yes', 'reconnect_on_network_error': 'yes'}

...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant