Multi-bitrate/dynamic rate for progressive FLV playback - apache-flex

Is there a way to get multi-bitrate playback working with progessive playback without having to download all versions of the file? People all coming up with all kinds of cool ways to make progressive feel like streaming. I wouldn't be surprised if there is also a hack for this. Any module names or reading resources that people in the know in this field can recommend?

I have a suggestion, more of a hack really.
I hope you have small clips in mind, otherwise it might get pretty slow for big files.
How about you have audio in a separate file(either flv with no video encoded or just plain mp3) and then your flv.
You load your flv, you play make 'screengrabs' at runtime using BitmapData's draw method and store them in a Vector/Array and that should be it. You can play them back at dynamic speeds,
As for the mp3, you'll next the change the pitch. Andre Michelle has a great article about that.
Is the pricing the issue in not streaming flvs? Red5 is opensource.

Related

Streaming audio in A-frame

I am building a multi-user experience in A-frame using NAF, and I have some positional audio containing music tracks in different points of the scene. I'm trying to figure out if it's possible to make it that the music is listened simultaneously by all the connected users. It is very important that they are positional, since I need several audio sources in the scene. At the moment, the tracks start when you enter the experience, so each person hears them from the start when they access the scene. This is the file that I'm using right now: https://glitch.com/~indigo-roomy-supermarket
I tried with the broadcast-component, but didn't manage. I thought of trying a workaround using a stream of twitch and hiding the video, trying to project it to a primitive, but also doesn't work so far (just managed to attach it to a div over the scene, I can hide the video but the audio would never be positional). Here the file where I tried it (not networked, but it should be the same): https://glitch.com/~twitchtest-01 I know that there's the option of connecting vimeo to a-frame using this: https://github.com/vimeo/aframe-vimeo-component but the audio itself is not positional, so it doesn't really solve my problem (also, I don't know if it would work with vimeo live).
If somebody knows a way to do this, I would greatly appreciate if you can share your wisdom. Thanks a lot!
I don't think that's easy.
Assuming you have streaming audio servers at your disposal like this then the way I would approach this, is:
fetch an audio stream and once the download returns, get the source buffer
override the source buffer of your positional audio element (something like this.el.getObject3D('sound').children[0].source.buffer) with the newly created audio buffer.
This might work.
If it doesn't, then create you own audio element component by using positional ThreeJS sound directly with setMediaStreamSource.
My assessment would be that this takes several days just to prototype alone. Having said that, I am pretty sure it's doable.

Adding Audio To FLV in ActionScript

I have an FLV without sound, and a sound file without video. Can I combine them using Actionscript? Where should I start?
yes you can, here are a couple of possibilities
1/you could use OSMF which gives you the possibility of playing elements in parallel. Check this video for an intro to OSMF
http://gotoandlearn.com/play.php?id=129
2/ Otherwise, here's a couple of tutorials about video & sound basics
http://gotoandlearn.com/play.php?id=61
http://gotoandlearn.com/play.php?id=61
then you should create a few functions to ensure that when you call play or stop both the video & audio play or stop together. this should be easy to implement after you've watched the tutorials

How can I seek to an exact point in a Flash video without a Flash Media Server?

Is the Flash Video (or Flex VideoDisplay) component capable of seeking to an exact moment in a video?
It seems to always 'snap' to keyframes (which is understandable). I'm just wondering if there are any mechanisms in the video classes for seeking to exact frames, ie it should do the translation from keyframe to specific frame in the background rather than having to actually play the video forward to the desired frame.
This is not a streaming file and has nothing to do with buffering. The player is just downloading a movie file from the web and playing it from memory.
Thanks!
You need a streaming media server to jump to an exact moment in the video.
Otherwise you are stuck using progressive downloading, which will download every moment between the first one, and the moment you want to jump to.
You do not need to use Flash Media Server, though. Red5 is an open source alternative.
I do not know specifics on the code needed to jump to a specific point, though.

Can I play a video backwards in AIR

I need to play a .mov file backwards in my Flex app. Some help??
Likely not possible.
Video files are simply not designed to play backwards (the compression takes advantage of forwards [and backwards] temporal information) - a decoder would have to be specially-coded for such a feature.
Perhaps use an external tool to reverse the video.
If Flex allows per-frame control, then you may be able to achieve some results (perhaps not good ones) by frame-stepping backwards from the end. Your mileage may vary.
One way to do it is to have the video on the timeline of a flash file (when you drag the video into flash it will give you the option).
then with actionscript you need to make sure the movieclip is paused and manually move the playhead of the currentframe backwards at about the frame rate of the movie.
it isn't trivial but it's possible.
Note that you won't have the sound working.
HTH.

Play flash one video on top of another?

I'm looking at a project that requires the ability to play one flash video over the top of another... sort of like an animated watermark, where the video on top has transparent regions ans may not be the same width/height as the one underneath.
Using Flash/Flex, can this be done in a web-app at real time? Or would you have to use an offline server app?
EDIT: This is not an HTML question. It's about making a simple video-editing kind of tool solely in Flex. Maybe I want to overlay a video of a galloping horse over a video of passing scenery or something. Ultimately, being able to output a single mixed video is useful, but for video editing that's too slow, real-time playback as the position of the overlay video is changed would be needed.
Hope this clarifies things somewhat?
Put the 2 videos on different layers inside your fla. The video files will have to be .flvs. Make sure the alpha channel is encoded in the video that's meant to go on top... this is done using your encoding program, like Flash Video Encoder. This is probably why it's not working for you right now.
I haven't done much flash work lately, but what I remember of flash (and I assume this is part of flex) you could draw in several files and place them on different levels, like a z-index.
If you need some sort of real-time keying or something of that nature, that is beyond my knowledge of flash.
You may be able to use CSS with z-indexing to do this through basic HTML/CSS means as well. But I would look to having flash do all the heavy lifting of layering, if you can.
I don't think you'll get such features,
Well, I am thinking, why you need to play flash files overlapped on each other .. If you want some water mark (static or Dynamic content), you can have it in a single flash file, you need not overlap the two files for that ..
Even if it was possible to make two flash files overlap on web-page, it is not recommended as good practice, because it needs lot of data to be transfered over to browser(in worst case, 2 files, so double the data), in-turn introducing more delay to load the page.. it is a degradation to your own web-page .. Instead try to merge files (image or flash) to save the amount of memory to be transfered via browser ..

Resources