Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

vs & MonoDev ignore FFMPEG lib

Discussion in 'Scripting' started by OliverFromGER, Aug 15, 2014.

  1. OliverFromGER

    OliverFromGER

    Joined:
    Aug 15, 2014
    Posts:
    24
    Dear community,

    for my game i need to convert images into an videoformat. I found a tutorial [link] which sounds really easy. i downloaded the needed library "FFMPEG" from [here] (Version 2.2.5 libs only) and copied the dll's, xml's and the one exe file from the release folder into an empty folder in the game asset (included "AForge.Video.FFMPEG.dll" and "AForge.Video.FFMPEG.xml"!). i started visual studio 2012 but can only use

    AForge.video.directshow, AForge.video.kinect, AForge.video.VFW and AForge.video.Ximea and not FFMPEG ( all except FFMPEG :/ )
    I tried it with MonoDevelop, but there's the same problem.

    Now my question: Do i need to add more needed files into the Asset folder or is there another way to convert images into an video format, which works?

    If you need more information or pictures, don't hold back to ask me ;-)

    - Olli
     
  2. OliverFromGER

    OliverFromGER

    Joined:
    Aug 15, 2014
    Posts:
    24
    Hello again,

    today i tried to add the FFMPEG reference to the existing references in visual studio, but after a restart of unity (not vs!) the FFMPEG reference is not in the references anymore.
    Now, i made some pictures to better explain my problem. On the first picture, you can see the DLL's (FFMPEG too) in the Asset-Folder:


    Here you can see the VS-GUI where i tried to get the FFMPEG using directive:

    But i only get all other DLL's from the Asset-Folder, but not FFMPEG!

    Then i added the FFMPEG-reference in visual studio from the DLL-Folder in the Asset of my game project and the vs gui look like this:

    Look like it works, but in unity i get one error in both cases:
    Please help me
    - Olli
     
    Last edited: Aug 17, 2014
  3. Flipbookee

    Flipbookee

    Joined:
    Jun 2, 2012
    Posts:
    2,745
    In Unity you don't add references to other assemblies manually because Unity does that instead. Your changes to solution or projects made in IDE will get overwritten by Unity whenever a script, shader, text asset, or DLL library is added, removed, renamed, or moved in your Unity project.

    With that in mind all you have to do is to place the DLL's in your Assets folder (or a subfolder) and Unity will update the solution and projects with references to those libraries. Exe's are not libraries so no references to those will be created. Instead you should try to recompile the exe to a DLL library or just extract the functionality you want to use from exe's source code to your scripts so that you don't have to add the exe in Assets.
     
  4. OliverFromGER

    OliverFromGER

    Joined:
    Aug 15, 2014
    Posts:
    24
    First thank you for your help. The problem is, that i added the AForge.Video.FFMPEG.dll to the assets folder like the other dll's, but i can only use all dll's exepted the FFMPEG.dll. I see that the pictures doesn't work, i'll fix this.

    - Olli
     
  5. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Did you try to get in touch with the developers?
     
  6. OliverFromGER

    OliverFromGER

    Joined:
    Aug 15, 2014
    Posts:
    24
    No, i thought it's a problem with unity, because i tried it with different aforge data and versions. And if i add the library manually it works (in visual studio).
     
  7. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    There are tons of reasons why it can go wrong. It might be related to unsupported .Net versions or dependencies or ... . It might help to ask the developers what is different between that one and the others, as the others seem to work.
    I had a quick glance at the source code. It seems that the other libraries are managed c# while the FFMPEG one is a native C++ library.
     
  8. OliverFromGER

    OliverFromGER

    Joined:
    Aug 15, 2014
    Posts:
    24
    This can be the problem, but i can't find a version for C#.

    I'll get in touch with the developers or a forum for this theme.

    - Olli
     
  9. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    There is no C# version of FFMPEG as far as I know. There are a bunch of wrappers though, like that one.
     
  10. OliverFromGER

    OliverFromGER

    Joined:
    Aug 15, 2014
    Posts:
    24
    Okay. But is there another way to convert images in a video format?
     
  11. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    I can't help with that, sorry.
     
  12. OliverFromGER

    OliverFromGER

    Joined:
    Aug 15, 2014
    Posts:
    24
    Okay. Then i'll wait for an answer by the developers. Thanks!
     
  13. SnubbleJr

    SnubbleJr

    Joined:
    Dec 14, 2013
    Posts:
    2
    Any news on this? I've been looking around for fitting ffmpeg into Unity, and this method is the most promising by far.

    I have the same problem, each time I make a slight change to Unity, I have to reload all scripts in VS, and I get two things:

    - The dll is no longer found (in VS), so I have to re-add it in references (it's always sitting there in recent references, mocking me)

    - I'm informed of a build missmatch, not a big thing, but I always have to change the target cpu after each alteration in Unity, maybe a clue?

    And I get this: "The type or namespace name `AForge' could not be found. Are you missing a using directive or an assembly reference?"

    Slightly different, I see, maybe I've done something else wrong
     
  14. shmulik.pangolin

    shmulik.pangolin

    Joined:
    Nov 11, 2014
    Posts:
    12
    Any update regarding this problem? I'm stuck too
     
  15. Onsterion

    Onsterion

    Joined:
    Feb 21, 2014
    Posts:
    215
     
  16. nicepainkiller

    nicepainkiller

    Joined:
    Feb 28, 2014
    Posts:
    4
    anybody solves? I'm stuck too
     

    Attached Files:

    chuck666 likes this.
  17. Max-Bot

    Max-Bot

    Joined:
    Sep 25, 2013
    Posts:
    83
    Last edited: Nov 13, 2020
  18. Jeet_9811

    Jeet_9811

    Joined:
    May 6, 2014
    Posts:
    17
    I am still having the same problem. It's been a long time we still have this problem.
    Anyone from Unity likes to comment? I want to create videos at run time so can't use Unity video creator.
    "The type or namespace name 'FFMPEG' does not exist in the namespace 'AForge.Video' (are you missing an assembly reference?)"

    I have checked in both .Net 2.0 and 4.0 libraries.