Giter Site home page Giter Site logo

Comments (14)

SuRGeoNix avatar SuRGeoNix commented on June 4, 2024

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.

davsun55 avatar davsun55 commented on June 4, 2024

from flyleaf.

SuRGeoNix avatar SuRGeoNix commented on June 4, 2024

@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.

davsun55 avatar davsun55 commented on June 4, 2024

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.

SuRGeoNix avatar SuRGeoNix commented on June 4, 2024

@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.

SuRGeoNix avatar SuRGeoNix commented on June 4, 2024

@davsun55 Please re-test when you can with the latest fixes and let me know if you still have issues

from flyleaf.

davsun55 avatar davsun55 commented on June 4, 2024

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.

davsun55 avatar davsun55 commented on June 4, 2024

BTW TogglePlayPause() works perfectly on all the audio streams

from flyleaf.

SuRGeoNix avatar SuRGeoNix commented on June 4, 2024

@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.

davsun55 avatar davsun55 commented on June 4, 2024

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.

davsun55 avatar davsun55 commented on June 4, 2024

BTW, what does flConfig.Audio.FiltersEnabled = true; do? It fixed my issues!

from flyleaf.

SuRGeoNix avatar SuRGeoNix commented on June 4, 2024

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.

SuRGeoNix avatar SuRGeoNix commented on June 4, 2024

@davsun55 NuGet is ready, I've fixed also the WMA

from flyleaf.

davsun55 avatar davsun55 commented on June 4, 2024

from flyleaf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.