Skip to content
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

MediaInfo.Open works on windows but not on Ubuntu #33

Open
modmanx opened this issue Sep 4, 2021 · 8 comments
Open

MediaInfo.Open works on windows but not on Ubuntu #33

modmanx opened this issue Sep 4, 2021 · 8 comments
Labels

Comments

@modmanx
Copy link

modmanx commented Sep 4, 2021

Hello, I hope someone can help me out here :) I have pretty basic example, which works fine on Windows but not on Ubuntu 20.04. File does exist and I'm keep getting "No video streams in file" on Ubuntu without any error message. Is there a way how to figure out what's going on?

if (!System.IO.File.Exists(filename))
{
    return new { Error = "File does not exists" };
}

var mw1 = new MediaInfo.MediaInfo();
mw1.Option("ParseSpeed", "0");
mw1.Open(filename);            

var videostreamcount = mw1.CountGet(StreamKind.Video, 0);
if (videostreamcount > 0)
{
    var _height = mw1.Get(StreamKind.Video, 0, "Height");
    var _scanType = mw1.Get(StreamKind.Video, 0, "ScanType");
    var _isInterlaced = _scanType == "Interlaced";
    var _duration = mw1.Get(StreamKind.Video, 0, "Duration");
    return new { Height = _height, ScanType = _scanType, IsInterlaced = _isInterlaced, Duration = _duration };
}
else
{
    return new { Error = "No video streams in file" };
}
@yartat
Copy link
Owner

yartat commented Sep 4, 2021

Have you installed additional libraries specified in README file?
I've just run tests on Ubuntu 20.4 LTS

Debug: MediaInfo library was loaded. Handle=140138212771056 Version is MediaInfoLib - v21.03

In case use internal MediaInfo class you should validate Handle property. If it has a zero value the libmediainfo.so was not loaded.

@modmanx
Copy link
Author

modmanx commented Sep 4, 2021 via email

@yartat
Copy link
Owner

yartat commented Sep 5, 2021

Any news?

@modmanx
Copy link
Author

modmanx commented Sep 5, 2021

Hello, thank you for asking, I'm still running production workload. I did install libs but couldn't get it to run. Probably I need to restart server to load everything from scratch and not from memory.

@yartat yartat added the question label Apr 4, 2022
@910399614
Copy link

Hello, thank you for asking, I'm still running production workload. I did install libs but couldn't get it to run. Probably I need to restart server to load everything from scratch and not from memory.

Hello, I have the same problem as you. Did you find a solution?Thank you.

@squareballstudios
Copy link

squareballstudios commented Dec 12, 2022

This worked for me; needed to install libmediainfo0v5. Not part of the installation instructions. Got this from here: StefH/MediaInfo.DotNetWrapper#7

Uninstall official / downloaded versions

sudo apt remove --purge libmediainfo0v5 libzen0v5
sudo apt autoremove
sudo apt install libmediainfo-dev

@MichaelHochriegl
Copy link

I've got the same problem on Fedora 37.
My installed version of MediaInfoLib is v22.12 and the libs from the readme are the following versions:

Package zlib-1.2.12-5.fc37.x86_64 is already installed.
Package zlib-1.2.12-5.fc37.i686 is already installed.
Package curl-7.85.0-5.fc37.x86_64 is already installed.
Package libzen-0.4.40-1.fc37.x86_64 is already installed.
Package openssl-1:3.0.8-1.fc37.x86_64 is already installed.
Package libmms-0.6.4-18.fc37.x86_64 is already installed.

Any info on this? Or should I create a separate issue because I'm running on Fedora 37?

@drakiula
Copy link

drakiula commented Feb 24, 2023

This worked for me; needed to install libmediainfo0v5. Not part of the installation instructions. Got this from here: StefH/MediaInfo.DotNetWrapper#7

Uninstall official / downloaded versions

sudo apt remove --purge libmediainfo0v5 libzen0v5
sudo apt autoremove
sudo apt install libmediainfo-dev

This is working for me also, on Ubuntu 22.04.
It is still not 100% clear for me how DllImport is performing these lookups on Linux, not a .NET expert.
I was able to do some debugging with Jetbrains Rider,

NativeMethods.MediaInfo_New() 

was returning IntPtr.Zero at MediaInfo: 137.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants