-
Notifications
You must be signed in to change notification settings - Fork 245
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
Latest FFMPEG version is incompatible #642
Comments
You need to update also FFmpeg.AutoGen to the latest version which supports ffmpeg 6 (to date). But then it introduces few breaking changes on FFME. I'm trying to make this work and maybe try a pull request. |
I think you should fork this project and create a new nuget package since it seems that this package is not maintained anymore. |
I managed to make it work with net7 and ffmpeg6 (and using an updated autoffmpeg package). I could indeed make a nuget package, but I'm not sure I'll have time to maintain, support and expand what I did. |
I have updated to support for ffmpeg 5.1.2, .Net 6 and some of the deadlock-fixes in a fork. https://github.com/MrBean2016/ffmediaelement |
I've updated it to 6.0.0.0 |
Great work zgabi! I saw that you included the dead lock fixes as well. I test it right away |
I can't get custom media sources to work in this version. When you open, you get one single read, then an Access Violation in avformat_open_input. |
Could you please createa a small project to repoduce the issue? |
I'm reproducing it using the sample app with no modifications. If I play a file just using the path, it works. If I use the customfile:// prefix, it reads one buffer from my custom source, then crashes. |
Was it working in version 4.x in this way? It looks stange... Personally I don't thinkt that it should do anything when you put for example the customfile://C:\1\1.mkv string to the open box... I also have a custom source, and it works with the following class:
|
I don't know if it worked in 4.4; I'm new to this project. I came here to try to find a way to stream video from a custom source, which is oddly hard to find. |
Ahh, so this is a hack in the sample app... OK, I found it: ffmediaelement/Unosquare.FFME.Windows.Sample/AppCommands.cs Lines 55 to 58 in c7fe5ab
I don't know why is it not working. For me it works with the class I mentioned above. |
That class is not working for me either. Perhaps something wrong in the sample with how it gets initialized with a custom source? |
It seems that it works when the stream is not seeakable (CanSeek = false) |
That did it. I'm OK with that; my custom stream won't be able to seek. Thanks for the help. |
Curiously, it's still seeking, a lot, even though CanSeek is set to false. |
Yes.... Now I remember, probably this is an FFmpeg.AutoGen issue: So just remove the following 3 lines (2 + 1 empty) and it will work:
Since it is unnecessary to set the If you need it I can create a new zgabi.FFME.Windows nuget package with this fix. |
That depends. What are the ramifications of it thinking I can seek but I really can't? |
You can seek, since the seekable is set to 1 internally when the seek function is not null... the "mapping" is wrong in FFmpeg.Autogen. |
But I need to set Seek to null, and there doesn't appear to be a convenient way to do that. My source won't be able to seek. Having CanSeek null the function pointer would fix the issue in the avio_alloc_context call. |
@MrBean2016 I saw that you reverted the allignment bindings... I created my from from your fork, so I also have them. should I also remove it? I plan to create a new package with the seek fix. Edit: I found your comment at PR #632 , so I also removed it. |
Great work! |
@zgabi hi zgabi ,I used the above configuration to reduce the playback delay, but after playing for a while, the delay will become higher and higher. Is it a configuration parameter issue? How to solve this problem? |
@zgabi |
@SundayGoGo @seiim-master I think those problems are not related to the ffmpeg upgrade.... were they working with version 4.x? I only updtated this library to ffmpeg 6.0, so I don't know too much about the internals. Of course if you find a solution, I'll accept a PR and integrate to my nuget package version. |
@zgabi |
I think it would not be easy. I would rather not add an external reference. The problem shoud be fixed in this library, but I don't know how. Otherwiser if I refer the Flyleaf, it will use Winforms as you mentioned. I'd like to avoid it. |
@zgabi Thank you for your reply, it really has nothing to do with the ffmpeg version. |
It probably depends on several things. Are you trying to achieve smooth scrubbing? |
I don´t know of your z-order problem and maybe it is a bit OT but place the winformhost in a grid and specify the z-order. I suppose you know that the elements are rendered in the order they are declared if not the z-order is specified.
And If you think another library solves what you need, use it that instead! But investigate this first, only forward scrubbing is supported for now |
All this conversation is off topic and should be moved to another issue. |
Thank you for your advice. The zorder problem has been a method of using the existing FFME library and putting usercontrol on it, but when using flyleaf, the basic control cannot be put on the playback screen, and the zorder problem can be solved only by using the window. |
version 6.0 hangs randomly. (Heap memory corruption) |
They are found in /Common/MediaOptions.cs
You will also see how hardware acceleration is configured. |
You need to give more information, how to reproduce, sample code that generates the error. Post this as a new issue. |
zgabi.FFME.Windows@6.0.2 crashes after some I am already trying to approach the matter very carefully.
|
Could you please create a sample console application which is repdoducing the issue. Inclusing the media file (or the url if it is available online) |
If I add a call to the garbage collector, I can reproduce the crash. The first song plays without any problems, the second song crashes.
|
It worked until I closed the window. I'm using this dlls: https://goliat.eik.bme.hu/~zgabi/ffmpeg.x64.7z |
Hey zgabi, I have forked the FFmpeg-Builds to build the version 4.4 and the versions 6.0 and 6.1. Are you on .NET 8.0? |
Ok, I try them. My link... hmm.. I don't know what happened with that server (my old university is the provider)... now it works only with http for some reason,... http://goliat.eik.bme.hu/~zgabi/ffmpeg.x64.7z Yes, I'm on .net 8.0 I tried them: |
Hey zgabi, I have continued to test on it. |
Hi! |
remove setting of the seekable field, since it causes access violation errors, and unnecessary. Check the comment from june 6, 2023: unosquare#642 Or: Ruslan-B/FFmpeg.AutoGen#255 Currently I'm uusing my own package, but I'd liek to swicth your original version, but this issue block me. Reproduce the issue: Just open any local video file with the following url: customfile://C:\myfolder\myfile.mkv It will use the FileInputStream which sets the seekable field. => access violation when trying to open the media.
* remove setting of the seekable field remove setting of the seekable field, since it causes access violation errors, and unnecessary. Check the comment from june 6, 2023: #642 Or: Ruslan-B/FFmpeg.AutoGen#255 Currently I'm uusing my own package, but I'd liek to swicth your original version, but this issue block me. Reproduce the issue: Just open any local video file with the following url: customfile://C:\myfolder\myfile.mkv It will use the FileInputStream which sets the seekable field. => access violation when trying to open the media. * fix the hw acceleration * using fix
I was installing FFME for first time today and encountered an issue with linking to the correct version of ffmpeg. Just wanted to share my solution here.
I was trying to make the sample application work and no matter what I did it wouldn't recognize the path where ffmpeg was installed. After digging into the FFME code it appears that the version of the ffmpeg library files is hard coded in FFME (FFmpeg\FFLibrary.cs, line 68 public static FFLibrary LibAVCodec { get; } = new FFLibrary(Names.AVCodec, 58, 1); etc. For example here the 58 is the version of the library)
So with current version of FFME what you need to install is version 4.4 of ffmpeg. There is a more recent version of ffmpeg that has been released that will not work because all the library files have different version numbers.
Specifically, you want to install the full GPL (LGPL won't do because 2 dlls would be missing) shared version of ffmpeg 4.4, e.g. ffmpeg-n4.4-latest-win64-gpl-shared-4.4.zip, which you can find at https://github.com/BtbN/FFmpeg-Builds/releases
Note that I also tried the more expedient way of changing the library numbers directly in FFlibrary.cs. Unfortunately it then raises another error where it says it can't load the dll file. Am pretty sure the version number is hard coded a second time somewhere else in the code and one would need to go change that as well. At that point I couldn't bother and gave up trying to update FFME (also thinking about the possibility there is other code in FFME that may be incompatible with new ffmpeg version) and just went and found the correct ffmpeg version to use with this.
assume the FFME devs will update the code here at some point, but in meantime hope this helps someone.
The text was updated successfully, but these errors were encountered: