6 Replies - 15886 Views - Last Post: 16 February 2012 - 08:03 AM Rate Topic: -----

#1 sumanthkumarch  Icon User is offline

  • New D.I.C Head

Reputation: -3
  • View blog
  • Posts: 7
  • Joined: 08-February 12

c# TO OPEN VIDEO FILE

Posted 16 February 2012 - 01:47 AM

I am working on C# 4.0

i want to open video file and video stream
//create empty AVI file
AviManager newFile = new AviManager("video_with_logo.avi", false);

//open video stream without logo
VideoStream oldStream = oldFile.GetVideoStream();


Errors:-
Error 1 The type or namespace name 'AviManager' could not be found (are you missing a using directive or an assembly reference

This post has been edited by Atli: 16 February 2012 - 02:12 AM
Reason for edit:: Added [code] tags.


Is This A Good Question/Topic? 0
  • +

Replies To: c# TO OPEN VIDEO FILE

#2 Atli  Icon User is offline

  • Enhance Your Calm
  • member icon

Reputation: 4238
  • View blog
  • Posts: 7,216
  • Joined: 08-June 10

Re: c# TO OPEN VIDEO FILE

Posted 16 February 2012 - 02:50 AM

The error message tells you exactly what the problem is: "The type or namespace 'AviManager' could not be found"

Where did you get this code from? It's referencing a AviManager class that your project doesn't seem to know about. Wherever that class comes from, you'll have to add a reference for it in your project if you want to work with it. (.NET is powerful, but not yet powerful enough to be able to just conjure up classes out of nowhere...)


Just for the record, like you were told in your other thread, we will not do your work for you. We expect you to do your own research and coding. We're happy to help you work out your problems, but simply stating what you are trying to do and posting two lines of code copied from some random website won't get you anything here.
Was This Post Helpful? 1
  • +
  • -

#3 sumanthkumarch  Icon User is offline

  • New D.I.C Head

Reputation: -3
  • View blog
  • Posts: 7
  • Joined: 08-February 12

Re: c# TO OPEN VIDEO FILE

Posted 16 February 2012 - 04:05 AM

private void button3_Click(object sender, EventArgs e)
        {
          

    //create empty AVI file
    AviManager newFile = new AviManager("video_with_logo.avi", false);

    //open video stream without logo
    VideoStream oldStream = oldFile.GetVideoStream();
    oldStream.GetFrameOpen();

    //open new video stream with the same format
    Bitmap bitmap = oldStream.GetBitmap(0);
    VideoStream newStream = newFile.AddVideoStream(true, oldStream.FrameRate, bitmap);

    //copy images an embed logo
    Graphics graphics;
    for (int n = 1; n<oldStream.CountFrames; n++) {
        bitmap = oldStream.GetBitmap(n);

        graphics = Graphics.FromImage(bitmap);
        graphics.DrawImage(logo, 5, 5);
        graphics.Dispose();

        newStream.AddFrame(bitmap);
    }

    //clean up
    newFile.Close();
    oldStream.GetFrameClose();
    oldFile.Close();
        }
    }
}


MY project is to hide any kind of gven file in a image and insert the image in to video and send an automated mail attachment from the application(using gmail account credentials at the back end).

i am done with hiding any file in a image and sending an automated mail. only point i am stuck is inserting image in video. i can manage that but i am exhausted searching for opeing a video file but all the google searches arre in regarding PLAyING VIDEO FILE(which i dnt want). i want to know what are the classes or lib functions used to open video file not for playin.


i did enough home work where some microsoft.DirectX.AudioVedio need to be instaleed for playing. i want to knw if there a process to open video file.




Before you act smart


YU PLEASE GOOGLE(HOW TO EDIT VIDEO FILE) there is no single aprroproate link

I DN KNW IF YOU REALLY HAVE ANSWER AND QUESTIONING MY ABILITY TO PROGRAM. IF YOU WANT I WILL THROW MY WHOLE PROJECT TO YOUR MAIL ID(with out video concept).


HOPE YOU WILL SAY SOME THING WHICH I DN KNW AND ITS USEFUL.

MOD EDIT: Added code tags. When posting code...USE CODE TAGS!!!

:code:

This post has been edited by JackOfAllTrades: 16 February 2012 - 04:29 AM

Was This Post Helpful? -3
  • +
  • -

#4 RexGrammer  Icon User is offline

  • Coding Dynamo
  • member icon

Reputation: 183
  • View blog
  • Posts: 785
  • Joined: 27-October 11

Re: c# TO OPEN VIDEO FILE

Posted 16 February 2012 - 05:19 AM

Could you please spell the whole words. And stop using caps. And stop being rude. And start thinking. And try to google for it. If you don't know how to: read this tutorial. Thank you.

