MizanCSEJU / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

Videos encoded with WebM have issues in sound playback and video length #435

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Using JavaCV 0.7 on Windows 8 64 bit, whenever I encode WebM video and audio I 
find two unexpected things:
(1) Audio does not play in VLC (but it does play fine in Chrome – perhaps 
Chrome is more resistant to the problem)?
(2) Both Chrome and VLC seem to assume that the video is much longer than it 
really is – e.g. a 10 second video & audio clip has seek times up to 8 
minutes and 41 seconds. Seeking to those times fail. I see this as a clue that 
perhaps WebM encoding is expecting some extra post-processing, probably for 
WebM’s “fast seeking” feature (allowing users to seek to any point in the 
video on a web hosted file without downloading the full file)

Note that these do not happen with other codecs, nor do they happen when you 
use FFMPEG on the command line to merge an audio and video file into WebM. I 
have found this to happen in all of my tests regardless of input files.
I’ll attach a simple reproduction file.

Original issue reported on code.google.com by aaronpowers on 24 Feb 2014 at 2:03

GoogleCodeExporter commented 9 years ago
Note that I am using the code in revision 
http://code.google.com/p/javacv/source/detail?r=e6450930b63e3f4c76695627bb671b36
08c44557
(which is necessary to record Vorbis audio).

Also note that this problem specifically does not happen when encoding to OGV 
(e.g. just change the filename in the example to .ogv and there will be no 
problems with the playback).

Original comment by aaronpowers on 24 Feb 2014 at 2:05

GoogleCodeExporter commented 9 years ago
So, are you saying it's a problem with the container? With which container 
formats does it have problem with, then?

Original comment by samuel.a...@gmail.com on 24 Feb 2014 at 2:15

GoogleCodeExporter commented 9 years ago
That's an impressively quick response!

Yes, it appears to be the WebM container. I just reproduced the problem with no 
video, just audio, and since Vorbis works fine in .ogv and .ogg files, it must 
be WebM.

Original comment by aaronpowers on 24 Feb 2014 at 3:21

GoogleCodeExporter commented 9 years ago
I think I've found the problem. Please try the changes in this revision:
http://code.google.com/p/javacv/source/detail?r=d8408df7be24f8cd8342e4e5ca371891
0e397049
Thanks!

Original comment by samuel.a...@gmail.com on 1 Mar 2014 at 10:37

GoogleCodeExporter commented 9 years ago
Hi Samuel,
I tested the fix and it works perfectly! Webm now encodes plays in the browser 
and in VLC just as well as if encoded with FFMPEG on the command line, and I'm 
impressed it was so few lines of code in the patch too, it was an efficient 
change.

Thanks so much for your help!

Original comment by aaronpowers on 1 Mar 2014 at 11:21

GoogleCodeExporter commented 9 years ago
The fix has been included in the latest release of JavaCV 0.8. There are a lot 
of other changes with this release, so please make sure to read the news 
release here:
    http://bytedeco.org/release/2014/04/28/first-release.html

Incidentally, the project is now hosted on GitHub:
    https://github.com/bytedeco/javacv

Thanks once again for reporting!

Original comment by samuel.a...@gmail.com on 29 Apr 2014 at 1:39