Closed GoogleCodeExporter closed 8 years ago
Thanks for the report. Could you help us isolate this to special characters in
file
name vs. space in file name:
1. Can you add a file.exists() test before calling playBin.setInputFile()
2. Can you rename your file to be without any special characters, but contain
one or
two space in its name
Original comment by tsha...@gmail.com
on 19 May 2010 at 6:31
With this sample code:
Gst.init("Test", args);
PlayBin playBin = new PlayBin("Test");
playBin.setVideoSink(ElementFactory.make("fakesink", "videosink"));
playBin.getBus().connect(new Bus.ERROR() {
@Override
public void errorMessage(GstObject arg0, int arg1, String arg2) {
System.out.println(arg2);
}
});
String fileName = "D:\\01-¿ Exorde Baratté _.ogg";
File file = new File(fileName);
if (file.exists()) {
System.out.println("File exists. uri=" + file.toURI());
playBin.setInputFile(file);
playBin.setState(State.PLAYING);
Gst.main();
playBin.setState(State.NULL);
} else {
System.out.println("File does not exists.");
}
Test 1: fileName = "D:\\01-¿ Exorde Baratté _.ogg" (specials chars and spaces)
Output: File exists. uri=file:/D:/01-¿%20Exorde%20Baratté%20_.ogg
Bus.ERROR(): Could not open file "D:\01-¿ Exorde Baratté _.ogg" for reading.
No Playback.
Test 2: fileName = "D:\\01- Exorde Baratt.ogg" (no specials chars, spaces)
Output: File exists. uri=file:/D:/01-%20Exorde%20Baratt.ogg
Bus.ERROR(): Nothing.
Playback Ok.
Test 3: fileName = "D:\\01-¿ExordeBaratté_.ogg" (specials chars, no spaces)
Output: File exists. uri=file:/D:/01-¿ExordeBaratté_.ogg
Bus.ERROR(): Could not open file "D:\01-¿ExordeBaratté_.ogg" for reading.
No playback.
So it seems to only be related to special characters. I did a lot of tests
yesterday,
i may have been confused. The thing is that if you try my workaround (using
URLEncoder.encode()) without replacing "+" by "%20", test 3 (specials chars, no
spaces) works well. So i believe GStreamer expects URI where special characters
are
properly encoded and spaces are encoded as %20.
Hope this help !
Original comment by J.Devauc...@gmail.com
on 19 May 2010 at 12:11
One more thing, i said that another application using GStreamer plays the file,
but i
did not look how it handles this case. The facts are this application
(Clementine
Music Player, http://code.google.com/p/clementine-player/) uses GStreamer, does
not
use GStreamer-Java, and plays this file, but it can have some tricky code to
handle
this. So it could be a GStreamer issue.
Original comment by J.Devauc...@gmail.com
on 19 May 2010 at 12:23
does a simple java code contains:
new File("D:\\01-¿ Exorde Baratté _.ogg")
can read the file on windows?
if not then it has nothing to do with gstreamer-java, but java on windows.
Original comment by lfar...@gmail.com
on 27 May 2010 at 4:32
imho it has nothing to do with gstreamer-java since it's a simple java problem.
Original comment by lfar...@gmail.com
on 28 May 2010 at 7:59
Hu? PlayBin has a method setInputFile(File), i give it a perfectly valid File
instance and it does not work...
Anyway, apart from the workaround i gave in my first comment, i do not have a
better
solution, do you have a better suggestion ?
Original comment by J.Devauc...@gmail.com
on 28 May 2010 at 10:25
try running your application with system property -Djna.encoding=utf-8
Original comment by tsha...@gmail.com
on 15 Jun 2010 at 9:47
It works! Many thanks for pointing this out.
Thanks for your work on gstreamer-java.
Original comment by J.Devauc...@gmail.com
on 15 Jun 2010 at 11:12
Original issue reported on code.google.com by
J.Devauc...@gmail.com
on 18 May 2010 at 11:35