Is it possible with AIR to play a video while it is downloaded - apache-flex

The idea is download a video in parts (from different servers) but starting to play before video file is complete.
The issue is that VideoDisplay component doesn't read the video file if it is opened for writing and vice-versa: writing is impossible if VideoDisplay plays the video...

I know I may sound totally off-topic, but you should make sure you've properly considered video streaming thru Flash Media Server, Wowza or Red5 before you put that much effort in downloading a file in chunks. Just a thought..

What about having multiple parts of the video, so playing can begin as soon as first part gets downloaded. So the parts have to be concatenated somehow at client side.
(Additionally, if one's connection is insufficient, showing a loading symbol is fine.)

Open the file in Shared mode, if that is possible with Air. Mainstream OS's (Windows, Linux, MacOS) have this functionality built in.
Use two threads:
In thread 1 (the downloader thread) open the file in Shared mode to allow reading from other threads and processes.
In thread 2 (the player thread) open the file in Shared mode to allow reading and writing from other threads and processes.
Be sure to buffer the beginning of the file so your player will always have something to play and won't choke while playing an incomplete file.

Related

Demultiplexing QuickTime MOV files for DirectShow

I'm working on a small project involving QuickTime media files (*.mov) playback. It's a simple output to specialized video card I have in my university lab. The only supported by manufacturer way to work with this video card in Windows OS is to use DirectShow filters. But since I have to use QuickTime video files as stream source I encounter the problem with DirectShow. I can't find any way to demultiplex a source file. There is no problem extracting an audio stream from a QT file but I can not find any demultiplexer which can actually split a video stream from it.
So far I tried Haali Splitter which were recommended for *.mov files by one of my professors but it's unable to correctly split a QuickTime file in to audio and video streams. Is there any other alternatives? Preferably free or open source since while I'm ready to spend a bit on buying QickTime source or slitter filter most of what I found are ridiculously expensive.
I also found the filter developed by River Past which can work as DirectShow filter source. But for some reason while it's working fine with WMP and GraphEdit it refuses to work at all when I'm trying to use it with my program or even in 3rd party graph editing tools. It's just throwing "UNSPECIFIED ERROR" which doesn't make any sense. And GraphEditPlus can't even load this particular filter for some reason. So apparently this filter has some kind of mechanism preventing it's usage with anything else but original Micrisoft GraphEdig and WMP.
And is there any kind of description of QickTime MOV file format? I was thinking about trying to write my own demultiplexer but unable to find any complete documentation describing this format.
Try the MP4 demux filter at http://gdcl.co.uk/mpeg4. It works with many/most MOV files and is open source.
G

What is the best tool to make a CD-ROM Demo Application?

I have to make an application that will do the following:
Open a video file embedded in the application
Open some pdf files, preferably embedded in the application, but if it will have to open externally, it's no problem.
Work in fullscreen on the user computer, with a minimum resolution of 1024x768. I'm thinking about a resolution of 1024x768, centered on a black background.
I was thinking of using Flash, but I don't have much experience, so if there is another easier IDE that creates a Flash application, I would prefer that.
So, if anyone knows any Flash component to do this, I'll be very thankful.
Creating a Flash CDROM takes a little bit of care, but from my experience it's well worth it. From your requirements, the Flash IDE is well up to the task. The common requirements are as follows:
Windows / Mac platform
Flash Projector file
Autorun file (For the Windows platform)
Net access or all local
If your client is happy with creating the CDROM just for Windows, there will be very few dramas - but if they want to create a Mac-friendly version, you can do that too and I will explain afterwards.
Your Flash should preferably be an .exe projector file - the reason for this is so that the Windows user can open your app without downloading a Flash player (If the client wants a CDROM, they probably have limited net access, so this is a good thing!)
Within Flash, you can perform all your standard fs commands including full-screen.
You will likely need an Autorun file so that the user sees your application as soon as you put in the CDROM - simply create a file named 'autorun.inf' in notepad and enter the following:
[autorun]
open=yourProjector.exe
Where 'yourProjector.exe' is the name and path of your projector file.
It sounds like you're going to embed your videos and content in the CDROM - this is usually the ideal case, since your client won't receive annoying security messages, but this can also be a bad thing if you want to correct your content later (spotting errors after a thousand CDROMS have been distributed can be a PAIN).
You can serve some of your content online to avoid this, but it would give your user some ugly messages, so as long as you triple-check your content and embed everything, it would be the best scenario.
Now for a Mac, Apple has done away with autorun features years ago - there is a way to turn it on through Quicktime, but this is off by default for almost all Mac users, and turning it on is not recommended because it makes the Mac vulnerable to the 'Hong Kong Virus', one of the few Mac viruses around.
You can make your CDROM mac-friendly by creating a Mac Projector and adding instructions for how to use it by changing the background image of the CDROM window. I haven't had to do it before, but I hear that it's not too difficult.
You can use the Flash Projector. Here is a tutorial to get you started. Now, you won't be able to embed the PDF files but you can open them easily enough using fscommand("exec","foo.pdf")
You can create an Adobe AIR Application; however it won't run off the CD ROM; it'll need to be installed locally.
If creating a projector from Flash Pro doesn't work; look at a tool like Janus or Zinc

Is it possible to open incomplete video-file for playback using directshow?

Is it possible to open incomplete video-files for playback using directshow?
The current solution first downloads the video file (.avi-container, can be h.264, mpeg2, mpeg4) and then starts playback. This can of course be a rather lengty operation.
The downloader fetches the videofile in chunks from a database so in theory it should be possible to open the file during download.
Is it possible to create a Directshow graph that can start the playback during download even if the file is incomplete when playback starts?
The software is written in C++ both server/client.
Thanks,
at the least http://en.wikipedia.org/wiki/VLC_media_player#cite_note-12 will probably do it...
As far as I'm aware, though, you should be able to start the graph as soon as the file exists...as long as it doesn't reach the end during playback while the file hasn't been written yet.
Or are you looking for some filter that will "wait patiently" before replaying?

After working for years, videos in my Flex Application won't play, just "buffering"

An application I wrote for a client almost 2 years ago using Flex 2 has stopped playing the .flv videos. It's been nearly 9 months since I've had to perform any updates to the app, so I don't have the source code on the computer I'm using at the moment. I'm not sure how often the client uses the application, so I can't say exactly when this started.
The videos just displays a black screen, does not load the first frame. I believe I used standard VideoDisplay object. The videos are contained in a folder on the same shared account as the application.
I've checked the application in latest versions of IE, Firefox and Chrome (running Flash 10) and I've also fired up a virtual machine to test it out in IE 7 with various releases of Flash 9 instead of Flash 10.
I checked, and the videos are still present, and I scattered some extra no-security cross-domain files around... but to no avail.
Does anyone have an ideas as to where I should start looking when I get back to my development computer? Could a change on the hosted server cause this?
UPDATE: I remembered another application with video that I had on the site that was made more recently using Flex 2. This application is a simple shell VideoDisplay object that serves up a .flv file in the same directory... and it works just fine.
So, the server is serving .flv files. The application I'm having problems with pulls .flv files from a different folder that is at the same level of the applications parent folder (the only difference I can see right now).
The someone cryptic error message received when using the debugging version of the Flash player was:
Error: 1000: No bitrate match
at mx.controls.videoClasses::VideoPlayer/play()
After getting back to my development machine I was able to determine that the XML file containing the URLs of the videos showed an old variant of the domain name that was in use a couple of years ago. This domain name was just allowed to expire, and so, the video player was pointing to .flv filenames no longer existed. Correcting the domain name resolved the problem.
You said the videos are still present, but are the being served?
A small hosting configuration change might cause files to no longer be served.
I would start there, you rule out that both your swf, and flv are accessible by the client browsers..
If it's on a new server, make sure it's serving the right mime type for .flv files, video/x-flv. I've had flash refuse to play videos without that set. Also, IIS now gives bogus 404 errors on requests to files of unknown mime type, so files can be on the servers, but invisible to clients. http://it.toolbox.com/blogs/rymoore/adding-flv-mime-type-in-iis-4198

Displaying a jpeg from a URL in labview

I need to make a labview VI that will display a jpeg image from a URL. (the url is generated based on some data)
I've found a way to display an image from the hard drive (Read JPEG File), so what I probably need is just a way to download it to a temporary file.
All I've found are some low level TCP client VI's. Is there an easier way? If there isn't I can just open a browser window, but I'd rather not.
Have a look at this LAVA post, titled Downloading an image from a Web server using Datasocket.
The only disadvantage is that it is not cross-platform, it will only work on Windows, on Linux I have seen this code killing LabVIEW.
The OpenG Internet Connectivity toolkit has code that is cross-platform.
Ton

Resources