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

gstreamer_video_player - issue on looping #25

Open
kekko7072 opened this issue Oct 2, 2023 · 6 comments
Open

gstreamer_video_player - issue on looping #25

kekko7072 opened this issue Oct 2, 2023 · 6 comments

Comments

@kekko7072
Copy link

kekko7072 commented Oct 2, 2023

@ardera I'm facing this issue on looping the video.

plugins/gstreamer_video_player/player.c: last gstreamer state change failed. gst_element_get_state(element name: pipeline0): GST_STATE_CHANGE_FAILURE
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(nativeerror, Input/output error, 5, null)
#0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:652:7)
#1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:310:18)
<asynchronous suspension>
#2      FlutterpiVideoPlayer.getPosition (package:flutterpi_gstreamer_video_player/src/platform.dart:155:20)
<asynchronous suspension>
#3      VideoPlayerController._applyPlayPause.<anonymous closure> (package:video_player/video_player.dart:582:41)
<asynchronous suspension>

Any possible solution to loop the video, the code used is from the example of the package.

@kekko7072
Copy link
Author

Fixed rebuilding the app, strange.

@kekko7072
Copy link
Author

kekko7072 commented Oct 2, 2023

I've tested for looping 10 minutes and some times still happen, how can i manage this exception? The unwanted output is that the app stop the videi and the only way is to kill and relaunch the app.

@Kazumna
Copy link

Kazumna commented Nov 27, 2023

Have you found any solution? I've got the same error.

@doug-ecofixa
Copy link

Same problem here. I'm using a pi zero2, the video loops ok then stops.

Dec 05 08:20:52 fireplace flutter-pi[1278]: plugins/gstreamer_video_player/player.c: last gstreamer state change failed. gst_element_get_state(element name: pipeline0): GST_STATE_CHANGE_FAILURE Dec 05 08:20:52 fireplace flutter-pi[1278]: [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(nativeerror, Input/output error, 5, null) Dec 05 08:20:52 fireplace flutter-pi[1278]: #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:651) Dec 05 08:20:52 fireplace flutter-pi[1278]: #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:322) Dec 05 08:20:52 fireplace flutter-pi[1278]: <asynchronous suspension> Dec 05 08:20:52 fireplace flutter-pi[1278]: #2 FlutterpiVideoPlayer.getPosition (package:flutterpi_gstreamer_video_player/src/platform.dart:155) Dec 05 08:20:52 fireplace flutter-pi[1278]: <asynchronous suspension> Dec 05 08:20:52 fireplace flutter-pi[1278]: #3 VideoPlayerController._applyPlayPause.<anonymous closure> (package:video_player/video_player.dart:582) Dec 05 08:20:52 fireplace flutter-pi[1278]: <asynchronous suspension>

@fabioselau077
Copy link

Does the player allow an array of looping videos?

@ardera
Copy link
Owner

ardera commented Jan 16, 2024

Okay, I've reproduced it, it seems to be either kernel or gstreamer related. Somehow, sometimes on end of stream, the buffer sharing between kernel and gstreamer gets confused - gstreamer thinks some buffer is currently not queued/used in kernel, but some time later it dequeues that exact buffer from the kernel and emits a stream error because that shouldn't have been possible. Though no idea what causes it.

As a super hacky workaround, one could create a new video player controller in flutter at every end of stream.

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

5 participants