admin管理员组文章数量:1126324
I am working on a Flutter app that streams video from an ESP32 device. It was working perfectly two months ago, but now it is no longer connecting. I suspect the issue might be related to the flutter_mjpeg package being deprecated or unsupported.
Here is the code I use to display the video feed:
Widget _buildNormalVideoFeed() {
return Container(
color: Colors.black,
child: Center(
child: SizedBox(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
child: Mjpeg(
fit: BoxFit.fill,
isLive: true,
stream: 'http://${widget.ipAddres}:81/stream',
loading: (context) {
return const Center(
child: CircularProgressIndicator(
valueColor: AlwaysStoppedAnimation<Color>(Colors.white),
),
);
},
error: (context, error, stackTrace) {
print('Error during streaming: $error');
print('Stack trace: $stackTrace');
return Center(
child: Padding(
padding: const EdgeInsets.all(20.0),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
'Error: $error',
style: TextStyle(
color: Colors.red,
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 10),
Text(
'Stack Trace:',
style: TextStyle(
color: Colors.white,
fontSize: 14,
fontWeight: FontWeight.w600,
),
),
const SizedBox(height: 10),
Text(
stackTrace.toString(),
style: TextStyle(
color: Colors.white,
fontSize: 12,
),
textAlign: TextAlign.center,
),
],
),
),
),
);
},
),
),
),
);
}
I get this error message:
**Error**: Connection refuse **Stack Trace:**
#0 IOClient.send (package:http/src/io_client.dart:94)
#1 Future.timeout.<anonymous closure> (dart:async/future_impl.dart:940) <synchronous suspension>
#2 _streamManager>updateStream(package:flutter_mjpeg/src?mjpeg.dart:192) <aynschronous suspension>
Verified the ***ESP32 ***is working and reachable via the same IP address and port. Checked my network settings to ensure no changes were made to the router. Attempted to debug using the error and stackTrace callbacks, but the error message hasn’t been very helpful. Looked for updates to the flutter_mjpeg package, but it seems like it might be deprecated.
My Questions:
- Has the flutter_mjpeg package been deprecated?
- If so, are there any alternatives for streaming MJPEG video in Flutter?
- Could this issue be caused by a change in how the ESP32 serves the video stream?
- Are there any debugging steps I should take to further diagnose this problem?
版权声明:本文标题:connection - Flutter app no longer connects to ESP32; possible issue with flutter_mjpeg package - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736671730a1946957.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论