WordRider Home
Welcome! Log In Create A New Profile

Advanced

Video to audio

Posted by ntoskrnl 
Video to audio
August 04, 2013 03:30PM
I just committed a new plugin, video2audio. It has two classes which can be used to convert video streams to audio streams. I figured we could integrate this to the YouTube plugin to begin with.

However, I'm not very familiar with the relevant parts of the YT plugin (such as quality selection) – maybe tong2shot has some ideas?

I downloaded all qualities of a video and found out that:

- MP4 always has AAC audio.
- 360p FLV and above uses AAC audio, lower uses MP3.
- 3GP is basically the same as MP4, so it also has AAC.
- We don't support WebM at the moment.

- 720p and above has 192kbps audio.
- 360p and above has 128kbps audio.
- 240p has low quality 22kHz audio.
- 144p is just useless.

See also: [en.wikipedia.org]



Edited 1 time(s). Last edit at 08/04/2013 03:34PM by ntoskrnl.
Re: Video to audio
August 05, 2013 04:46PM
I have an idea again, I think I had it before, but now I think it could be useful.
Technically - I think we can use extension points from plugin framework to allow plugin to add custom popmenu over some file(s) (to add own submenu to current popmenu).

This plugin would check if the file can be processed with it, then it would add menu item like "Convert to" -> MP3, WAV whatever.

The problematic place is a GUI. It has to use own working thread + user has to be informed about some progress. But I think converting video to audio can be fast in most cases, right?

-------------------------------------

Re: Video to audio
August 05, 2013 05:02PM
Vity Wrote:
-------------------------------------------------------
> The problematic place is a GUI. It has to use own
> working thread + user has to be informed about
> some progress. But I think converting video to
> audio can be fast in most cases, right?


Well, the crappy encoder which is used here is actually pretty slow. It takes around 15 seconds on my high end system to convert a 4 minute video. FFmpeg does it in 3-5 seconds.



Edited 1 time(s). Last edit at 08/05/2013 05:03PM by ntoskrnl.
Re: Video to audio
August 05, 2013 05:04PM
So wouldn't be better to use ffmpeg?

-------------------------------------

Re: Video to audio
August 05, 2013 05:46PM
No. ffmpeg.exe is 25MB, and that's just for Windows – what about Linux, OS X, Solaris, FreeBSD, ...?

The pure Java solution is good enough for streaming.



Edited 1 time(s). Last edit at 08/05/2013 05:46PM by ntoskrnl.
Re: Video to audio
August 05, 2013 09:15PM
And what about to make it optional? Btw. don't forget 95% users = Windows...
I would prefer to use fast tool than very very slow thing.+ think about problems with a heap we already have...

-------------------------------------





Edited 1 time(s). Last edit at 08/05/2013 09:18PM by Vity.
Re: Video to audio
August 07, 2013 12:30PM
I suggest to make this dialog , which will appear in popmenu -> Convert to Audio
(I suppose that convert video to another video format is useless)


Path to ffmpeg will be set in Misc options.

-------------------------------------





Edited 2 time(s). Last edit at 08/07/2013 12:38PM by Vity.
Attachments:
open | download - mockup.png (43.2 KB)
Re: Video to audio
August 08, 2013 09:52PM
ntoskrnl Wrote:
-------------------------------------------------------
> I just committed a new plugin, video2audio. It has
> two classes which can be used to convert video
> streams to audio streams. I figured we could
> integrate this to the YouTube plugin to begin
> with.

Nice work.
I tested in my middle-end system, it takes ~12 seconds to convert ~3 minutes video clip. I think it's good enough.

> However, I'm not very familiar with the relevant
> parts of the YT plugin (such as quality selection)
> – maybe tong2shot has some ideas?
...
> - 720p and above has 192kbps audio.
> - 360p and above has 128kbps audio.
> - 240p has low quality 22kHz audio.
> - 144p is just useless.

What I have in my mind is that we need itag audio bitrate -> MP3 equivalence table :
192kbps AAC <-> 320kbps MP3 ?
152kbps AAC <-> ...kbps MP3 ?
128kbps AAC <-> 256kbps MP3 ?
96kbps AAC <-> 128kbps MP3 ?
64kbps MP3 -> copy the stream.

Once we get the itag set that correspond to the target audio bitrate from the option, we choose the lowest resolution as possible from the set to preserve bandwitdh.

Vity Wrote:
-------------------------------------------------------
> I suggest to make this dialog , which will appear
> in popmenu -> Convert to Audio
> (I suppose that convert video to another video
> format is useless)
> [img13.imageshack.us]
>
> Path to ffmpeg will be set in Misc options.

I agree with ntoskrnl, ffmpeg is rather bulky to bundle, and a bit complicated for general users if we're not going to bundle it, and the java solution is good enough. How about for first release, we use the java solution, then listen to users feedbacks. If they think it's too slow, we can switch to ffmpeg for later release.

Btw, I don't understand about the plugin popup menu extension. I'm just too lazy to read the app code at this moment spinning smiley sticking its tongue out
Re: Video to audio
August 09, 2013 06:47AM
tong2shot Wrote:
-------------------------------------------------------
> What I have in my mind is that we need itag audio
> bitrate -> MP3 equivalence table :
> 192kbps AAC <-> 320kbps MP3 ?
> 152kbps AAC <-> ...kbps MP3 ?
> 128kbps AAC <-> 256kbps MP3 ?
> 96kbps AAC <-> 128kbps MP3 ?
> 64kbps MP3 -> copy the stream.
>
> Once we get the itag set that correspond to the
> target audio bitrate from the option, we choose
> the lowest resolution as possible from the set to
> preserve bandwitdh.


Sounds good to me.

However, it might be simpler to just convert so that AAC bitrate == MP3 bitrate. I don't think AAC is that much better. smiling smiley I'm not even sure if most users can hear a difference between 128kbps and 192kbps...
Re: Video to audio
August 13, 2013 02:54PM
I just committed YouTube plugin that supports realtime video to audio conversion, and minor fix in video2audio plugin to accommodate multiple bitrates. 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.
Sorry, only registered users may post in this forum.

Click here to login