3

I am working on a project that is about making a video player with built in libraries.

What I want to do is create a custom video player in Flash CS5, Python (Using Phonon) or C# which can play any video file (independent of the extension). The idea is that when I run my program, the video files that are embedded in the complied .exe will be played.

Is there a way I can include the video file with the compiled .exe?

EDIT: the video files will be around 100 MB in size.

Abbas
  • 6,720
  • 4
  • 35
  • 49
Katherina
  • 2,153
  • 7
  • 26
  • 34
  • possible duplicate of [Python, How to make a Video File(Mpeg/avi etc) into an exe?](http://stackoverflow.com/questions/8721279/python-how-to-make-a-video-filempeg-avi-etc-into-an-exe) – wim Jan 19 '12 at 02:27

1 Answers1

2

Let me see if I understood your question correctly. I am assuming you want to embed a video file into a video player application that you are creating. The video can be on any type (.avi, .mp4, .flv) and the application will be an executable (.exe).

If this is the case then what you need to do is, using Visual Studio, add your video file as a resource in your project, rebuild the project and access the resource from your code.

For example, if you have added MyVideo.avi to your project, after building the project you can access it as MyNamespace.MyVideo.avi.

Here are a couple of SO posts that provide more concrete examples of embedded resources within a project:

Community
  • 1
  • 1
Abbas
  • 6,720
  • 4
  • 35
  • 49
  • Hi Thanks you for you kind answer, ill study the link you gave me. and give you a feedback later on. it may not be the same as what im thinking, but having it inside a resource file is not bad at all. – Katherina Jan 19 '12 at 03:16
  • Hi there again Abbas, regarding the Self-Extractor, Its almost exactly what i need, but i need to somehow tweak it a little, which is now my new problem, it successfully created the resource file, but when i run it, there's this dialog box that appears and asking me to chose which path i want it to be extracted, is there anyway i can automate this part? like extract it always on c:\ ? – Katherina Jan 19 '12 at 08:05
  • I am glad to help. How did you fix it? – Abbas Jan 20 '12 at 05:30
  • regarding the the extracting part? where i want it to be set on my desired directory path? if that is.. inside SelfExtractor.cs i just commented out the following, FolderBrowserDialog fbd = new FolderBrowserDialog(); then fbd.Description = "Please, select a destination folder."; then if (fbd.ShowDialog() == DialogResult.OK) then the { and } of that if statement. then i modified line 54 with this string path = Path.Combine("C:\\", Path.GetFileNameWithoutExtension(name)); // remove ".gz" – Katherina Jan 20 '12 at 05:44
  • I never really solved my main problem in embedding the files inside the .exe, but someone the one that you taught me is somewhat similar. the only thing i dont like about this is that the files is still being extracted. what i would wish to know is if we can run the program without extracting the files.. run it from the inside – Katherina Jan 20 '12 at 05:46
  • That's a useful solution. Please consider editing your question and adding your solution to the end so it can be of help to others with the same problem. – Abbas Jan 20 '12 at 05:48
  • I see you added running from within a zip file as a separate question, I will check it out. – Abbas Jan 20 '12 at 06:11