Media Foundation playlist plays only the first file from the playlist - ms-media-foundation

I'm using IMFSequencerSource for creating a cut-list of media files. I'm also handling the MENewPresentation for queuing the next file. All return values are S_OK.But, when the first file ends, there is no output on the screen. I can see the HDD is still active and the reading is still in progress, but not a single frame on the screen.
Here is a few events from the Invoke() method:
MEEndOfPresentationSegment
MF_TOPOSTATUS_ENDED
MESessionNotifyPresentationTime
MF_TOPOSTATUS_SINK_SWITCHED
MF_TOPOSTATUS_READY
MF_TOPOSTATUS_STARTED_SOURCE
So, it seems like the sink is switched and the new source started, but why there are no frames on the screen?

The problem occurs ONLY when I put two file with the same format back to back. So, I guess it's a bug in MS super-super new technology.

Related

firebase doesn't showing realtime data inserting and not able to remove data [duplicate]

Read-only & non-realtime mode activated to improve browser performance
Message pops up in my project and I'm unable to delete the nodes as well
Also I read this https://groups.google.com/forum/#!topic/firebase-talk/qLxZCI8i47s
Which states :
If you have a lot of nodes in your Firebase (say thousands), we need to create a new element for each node and modern browsers simply have limitations of how many DOM elements you can add to a page
It says:
To resolve this problem, don't load your Firebase Dashboard at the root of your Firebase, but instead load it lower down in the hierarchy
I do not get what it means
How do I get back to my Realtime Dashboard?
If you want to delete a high level node when this is activated, I recommend doing this.
Open up a text editor and type in { }. Save this file as "blankJSON.json".
Go to high level node you want deleted and select it, once it opens up and shows you all the nodes that need to be removed, select the three bars at the top right and select "Import JSON", (It would be safe to first "Export JSON" If you don't have backups, in case you make a mistake here). Import the JSON file we created earlier titled "blankJSON".
This will delete all of the data inside.
Once again, I highly suggest you make a backup before doing this, It's extremely easy to make a backup and also it is much easier than you would think to upload this blankJSON to the wrong node and then erasing a bunch of important data.
When it detects that it's downloading too many nodes from your database, the Firebase Console stops using real-time mode and switches to read-only mode. In this mode it requires less work from the browser, so it is more likely that the browser will stay performant.
To get back to realtime mode, you have to go to a location that has fewer nodes. So say that you start loading the database at the root, that means that "pseudo address bar" at the top of the data tree will say:
https://<your-project>.firebaseio.com/
And then will show the list of items. Now click on the URL in that pseudo address bar and change it to:
https://<your-project>.firebaseio.com/<one-of-your-keys>
And hit enter. The data tree will reload with just the node from one-of-your-keys and down and will likely switch to realtime mode again.
Every node key in firebase is a link, you can open a sub-node in a new tab and then edit that sub-node and its children.
Right click on a sub-node you want to edit or delete
Select open link in a new tab
Edit the sub-node in the new tab
1) Click on the Node you want to mass delete
2) Import an empty .json file (just containing curly braces, {} )
3) The node value will be set to null, in other words it is deleted or rather overridden with an empty node!
What you can do is to have an OnClickListener and call the remove value method to your DatabaseReference, like this:
mCart.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
mDatabaseReference.removeValue();
}
});
I have the same problem... I'm a bit surprised because I though Firebase could easily scale to support huge amount of data (example million users, etc.).
I have a node with 80000 sub-nodes (each object has his own push-id) and I cannot delete or perform any action on it because the real-time doesn't work in Firebase console.
I think the only way to udate or delete the data it's to do it via JAVA code :(
Multiple times trying to load the specific keys can be tiresome. There is a python library that could do this for you easily.
http://ozgur.github.io/python-firebase/
I needed to delete a lot of keys and this helped me do that in one go.
What I do is export the entire tree, edit/add the node I want using an editor, then import the JSON and overwrite the previous node/tree. Problem solved! Risky though 😁

How to simulate paste(CTRL + V) using AUTO IT in Word Document

Objectives -
Open the target app using AutoIy
Take a printscreen (ALT + PRTSCREEN) of the opened app(step 1)
Open a new word document
Paste the screenshot on word document
Issue:
I am able to complete the first two step, however I am not able to paste the screenshot in Word document.
Root Cause
I am able to take the print screen using SEND ("!{PRINTSCREEN}") and open word document using UDF _WORD_DOCADD, but I am not able to paste from clipboard. The issue is, when I am using WinWaitActive to activate the document, the document is still not active and hence SEND ("^V") is not working.
You are using Send incorrectly to send the Ctrl+V. With a capitol V, it will be interpreted by AutoIt as Ctrl+Shift+V (see helpfile for details). Instead what you want to use is Send("^v").
WinWaitActive does not activate the document, it simply waits for it to become active, use WinActivate to activate word.
The correct way to paste though is to use the word com object, something like: $oWord.Activedocument.Range.paste. That will work without word being active or visible.
Also, there are better ways to screenshot than sending Alt+Printscreen.
All these steps are very well documented, and have been done many times before.
I found a way to solve my problem. Steps followed are -
Simulate ALT + PRNTSCRN
Open Clipboard
GetData from Clipboard as BITMAP
Save the data as JPG using GDIPLUS_IMAGE_SAVETOFILE
Use DOCADD to open new document and _Word_DocPictureAdd to save the image to word document.

Lua socket: why doesn't socket.http.request download entire html code of a page?

I want to download to a Lua string the entire html code of this web page. The problem is that the saved code skips some lines that are visible on Google Chrome when I use Inspect Elements command (right click on webpage, last option).
I need that lines because I want to use the informations written there, to be precise I want to catch the card prices.
The code used is simply:
-- loads the HTTP module and any libraries it requires
local http = require("socket.http")
-- Lua socket --
b, c, h = http.request("http://magiccards.info/roe/en/4.html")
print(b)
How can I solve it?
Probably some of the elements on the page are created after the main document loads, either by Javascript DOM operations, or AJAX queries which fill up the missing parts. You could look if these scripts are indeed downloaded and then run them locally using some embedded engine like V8.

Downloading multiple files from one Gridview row asp.net C#

I have an application that downloads files from within a gridview. When a single file is attached to a row I can easily download the files but when I try to have multiple files within a row my application can no longer download. Could anybody possibly suggest a way I could accomplish this?
Thanks in advance
When user click and as to download a file you can give this javacript command
window.location = "FileForDownload.jpg";
If you won to give the user the ability to download more than one files is more complicate.
Firs you must need to know that the browser will alert that action and stop it until user accept the multiple downloads.
Now you could easy say that you can send many files at window.location but if this happens with out synchronization then the one file can stop the other. The synchronization here can be done with this trick of cookies and give the command the second download only after the first have been start (or end).
One more solution is to call the window.open("FileForDownload.jpg"); many times (with a timer delay of course) that is not need synchronization.
This is a general idea in javascript, but need some improvement to open the files with a delay.
function DownloadAllFiles()
{
for (var i=0; i< arguments.length; i++){
window.open( "http://www.domain.com/downloadpath/" + arguments[i]);)
}
}
// example of call
DownloadAllFiles("File1.zip","File2.zip","File3.zip");

Flex: Dynamically create a preview image for a video

I'm using the VideoDisplay to play flv's, mov's, and mp4's and everything is working great. They are all being loaded via progressive download and are not being streamed. What I'd like to do is to grab a single specified frame (like whatever is being shown at the 10 second mark), convert it to a bitmap and use that bitmap as the preview image for the video. I'd like to do this at runtime so I don't have to create a preview image for every video that would be shown.
Any idea's on how to do this? I'd rather not fake it by playing it - seeking for that specific frame and then pausing it but I may have no other choice?
Ryan and James are correct -- the right way's probably to extract frames at upload/transcode-time. But if that's not an option, you could opt for using some sort of a default/placeholder image of your own (something generic or somehow suitable for all videos whose thumbs haven't yet been captured), and just use VideoDisplay's DisplayObject-ness to grab and then upload a frame to your server, e.g.:
<mx:Script>
<![CDATA[
var captured:Boolean;
private function creationCompleteHandler(event:Event):void
{
videoDisplay.source = "http://yourserver/yourvideo.flv";
}
private function videoDisplay_playheadUpdate(event:VideoEvent):void
{
if (!captured && videoDisplay.playheadTime >= 10)
capture();
}
private function capture():void
{
var bmpData:BitmapData = new BitmapData(videoDisplay.width, videoDisplay.height);
bmpData.draw(videoDisplay);
captured = true;
// Now just upload the byte array to your server for the next user
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.BINARY;
// ... etc.
}
]]>
</mx:Script>
<mx:VideoDisplay id="videoDisplay" playheadUpdate="videoDisplay_playheadUpdate(event)" />
Again, it's perhaps not the most elegant solution, but it certainly works. This way, the first user sees the generic image, but every user thereafter gets the generated thumbnail. (Which, of course, you'll have uploaded and properly associated by then.) Make sense?
I'm pretty sure this isn't possible. It may well be... but don't think so. I think the only way to load in video is to use the NetStream and NetConnection object, which as you know just kicks off the loading of the video.
If this is user generated video i think the best bet is to have some serever side script that generates the preview image. Have no idea how this is done but think this is how most clip sites work.
If all the videos are in your control it may be possible to write a script for one of the video editing programs to automate generating the image for a specific frame from a list of files. I think this is probably your best route as alternative that you could get up and running quickly.
Sorry for the vague answer... it may point you in the right direction if you need a quick solution.
I agree with James, the only way to really do this would be to do it with a server side script and pull certain frames out of the video. Even if you could do this with flex, you really would not want to put the burden to do this (which would be processor intensive I would think) on the client machine. Not to mention it will be much more efficient to create the image before hand than to have flex determine the thumbnail to show every time it is loaded.

Resources