Comments (14)
Can't see the issue, I'm afraid you are doing something wrong. Can you provide your code? Maybe you should try use Player.TogglePlayPause() if you use multiple threads)
from flyleaf.
from flyleaf.
@davsun55 I cannot see your code (where did you attached it?) Can you clarify that those files are playing properly with the sample/demo app from releases?
from flyleaf.
FlyleafDemo.zip
Apologies - I replied to the last msg via email rather than in this webpage so ZIP didn't work.
The files all play perfectly in Windows. Most play properly in your FlyleafPlayer (Custom) (Winforms) sample but there's no snapshot being taken there.
AVI still has delayed audio; FLAC still fastforwards the 'CurTime' on startup - although the actual audio playback is perfect; OGG has perfect audio (not delayed as in my demo).
If I add a play/pause button to your sample, same deal with skipping audio on restart in eg FLAC. The button only has flyleaf1.Player.TogglePlayPause();
Thanks
from flyleaf.
@davsun55 Now I see them, haven't test audio only much to be honest, I need to review this and I will come back soon..
Also i knew there are some weird audio formats such as pcm/flac/ogg that could create some issues
from flyleaf.
@davsun55 Please re-test when you can with the latest fixes and let me know if you still have issues
from flyleaf.
Thanks - much better, with these issues remaining:
AVI: Audio starts playing ~1 sec after the video
FLAC: Perfect
MOV: Audio has a very minor delay at the start (snapshot works now)
OGG: Still starts at position where snapshot was attempted (restart is perfect)
WMA: Perfect first time after open; However Pause; Seek(0) or SeekAccurate(0) does not reposition to the very start
from flyleaf.
BTW TogglePlayPause() works perfectly on all the audio streams
from flyleaf.
@davsun55 My mistake I thought it was enabled by default, use this:-
flConfig.Audio.FiltersEnabled = true;
This should fix both AVI/MOV
OGG: is not a video, the seek fails so you get e == -1 and it will never seek(0)
WMA: the problem is that it does not have a timestamp, initially it knows that probably is the 0 timestamp but after seek it cannot be sure.
from flyleaf.
Perfect - thanks.
For any file that doesn't have a timestamp, could 'SeekAccurate(0)' have an override that always sets to the first frame rather than via a timestamp?
BTW when do you think you might do a new release that incorporates these fixes?
Regards
from flyleaf.
BTW, what does flConfig.Audio.FiltersEnabled = true; do? It fixed my issues!
from flyleaf.
People, were asking to support mainly Speed for audio that you can actually understand what they say. So, in v3.7.3 I've started to support FFmpeg audio filters but I had my doubts for both performance but mainly for timestamps. More or less the abuffersrc / abuffersink does not work properly with timestamps but with some workarounds now it became stable enough.
If you want to try some filters you can check those https://github.com/SuRGeoNix/Flyleaf/blob/master/Samples/FlyleafPlayer%20(WPF%20Control)%20(WPF)/MainWindow.xaml.cs#L102 for speed it will use atempo behind the scenes. For video, it is not clear from FFmpeg when it will download the frame from GPU to RAM and then re-upload it and I didn't want to lose the performance so I add the required/main filters directly in the renderer (eg. HFlip/VFlip lately).
Generally, you can check my demo with all the settings/configuration and mess around (eg enable/disable audio filters to see the difference eg. for Speed)
And for your issues, FiltersEnabled works because the simple approach with swr_convert does not currenly use min/max samples per frame and the AVI that you provide it was more than 1 second for each frame, which is really bad encoding. That's why the delays. Audio filters will split this single frame to multiple of 20-50ms frames.
I would use Filters for playing normal files / movies / youtube etc. to support also proper audio with speed and I would disable them for Cameras / Live streams as it is more important to focus on accurate AV sync as it can have a lot of gaps. This is probably not true anymore, I have not done much testing. I think audio with filters will work better in most cases and I might need to turn it on by default.
To go in the beginning of the file use Seek(0) which will be handled differently than normal Seek (not need to SeekAccurate) it will Seek at the exact first timestamp of the demuxer, however when no timestamps are provided you cannot guess, it is a bad encoding.
PS: I will do some testing and later today I will have a new release
from flyleaf.
@davsun55 NuGet is ready, I've fixed also the WMA
from flyleaf.
from flyleaf.
Related Issues (20)
- Flyleafhost: Overlap & Transparency HOT 4
- There is a small black dot when FlyleafHost is initialized With Collapsed
- WinUI Memory Leak & Possible Fix HOT 1
- Overlays / Stats HOT 2
- Brilliant library, but I'm struggling with limited doco... HOT 12
- ShowFrame(0) does not work anymore in 3.7.42 HOT 3
- How can I tell if a file stream has a valid/playable audio and/or video stream? HOT 1
- Hello, may I ask how to play such data? HOT 2
- Unable to trap attempt to play an invalid video file HOT 3
- FlyLeaf libraries and DPI challenges HOT 7
- May I ask if it is possible to restore the function of resuming playback without reconnecting the old version after interrupting the stream? HOT 1
- System. AccessionViolationException when ShowFramePrev HOT 2
- When multiple players play the same file, the sound may be louder or softer HOT 1
- Play Delay HOT 1
- Play Delay HOT 9
- if i want to save i frames only how can i do? HOT 1
- To get thumbnail of the video on seek bar HOT 1
- How to send commands directly to FFMPEG engine while video is loaded and playing HOT 3
- about key redefine~ HOT 2
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 flyleaf.