Processing isn't loading videos - processing

I'm using Processing 4.0b7 (also tried with previous versions), and installed its Video Library. I have the following code (Im literally just trying to play a video):
import processing.video.*;
Movie video;
void setup() {
size(640, 480);
video = new Movie(this, "video.mp4");
video.play();
}
void draw() {
if (video.available()) {
video.read();
image(video, 0, 0);
}
}
I have "video.mp4" on a folder named data, on the same file as the sketch.
Whenever I try to run the code, I get the following error:
(java.exe:28748): GLib-CRITICAL **: 19:04:53.545: g_dir_open_with_errno: assertion 'wpath != NULL' failed
Cannot load GStreamer plugins from C:\Users\Estêvão\Documents\Processing\libraries\video\library\windows-amd64\gstreamer-1.0
Processing video library using bundled GStreamer 1.16.2
java.lang.IllegalArgumentException: No such Gstreamer factory: playbin
at org.freedesktop.gstreamer.ElementFactory.makeRawElement(ElementFactory.java:307)
at org.freedesktop.gstreamer.Element.makeRawElement(Element.java:104)
at org.freedesktop.gstreamer.elements.PlayBin.<init>(PlayBin.java:118)
at processing.video.Movie.initGStreamer(Unknown Source)
at processing.video.Movie.<init>(Unknown Source)
at ex5_2_1.setup(ex5_2_1.java:26)
at processing.core.PApplet.handleDraw(PApplet.java:2142)
at processing.awt.PSurfaceAWT$9.callDraw(PSurfaceAWT.java:1440)
at processing.core.PSurfaceNone$AnimationThread.run(PSurfaceNone.java:356)
RuntimeException: Could not load movie file video.mp4
RuntimeException: Could not load movie file video.mp4
RuntimeException: Could not load movie file video.mp4
I'm using Windows 11. I think the problem is coming from the library instalation, but I've asked for friends who have their video working to send me their Processing files, and I'm still getting the same problem. Also deleted everything Processing-related and reinstalled it several times, and I still can't get it to work. Other libraries such as sound are working.

I've finally solved the problem.
The sketch was on a folder with special characters. I had already changed the name of the folder, but I kept getting the same bug, so I assumed that wasn't the problem.
But well, my name has a special character as well, therefore, so does my username. Processing goes through the Windows user folder before getting to the sketch folder, and turns out that's what was making the program not work.
Thank you all for your help, anyways!

Unfortunately I won't have the time to debug this in detail (e.g. if it's something to do with special(unicode) characters in paths or something deeper within the processing-video library).
For now I suggest using an older version of Processing.
I can confirm the video library works on Windows 11 with Processing 3.5.4 and the Procecessing video 2.0 library (Thank you #cSharp for the helpful comments)
Update I can confirm you can use Processing video 2.1 with Processing 4.0b7 on Windows 11.
You would need to:
remove the current video library
unzip video.zip (link to video version 2.1 for Processing4 above)
restart Processing (if you had it open already)
You can run your code or Processing > Examples > Contributed Libraries > Video Library for Processing 4 > Movie > Loop to test.

Related

How to get a Qt-based app (such as the Media Player example) to play videos on Windows 10 [duplicate]

Using Qt Version 5.4.2
Error code returned : DirectShowPlayerService::doSetUrlSource: Unresolved error code 800c000d
A QML file has been written with the Video QML type as below. I have added the below in the project file (.pro)
Qt+= multimedia
Snippet of code as below in the QML file.
Video {
id: video
width : 800
height : 600
source : "Video.mp4"
MouseArea {
anchors.fill: parent
onClicked: {
video.play();
}
}
focus: true
Keys.onSpacePressed: video.playbackState == MediaPlayer.PlayingState ? video.pause() : video.play()
Keys.onLeftPressed: video.seek(video.position - 5000)
Keys.onRightPressed: video.seek(video.position + 5000)
}
Any pointers regarding this error would be helpful.
I faced the same issue, fixed it by:
changing
source: "file://D:/Temp/video/ccc.wmv"
to
source: "file:///D:/Temp/video/ccc.wmv"
as the message mentioned doSetUrlSource indicates may using the wrong URL.
Have you searched through the bug tracker? I found QTMOBILITY-1461, for example:
The default directshow filters on Windows7 are not enough for playback of the m4a file. It is not the AAC codec problem, but no filter to identify the m4a container.
The "K-Lite Codec Pack" provides "MPC - MP4 Splitter" filter which could be used to connect the m4a source to the Microsfot codec filter "Microsoft DTV-DVD Audio Decoder" to be able to play the file.
Windows Media Player 12 on Windows7 uses Media Foundation instead of DirectShow to play .m4a .m2ts, .mp4, and .mov formats (for other formats it uses DirectShow filters). This explains why we could not do it with the current directshow backend implementation for QMediaPlayer without a third-party filters.
We might consider adding Media Foundation support in the futrure, but for now you have to install third-party filter to have it work on Windows7.
So, installing the K-Lite Codec Pack might help.
You could also try the suggestions in this mailing list thread.
I think the problem is qml cannot play .mp4 file.
After I try .wmv file it is working fine.

App Inventor sharing files No Activity found to handle Intent { act=android.intent.action.SEND flg=0x1 (has clip) (has extras) }

I'm a beginner at App Inventor and I don't know what I'm doing wrong with the sharing component. I'm trying to share a sound file but it gives me the following error:
No Activity found to handle Intent { act=android.intent.action.SEND flg=0x1 (has clip) (has extras) }
The code is the following:
I also tried the following things:
This doesn't work.
This reproduces the sound perfectly. That means that the picker works and the file exists.
I put a file in my root folder and it works but I want to send the file which was picked from the list which is in the following folder "/storage/sdcard0/MyDocuments/Downloads/app_inventor_1431867799168.mpeg".
I don't know where is the problem and I look in a lot of forums and none of the solutions solved my problem.
Thanks for your help.
PD: I just found that the downloaded files are stored in .MPEG format which it is a compressed format. It is possible that sharing function don't find any app that accept this type of format. If this is the problem please tell me what I have to do to make App Inventor to not change the original .mp3 file.
ok, problem solved as I said in the PD part the problem was that by default App Inventor stores the audio files in to MPEG format. This format is not recognized by whatsapp, gmail, etc...
Solution was to set a name to each file when I download them that ends with .mp3
With this extention the programs of my device recognize them and now I can share my audio files.
Thanks to everyone that was trying to solve this problem.

Reading JPG into BitmapData in ActionScript 3 (JPG is inside APK file)

I'm using Adobe AIR to make APK file for my Android phone. Inside the APK package there is a SWF file and in the same folder as the SWF file there is a subfolder named "images", which contains image.jpg.
I'm trying to read that image.jpg into the program at runtime but can't get the location of it (the program doesn't seem to find it.
Here's what I'm trying:
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
loader.load(new URLRequest("images/image.jpg"));
while (bitmapData==null) {} //wait until loaded
return bitmapData;
The onComplete-function puts sets the bitmapData field. However, the COMPLETE event never happens so the while loop never exists.
I have also tried:
loader.load(new URLRequest("/images/image.jpg"));
loader.load(new URLRequest("app:/images/image.jpg"));
loader.load(new URLRequest("app-storage:/images/image.jpg"));
loader.load(new URLRequest("file:/images/image.jpg"));
None of it works.
I can't get this to work even when trying without the APK file, when only running the SWF file that is generated (the images subfolder is in the same folder as the SWF file).
I can't embed the JPG into the SWF file itself because I need to have a lot of image files and Flash CS6 runs out of memory when making such a big SWF file (reading the images externally would also mean a whole lot less compilation time).
Any ideas? How can I get put the external JPG file into BitmapData? Remember that the image is not outside of the APK file, it is packaged inside it.
Note: I'll also export the thing into a iOS ipa package later so it have to work there as well.
Edit because I can't self-answer due to my reputation.
Strille made me realize that the ActionScript Virtual Machine is single-threaded.
So it's impossible to make a thread sleep (wait) for an image being loaded. Instead I have to sigh rewrite a lot of code so that things are halted and continues when the onComplete function is called.
This thing that I tried before actually works but couldn't complete due to the while loop:
loader.load(new URLRequest("app:/images/image.jpg"));
If I remember correctly, you should be able to do it like this:
loader.load(new URLRequest(new File("app:/images/image.jpg").url));
Since we're using the File class, the above will not run in the Flash Player, just on iOS or Android.
From my experience there are two practical methods to load assets from a running Android APP using AIR
using URLLoader and .url property of the File instance
using FileStream (which receives a File instance)
Adding to project
You can package the files inside the APK using
the same technique as packaging ICONS, inside the .xml descriptor file for your app.
And make sure you add those to your IDE in the Android section (applies to IntelliJ and Flash Builder) "Files and folders to package"
- add the path to your wanted assets folder, and give it a relative name alias.
Elaboration
The assets themselves are placed (when the APP is installed),
inside the ''applicationDirectory'' which is available for AIR,
Yet since newer Android OS's, and Flash player security issues,
it is not possible to access those assets via the nativePath,
only the 'url' property of the File instance.
Best Practice
Use URLLoader and .url property of the File instance,
as it is also Asynchronous by nature and can resolve PNG / JPG files
using native decoder instead of having to do this manually
reading a FileStream (which returns a a ByteArray)
var f:File = File.applicationDirectory.resolvePath('images/myimage.png');
loader.load(new URLRequest(f.url));
and,
If I'm missing more ways, please let know... )

Refernce or link doesn't work in Flowplayer captions plugin

I'm working with Flowplayer captions plugin http://flowplayer.org/demos/plugins/flash/captions.html and I need references/links in subtitles. When I've built into srt file link like click this link to flowplayer.org
then the flowplayer stuck on parse processing and last message was only
org.flowplayer.captions::Caption : captions file loaded, parsing cuepoints
Please prompt me how to resolve this problem. Thanks
I've resolved this problem by commented out some piece of code in source code. This code checks for XML subtitle format and fails when it reads linked html code.

How do I load an image using SDL and Xcode on OS X 10.5?

Edit: After using a bmp at toastie's suggestion, I'm still having problems loading the image:
I'm using SDL and OpenGL with Xcode and I'm trying to load an image to use as a texture on a cube. The image is a 256x256 RBG jpeg. The image is in the same directory as all of my source code, and it's under the Resources folder in the Xcode project. The file is named texture.bmp
if (textureSurface = SDL_LoadBMP("texture.bmp"))
{
// ...
}
else printf("%s", SDL_GetError());
I keep running it and getting the console error: Couldn't open texture.bmp
What is the path, or proper syntax for loading a file under these conditions?
SDL_LoadBMP only loads BMP files as its name would suggest :)
You will need another library to load other image formats.
Try SDL_image:
http://www.libsdl.org/projects/SDL_image/
or DevIL:
http://openil.sourceforge.net/
Or roll your own loader:
http://www.libpng.org/pub/png/libpng.html
Found the answer here. Essentially the image path is relative to the application being run, so I had to move the image or make the path relative to the debug build.
I don't have Xcode in front of me, but I think if you right/option click on the file in your resources listing to get at the preferences for the file you can set it to be relative to the project, containing directory, etc.

Resources