Im trying to GetFrameFromVideo file but im getting exception error file not found:

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Chocolade
    New Member
    • Aug 2010
    • 69

    Im trying to GetFrameFromVideo file but im getting exception error file not found:

    Thats not the complete code but thats the line givem e the exception:



    Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Media;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.Devices;
    using System.Runtime.InteropServices;
    using Text_Adventure_Escape_The_Room;
    using DexterLib;
    using JockerSoft.Media;
    
    namespace Text_Adventure_Escape_The_Room
    {
        public partial class Form1 : Form
        {
            IMediaDet IMedia;
            ISampleGrabber grabb;
            SoundPlayer sp = new SoundPlayer(@"d:\door_closing2.wav");
            string Video_File_To_Play;
            string s;
            string inventory;
            char[] chars;
            int i=0;
            public Form1()
            {
                InitializeComponent();
                textBox1.Enabled = false;
                Video_File_To_Play = @"d:\lightnings3.avi";
                FrameGrabber.GetFrameFromVideo(Video_File_To_Play, 0.2d);

    The file exist 100% i did breakpoint and saw it checked my hard disk and im also using this file with a control i did long time ago on this project and display the file in picturebox and its working ok.

    But this line : FrameGrabber.Ge tFrameFromVideo (Video_File_To_ Play, 0.2d); give me the exception:

    Could not load file or assembly 'Interop.Dexter Lib, Version=1.0.0.0 , Culture=neutral , PublicKeyToken= 59345589f61c4f3 1' or one of its dependencies. The system cannot find the file specified.



    Im using .NET 4.0

    And windows 7 64bit

    In this project References i added : Interop.DexterL ib and JockerSoft.Medi a

    Maybe the Interop.DexterL ib need another version?



    This is the complete exception:



    Code:
    System.IO.FileNotFoundException was unhandled
      Message=Could not load file or assembly 'Interop.DexterLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=59345589f61c4f31' or one of its dependencies. The system cannot find the file specified.
      Source=JockerSoft.Media
      FileName=Interop.DexterLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=59345589f61c4f31
      FusionLog==== Pre-bind state information ===
    LOG: User = Chocolade-PC\Chocolade
    LOG: DisplayName = Interop.DexterLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=59345589f61c4f31
     (Fully-specified)
    LOG: Appbase = file:///D:/C-Sharp/Escape_The_Room_Game/Text_Adventure_Escape_The_Room/Text_Adventure_Escape_The_Room/bin/Debug/
    LOG: Initial PrivatePath = NULL
    Calling assembly : JockerSoft.Media, Version=1.0.0.1, Culture=neutral, PublicKeyToken=59345589f61c4f31.
    ===
    LOG: This bind starts in default load context.
    LOG: No application configuration file found.
    LOG: Using host configuration file: 
    LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
    LOG: Post-policy reference: Interop.DexterLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=59345589f61c4f31
    LOG: Attempting download of new URL file:///D:/C-Sharp/Escape_The_Room_Game/Text_Adventure_Escape_The_Room/Text_Adventure_Escape_The_Room/bin/Debug/Interop.DexterLib.DLL.
    LOG: Attempting download of new URL file:///D:/C-Sharp/Escape_The_Room_Game/Text_Adventure_Escape_The_Room/Text_Adventure_Escape_The_Room/bin/Debug/Interop.DexterLib/Interop.DexterLib.DLL.
    LOG: Attempting download of new URL file:///D:/C-Sharp/Escape_The_Room_Game/Text_Adventure_Escape_The_Room/Text_Adventure_Escape_The_Room/bin/Debug/Interop.DexterLib.EXE.
    LOG: Attempting download of new URL file:///D:/C-Sharp/Escape_The_Room_Game/Text_Adventure_Escape_The_Room/Text_Adventure_Escape_The_Room/bin/Debug/Interop.DexterLib/Interop.DexterLib.EXE.
    
      StackTrace:
           at JockerSoft.Media.FrameGrabber.GetFrameFromVideo(String videoFile, Double percentagePosition, Double& streamLength, Size target)
           at JockerSoft.Media.FrameGrabber.GetFrameFromVideo(String videoFile, Double percentagePosition)
           at Text_Adventure_Escape_The_Room.Form1..ctor() in D:\C-Sharp\Escape_The_Room_Game\Text_Adventure_Escape_The_Room\Text_Adventure_Escape_The_Room\Form1.cs:line 34
           at Text_Adventure_Escape_The_Room.Program.Main() in D:\C-Sharp\Escape_The_Room_Game\Text_Adventure_Escape_The_Room\Text_Adventure_Escape_The_Room\Program.cs:line 18
           at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
           at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
           at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()
      InnerException:



    Thanks.
    Last edited by Niheel; Jan 17 '11, 01:27 AM. Reason: added code tags to the exception
  • Samuel Jones
    New Member
    • Jan 2011
    • 48

    #2
    turn this line:
    Code:
    FrameGrabber.GetFrameFromVideo(Video_File_To_Play, 0.2d);
    into this:
    Code:
    if (System.IO.FileExists(Video_File_To_Play)
        FrameGrabber.GetFrameFromVideo(Video_File_To_Play, 0.2d);
    That just makes it fool-proof.

    Currently working on a solution.

    Comment

    • Samuel Jones
      New Member
      • Jan 2011
      • 48

      #3
      Try this way of doing it.
      The function was released by microsoft so it may implement easier.

      Ever wonder how to play videos in .NET? This article will show you how to use the managed DirectX 9 Video class to play avi video files.


      Otherwise im too unfamiliar with DexterLib to be of any help.

      Comment

      Working...