WordRider Home
Welcome! Log In Create A New Profile

Advanced

Video to audio

Posted by ntoskrnl 
Re: Video to audio
August 13, 2013 03:50PM
tong2shot Wrote:
-------------------------------------------------------
> I just committed YouTube plugin that supports
> realtime video to audio conversion, and minor fix
> in video2audio plugin to accommodate multiple
> bitrates.

That seems pretty nice!


> Unfortunately shrinking video2audio
> binary (ant task : dist) breaks Java reflection,
> while original video2audio binary (ant task : dist
> 0) working just fine. I haven't released the
> plugins.

Is this a problem though? Where do we use reflection?

I put <export prefix="cz.*"/> in plugin.xml so that other plugins couldn't access the shrinked net.sourceforge.* packages
Re: Video to audio
August 13, 2013 04:16PM
ntoskrnl Wrote:
-------------------------------------------------------
> Is this a problem though? Where do we use
> reflection?

Unfortunately yes, and not just reflection, in another case it also breaks net.sourceforge.jaad.mp4.boxes.BoxImpl#decode(). I got this exception while worked on the reflection's workaround :

SEVERE: 
java.io.IOException: ErrorDuringDownload
	at cz.vity.freerapid.core.tasks.DownloadTask.saveToFile(DownloadTask.java:272)
	at cz.vity.freerapid.plugins.services.youtube.YouTubeRunner.convertToAudio(Unknown Source)
	at cz.vity.freerapid.plugins.services.youtube.YouTubeRunner.run(Unknown Source)
	at cz.vity.freerapid.plugins.webclient.AbstractFileShareService.run(AbstractFileShareService.java:102)
	at cz.vity.freerapid.core.tasks.DownloadTask.doInBackground(DownloadTask.java:98)
	at cz.vity.freerapid.core.tasks.DownloadTask.doInBackground(DownloadTask.java:42)
	at javax.swing.SwingWorker$1.call(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at javax.swing.SwingWorker.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.InternalError: Badly shrinked
	at net.sourceforge.jaad.mp4.boxes.BoxImpl.decode(Unknown Source)
	at net.sourceforge.jaad.mp4.boxes.BoxFactory.parseBox(Unknown Source)
	at net.sourceforge.jaad.mp4.MP4Container.readContent(Unknown Source)
	at net.sourceforge.jaad.mp4.MP4Container.(Unknown Source)
	at cz.vity.freerapid.plugins.video2audio.Mp4ToMp3InputStream.init(Unknown Source)
	at cz.vity.freerapid.plugins.video2audio.Mp4ToMp3InputStream.readFrame(Unknown Source)
	at cz.vity.freerapid.plugins.video2audio.VideoToAudioInputStream.read(Unknown Source)
	at cz.vity.freerapid.plugins.video2audio.Mp4ToMp3InputStream.read(Unknown Source)
	at cz.vity.freerapid.plugins.video2audio.VideoToAudioInputStream.read(Unknown Source)
	at cz.vity.freerapid.plugins.video2audio.Mp4ToMp3InputStream.read(Unknown Source)
	at cz.vity.freerapid.core.tasks.DownloadTask.saveToFile(DownloadTask.java:242)

Reflection example :
net.sourceforge.jaad.mp4.boxes.BoxFactory#forType().
box instantiation uses reflection (line 437). It failed to instatiate FileTypeBox, returned UnknownBox instead, and produced exception :

SEVERE: BoxFactory: could not instantiate box ftyp
java.lang.InstantiationException: net.sourceforge.jaad.mp4.boxes.impl.FileTypeBox
	at java.lang.Class.newInstance0(Unknown Source)
	at java.lang.Class.newInstance(Unknown Source)
	at net.sourceforge.jaad.mp4.boxes.BoxFactory.forType(Unknown Source)
	at net.sourceforge.jaad.mp4.boxes.BoxFactory.parseBox(Unknown Source)
	at net.sourceforge.jaad.mp4.MP4Container.readContent(Unknown Source)
	at net.sourceforge.jaad.mp4.MP4Container.(Unknown Source)
	at cz.vity.freerapid.plugins.video2audio.Mp4ToMp3InputStream.init(Unknown Source)
	at cz.vity.freerapid.plugins.video2audio.Mp4ToMp3InputStream.readFrame(Unknown Source)
	at cz.vity.freerapid.plugins.video2audio.VideoToAudioInputStream.read(Unknown Source)
	at cz.vity.freerapid.plugins.video2audio.VideoToAudioInputStream.read(Unknown Source)
	at cz.vity.freerapid.plugins.services.youtube.YouTubeRunner.convertToAudio(Unknown Source)
	at cz.vity.freerapid.plugins.services.youtube.YouTubeRunner.run(Unknown Source)
	at cz.vity.freerapid.plugins.webclient.AbstractFileShareService.run(AbstractFileShareService.java:102)
	at cz.vity.freerapid.core.tasks.DownloadTask.doInBackground(DownloadTask.java:98)
	at cz.vity.freerapid.core.tasks.DownloadTask.doInBackground(DownloadTask.java:42)
	at javax.swing.SwingWorker$1.call(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at javax.swing.SwingWorker.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

SEVERE: cz.vity.freerapid.core.tasks.DownloadTask@1b18235 failed: java.lang.ClassCastException: net.sourceforge.jaad.mp4.boxes.UnknownBox cannot be cast to net.sourceforge.jaad.mp4.boxes.impl.FileTypeBox
java.lang.ClassCastException: net.sourceforge.jaad.mp4.boxes.UnknownBox cannot be cast to net.sourceforge.jaad.mp4.boxes.impl.FileTypeBox
	at net.sourceforge.jaad.mp4.MP4Container.readContent(Unknown Source)
	at net.sourceforge.jaad.mp4.MP4Container.(Unknown Source)
	at cz.vity.freerapid.plugins.video2audio.Mp4ToMp3InputStream.init(Unknown Source)
	at cz.vity.freerapid.plugins.video2audio.Mp4ToMp3InputStream.readFrame(Unknown Source)
	at cz.vity.freerapid.plugins.video2audio.VideoToAudioInputStream.read(Unknown Source)
	at cz.vity.freerapid.plugins.video2audio.VideoToAudioInputStream.read(Unknown Source)
	at cz.vity.freerapid.plugins.services.youtube.YouTubeRunner.convertToAudio(Unknown Source)
	at cz.vity.freerapid.plugins.services.youtube.YouTubeRunner.run(Unknown Source)
	at cz.vity.freerapid.plugins.webclient.AbstractFileShareService.run(AbstractFileShareService.java:102)
	at cz.vity.freerapid.core.tasks.DownloadTask.doInBackground(DownloadTask.java:98)
	at cz.vity.freerapid.core.tasks.DownloadTask.doInBackground(DownloadTask.java:42)
	at javax.swing.SwingWorker$1.call(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at javax.swing.SwingWorker.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)


> I put <export prefix="cz.*"/> in plugin.xml
> so that other plugins couldn't access the shrinked
> net.sourceforge.* packages

I got this exception, when I used "cz.*" in plugin.xml, while "*" works fine :
SEVERE: 
java.lang.NoClassDefFoundError: cz/vity/freerapid/plugins/video2audio/VideoToAudioInputStream
	at cz.vity.freerapid.plugins.services.youtube.YouTubeServiceImpl.getPluginRunnerInstance(Unknown Source)
	at cz.vity.freerapid.plugins.webclient.AbstractFileShareService.run(AbstractFileShareService.java:99)
	at cz.vity.freerapid.core.tasks.DownloadTask.doInBackground(DownloadTask.java:98)
	at cz.vity.freerapid.core.tasks.DownloadTask.doInBackground(DownloadTask.java:42)
	at javax.swing.SwingWorker$1.call(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at javax.swing.SwingWorker.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: class cz.vity.freerapid.plugins.video2audio.VideoToAudioInputStream is not visible for plug-in youtube.com
	at org.java.plugin.standard.StandardPluginClassLoader.checkClassVisibility(StandardPluginClassLoader.java:621)
	at org.java.plugin.standard.StandardPluginClassLoader.loadPluginClass(StandardPluginClassLoader.java:466)
	at org.java.plugin.standard.StandardPluginClassLoader.loadPluginClass(StandardPluginClassLoader.java:491)
	at org.java.plugin.standard.StandardPluginClassLoader.loadClass(StandardPluginClassLoader.java:372)
	at java.lang.ClassLoader.loadClass(Unknown Source)
Re: Video to audio
August 13, 2013 05:12PM
Fair enough, can't say I really tested either. smiling smiley

I guess we'll just have to go without shrinking. It's only 150kB larger or so. I'll revert the build.xml changes and delete some classes manually.
Re: Video to audio
August 14, 2013 01:16PM
Video2Audio plugin v1.0.0 released.
YouTube plugin v2.0.0 that supports video to audio conversion released. smiling smiley

Since the plugin converts video to audio on-the-fly, the speed you see in FRD GUI is not/may not be the actual download speed.



Edited 2 time(s). Last edit at 08/14/2013 01:33PM by tong2shot.
Re: Video to audio
August 14, 2013 03:54PM
I found a small bug – I got an NPE when trying to download after I went into plugin settings and enabled audio conversion but left the bitrate untouched. This is because I already had a config file, but it didn't have the audio bitrate set, and it defaulted to null. This is fixed in plugin v2.0.1.
Sorry, only registered users may post in this forum.

Click here to login