I'm looking for fellow users, who are using Xuggler to produce video encoded with Theora. I've tried a lot of different options to get "good" quality using presets to no avail. I would love to get quality anywhere close to what I can produce with the Miro converter tools defaults. Sadly, the web doesn't seem to have much to say except that we should all "use ffmpeg2theora" which is not an option when using Xuggler, and I have to use Xuggler in this case.
My listener which configures the codecs is here: http://pastebin.com/MX2r5KsC
And my reference preset file is here: http://pastebin.com/fBeZxSGr
A solution was found by a colleague / client on a related project. The resolution is surprisingly simple, and consists of the following three lines of code:
coder.setFlag(IStreamCoder.Flags.FLAG_QSCALE, false);
coder.setBitRate(200000);
coder.setTimeBase(IRational.make(1,25));
This forces Xuggler to encode using a constant bitrate of 200kbps and with a frame rate of 25 fps. I hope this helps my fellow Xuggle users out there.
Related
I was able to follow the examples of how to encode video with io.humble easily enough. But, the only example of including audio that I can find simply encodes audio at the beginning of the video. I can't figure out how to encode samples at arbitrary locations. Using setTimestamp doesn't do anything.
Here is the example I found:
https://www.javatips.net/api/myLib-master/myLib.AGPLv3/myLib.humble.test/src/test/java/com/ttProject/humble/test/BeepSoundTest.java
If I modify the beepSamples() method to increase the "sampleNum" value, I can create a longer tone. But calling the method multiple times or setting samples.setTimestamp() to other values or calling setTimestamp() on the packets, all do nothing.
No matter what I do, the audio always shows up at the beginning of the video.
Ultimately, I want to be able to load arbitrary mp3 files of various audioclips and then merge them into the audio stream of the video at specific timestamps. But I can't even get this example to encode at different points in the video stream.
The author of this tool unfortunately is not interested in maintaining it or providing examples. Luckily, I found JavaCV which is an alternative that turned out to be really easy to use.
So to anyone else having this problem, I recommend switching to JavaCV. Other options are also JCodec and Xuggler, but Xuggler is deprecated (same author as io.humble) and JCodec apparently is slow and produces much larger files.
If you need support with these kind of projects. I maintain a fork of Xuggler (https://github.com/olivierayache/xuggle-xuggler)..I can provide help on these topics.
How reliable is ZXing's barcode localization for DataMatrix decoding compared to libdmtx?
I have a set of png image files of stickers (proprietary, so unfortunately I'm not able to share them) containing DataMatrix barcodes. These stickers sit on flat surfaces, have very nice quiet zones and are generally centered in the image, but suffer from inequal lighting conditions and slight dust, likely the largest obstacle to reliable decoding.
I'd like to use a modifiable Java library to decode them and it seems that ZXing is the only open-source option (open to other suggestions). However, upon running these images through the ZXing online decoder, I consistently get NO BARCODE FOUND, even on the cleanest images. In contrast, when I run the same images through proprietary online decoders, like Inlite's Free Online Barcode Reader, I get reliable decodes for all the images. My company has implemented a library in C that also reliable decodes the barcode images by processing them and calling libdmtx. Similarly, this online DataMatrix decoder built on libdmtx can also reliably read my image files.
Is the barcode localization in ZXing significantly inferior to libdmtx?
If I attempt the same preprocessing on the image files before I run them through ZXing, could I achieve similar results? I have a strong preference for a Java library (ZXing), but I may have no choice but to use libdmtx. Would appreciate any insight, thanks!
I had similar problem as you but on encoding side. As per my findings Zxing is certainly inferior to Libdmtx. We are using both libraries in house in C++ and Java project.
There is a case when Zxing breaks while generating barcode look at my comments here:
https://github.com/zxing/zxing/issues/624
However Libdmtx works flowless. The other free options you have in java world are (they are for encoding):
barcode4j
OkapiBarcode
Another alternative is the relatively new ZXing cpp port here: https://github.com/nu-book/zxing-cpp.
It contains a completely new DataMatrix detector that was meant to fix serious limitations of the Java upstream version. It was specifically designed to deal with low resolution images (module size as low as around 2 pixels) and symbols that have just the required 1 module quite zone and a busy background.
The following comparison is certainly not 'fair' but I just had the dmtxread utility of the libdmtx try my test set of images and it missed 3 of 17 samples and took a whooping 300 times as long compared to my code :).
I am trying to convert a mp3 file into WAVE format in my Android application. This operation should take little time, as the application is social, and it is not acceptable for the user to wait for too long.
So here is where I am :
I have already tried to use JLayer (proposed in a similar question Convert mp3 to wav on Android), but the conversion is too slow: it takes about 40 seconds for a 2 minutes mp3 file.
Concerning the library LAME (as in Lame4Android), I also tried it (with Android NDK) but the result is still too slow (15s to 10s).
I came across another library: JUCE, but it is too vast, and including the entire library in the project in order to do that simple conversion seems a bit... excessive. And I am also afraid it will slow the application.
So what I am currently looking for is a C/C++ library to use in order to do that.
Do you know any fast libraries?
Thank you.
Not sure if the license will work for you (GPLv2), but have you considered libmad?
As I understand it, there's not a NDK build available for download, but here is a page describing how to make one yourself...
Another option is libmpg123, which is LGPLv2.1. The same blog has an article describing how to use it in Android.
I have been searching on this. I Need to build an independent utility that should:
Convert image sequence to .mov format
Take input from user and display it inside the mov.
I plan to do this using Java since this is a cross platform language.
How to do it?
See JpegImagesToMovie.java it requires the x-plat version of the JMF (or more importantly jmf.jar).
For a more modern alternative, look to JFFMPEG (JMF with more formats & encodings).
I have earlier used XUGGLER for making videos from image frames. It is easy to use XUGGLER with the help of the comprehensive tutorials available here. You can also add audio to the video generated from the image frames.
Xuggler supports a large number of video codecs and video container formats so you will have the option of creating the video in different formats, leave alone .mov. Hope this helps. I can post my own code for this utility if required.
I am looking for a 100% Java solution for encoding software generated images into an AVI stream together with an uncompressed audio track.
At the moment I am using JMF, but its size and installation problems make it a bad solution for my purpose.
While it does not support audio, I created an MJPEG AVI Java class some years ago. You basically just tell it the resolution of your output video, along with the frame rate, then you just keep adding images to it. When you are done, you tell it to finish and it'll close out the AVI. It is based off of the Microsoft documentation on AVI, RIFF, and BITMAP file formats.
Other than not supporting audio, the only real problem is it implements the version of the AVI format limited to 2GB per file. While the class will write out a much larger file, I am uncertain that any players or video editors would be able to read it.
The way I've used this code in the past, is to generate an MJPEG AVI for processing in a video editor (adding audio, etc. in the editor). It helped me with automating some tedious slide show generation. Not sure if this code will help you, as is, but it might help if you are trying to roll your own solution. MJPEGGenerator.java is available if you are interested!
You can use JMF, see this nice example.
There is a nice blog entry here:
http://www.randelshofer.ch/blog/2008/08/writing-avi-videos-in-pure-java/
By Werner Randelshofer