Take a look at this article, it should really provide you with everything you want to know: Audio Video Playback

EDIT: I forgot about this. Take a look at this DIC tutorial on adding video to a project: Adding Video to an Application

This post has been edited by RexGrammer: 16 February 2012 - 05:42 AM

Was This Post Helpful? 1
  • +
  • -

#5 Atli  Icon User is offline

  • Enhance Your Calm
  • member icon

Reputation: 4238
  • View blog
  • Posts: 7,216
  • Joined: 08-June 10

Re: c# TO OPEN VIDEO FILE

Posted 16 February 2012 - 05:43 AM

View Postsumanthkumarch, on 16 February 2012 - 11:05 AM, said:

YU PLEASE GOOGLE(HOW TO EDIT VIDEO FILE) there is no single aprroproate link

That's a pretty poor search term for what you are after. It gives you some 138 million results. There is just no way that not one of them will be helpful. - You need to refine the search if you want something useful to pop up; to tell Google in less vague terms what you want it to find. (The tutorial RexGrammer linked to should help with that.)

View Postsumanthkumarch, on 16 February 2012 - 11:05 AM, said:

I DN KNW IF YOU REALLY HAVE ANSWER AND QUESTIONING MY ABILITY TO PROGRAM. IF YOU WANT I WILL THROW MY WHOLE PROJECT TO YOUR MAIL ID(with out video concept).

I don't question your ability to program. I have no idea who you are or what you are capable of. All I had to judge your abilities on was that one line project requirement, those two copied lines of code, and the error message. - And seeing as that error message, and the solution for it, is at a fairly basic level, I have no choice but to assume that your abilities don't exceed that. - I don't mean any offense by it. I just work with what you give me.

Also, I have no desire to go through your whole project. All we need to help you is the part of the code that is giving you trouble, and a DETAILED explanation of what's going wrong.

View Postsumanthkumarch, on 16 February 2012 - 11:05 AM, said:

HOPE YOU WILL SAY SOME THING WHICH I DN KNW AND ITS USEFUL.

OK. How about this: Don't yell at people if you want their help. A little professionalism goes a long way. - Also, most browsers (that don't use a blue "e" icon) include spell checkers.
Was This Post Helpful? 1
  • +
  • -

#6 sumanthkumarch  Icon User is offline

  • New D.I.C Head

Reputation: -3
  • View blog
  • Posts: 7
  • Joined: 08-February 12

Re: c# TO OPEN VIDEO FILE

Posted 16 February 2012 - 06:37 AM

I am repeatedly saying i do not want to play a video thingy,thats just so so easy, i want to process a video file, so i got to open a file(video).


All your links are the on which i searched long back.they say how to embed video player using DirectX SDK. but i want to process a video so that in later stage i can embed an image which will some up my project as any file hidden in image and the master image is hidden in a video.


if there is no possibility please say that but do not place link sating how to play video in C# application.

anyways thank you for prompt response.
Was This Post Helpful? 0
  • +
  • -

#7 Atli  Icon User is offline

  • Enhance Your Calm
  • member icon

Reputation: 4238
  • View blog
  • Posts: 7,216
  • Joined: 08-June 10

Re: c# TO OPEN VIDEO FILE

Posted 16 February 2012 - 08:03 AM

I don't know of any .NET specific methods, but I've used FFmpeg in the past to convert videos via a C# application, and I noted an option to "attach" things to the output as an attachment stream. I'm not sure if the AVI container supports this, but a few others seem to.

To quote the FFmpeg documentation:

http://ffmpeg.org/ffmpeg.html said:

‘-attach filename (output)’

Add an attachment to the output file. This is supported by a few formats like Matroska for e.g. fonts used in rendering subtitles. Attachments are implemented as a specific type of stream, so this option will add a new stream to the file. It is then possible to use per-stream options on this stream in the usual way. Attachment streams created with this option will be created after all the other streams (i.e. those created with -map or automatic mappings).

Note that for Matroska you also have to set the mimetype metadata tag:

ffmpeg -i INPUT -attach DejaVuSans.ttf -metadata:s:2 mimetype=application/x-truetype-font out.mkv


(assuming that the attachment stream will be third in the output file).


‘-dump_attachment[:stream_specifier] filename (input,per-stream)’

Extract the matching attachment stream into a file named filename. If filename is empty, then the value of the filename metadata tag will be used.

E.g. to extract the first attachment to a file named ’out.ttf’:

ffmpeg -dump_attachment:t:0 out.ttf INPUT


To extract all attachments to files determined by the filename tag:

ffmpeg -dump_attachment:t "" INPUT


Technical note – attachments are implemented as codec extradata, so this option can actually be used to extract extradata from any stream, not just attachments.

Perhaps you can use this method to hide an image in your videos.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1