Comments (7)
return Container(
width: double.infinity,
height: double.infinity,
color: Colors.transparent,
child: _controller.value.isInitialized ? AspectRatio(aspectRatio: _controller.value.aspectRatio, child: VideoPlayer(_controller)) : Container(),
);
What does it mean?
from fvp.
return Container( width: double.infinity, height: double.infinity, color: Colors.transparent, child: _controller.value.isInitialized ? AspectRatio(aspectRatio: _controller.value.aspectRatio, child: VideoPlayer(_controller)) : Container(), );What does it mean?
The code was not fully representative of the problem. I have updated the first post with a better code and more details
from fvp.
the video aspect ratio is not 5/4, but 5/4*1.45455 = 1.82, 1.45455 is pixel aspect ratio, i.e. a pixel width/height is not 1. the original video aspect ratio is correct in fvp, android official player is wrong, you can compare with other players, for example mpv. The official player supports macOS now, so you can also compare the results with and without fvp on macOS.
from fvp.
the video aspect ratio is not 5/4, but 5/4*1.45455 = 1.82, 1.45455 is pixel aspect ratio, i.e. a pixel width/height is not 1. the original video aspect ratio is correct in fvp, android official player is wrong, you can compare with other players, for example mpv. The official player supports macOS now, so you can also compare the results with and without fvp on macOS.
The issue at hand is not 100% about the original aspect ratio of the video, but more related to a custom aspect ratio due to what appears to be transparent bars at the top and bottom of videos played with FVP.
The player is intended for use in a scenario where my users may want to play videos with varying aspect ratios, but this becomes problematic as FVP interprets the transparent bars as part of the video content.
The sample video, originally in a 16:9 aspect ratio, has been stretched to some other non-standard aspect ratio to simulate this scenario.
It happens also if I use the backend api:
import 'package:flutter/material.dart';
import 'package:fvp/mdk.dart';
import 'package:fvp/fvp.dart';
import 'package:logging/logging.dart';
void main() {
Logger.root.level = Level.ALL;
Logger.root.onRecord.listen((record) {
print('${record.loggerName}: ${record.message}');
});
registerWith();
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: VideoPlayerScreen(),
),
);
}
}
class VideoPlayerScreen extends StatefulWidget {
VideoPlayerScreen();
@override
_VideoPlayerScreenState createState() => _VideoPlayerScreenState();
}
class _VideoPlayerScreenState extends State<VideoPlayerScreen> {
late final player = Player();
@override
void initState() {
super.initState();
player.media = 'https://supertest.netsons.org/output.mp4';
player.loop = -1;
player.state = PlaybackState.playing;
player.setAspectRatio(16/9);
player.updateTexture();
}
@override
Widget build(BuildContext context) {
return Center(
child: ValueListenableBuilder<int?>(
valueListenable: player.textureId,
builder: (context, id, _) => id == null ? const SizedBox.shrink() : Texture(textureId: id),
),
);
}
@override
void dispose() {
super.dispose();
player.dispose();
}
}
from fvp.
Now I know the reason. I use a texture in video frame size, but render the content to texture in another aspect ratio.
from fvp.
try the latest code. upgrading mdk is required
from fvp.
try the latest code. upgrading mdk is required
Tested and it is working. Thank you!
from fvp.
Related Issues (20)
- [Question] Is it possible to use the ffmpeg libs like the command line version? HOT 2
- Default flutter application can't run on Android with the fvp plugin HOT 5
- App crash on IOS and iPad 17 , HOT 6
- App Crash on iOS HOT 2
- Inconsistent getPosition result HOT 3
- [mdk.dart aka backend player api] Choppy playback after setting external audio track, application freezes in between switching media source. HOT 7
- Crash on Android debug mode HOT 2
- [Question] 如何播放二进制流 HOT 3
- 直播m3u8视频Debug模式正常,Release模式时长Duration获取不对,显示2562047788:00:54 HOT 23
- iphone/ipad 设备静音后播放视频没有声音,videoplayer官方的是没问题,其它app也都有声音 HOT 2
- 某些m3u8的视频中插入了广告,这个时候视频会卡住,听见广告的声音,有没有办法可以跳过这种插入的广告 HOT 2
- Debug模式没问题,真机Release模式崩溃,mdk.demux@0x16aef3000 (37): EXC_BREAKPOINT (code=1, subcode=0x1ae529df0) HOT 41
- 某小视频开头插入了一段广告,广告播放完成后,画面就卡住不动了(广告的最后一帧),声音还在继续播放,VT error: -12909 HOT 13
- 华为平板FDR-A03L,Android5.1.1,CPU Qualcomm MSM8939,AMediaCodec奔溃,不会自动跳到FFmpeg HOT 2
- 华为平板FDR-A03L,Android5.1.1,CPU Qualcomm MSM8939,FFmpeg视频画面绿色的 HOT 24
- NokiaX7 两种解码方式结果一样刷新率肉眼可见的低,估计1秒只有10帧 HOT 3
- Video Player Init Faild HOT 7
- Building with --wasm fails when using fvp HOT 5
- seek on stream, increase cache HOT 10
- Prevent logs in console HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fvp.