Page 1 of 1

quicktime .mov problem

Posted: 22 May 2004 10:25
by triff
Hello,
I just downloaded vlc 0.7.2 (for windows 2000).
Great !
Just there is still a problem with quicktime .mov videos from Kodak camera (mine is DX4530). VLC won't play the sound correctly (seem to be ulaw). It just make intermittent noise (I would say 2 scratch by sec). When the video is paused, the noise continue for about 1 or 2 seconds.

I have put the video (4Mo) as well as the messages for that video (that is H263/ulaw).
If it may help, I although put the messages for a video that is played OK. (This video is from a non-kodak camera and is .mov too, but seem to use MJPEG/araw).

Any idea?
I would be pleased to give more informations if needed.
Cheers,
--
Triff

sorry for the bad links

Posted: 22 May 2004 10:32
by triff
Sorry for the bad links.
Here they are :

I have put the video (4Mo) as well as the messages for that video (that is H263/ulaw).
If it may help, I although put the messages for a video that is played OK. (This video is from a non-kodak camera and is .mov too, but seem to use MJPEG/araw).

--
Triff

Found the bug !

Posted: 25 May 2004 00:54
by Triff
In fact I don't really know if it''s a bug in VLC or in the kodack cameras.

The probleme is in the box moov/track/mdia/minf/stsd (sample description atom).
In that box we find the codec ('ulaw') and among other thing the sample size.

The QuickTime file format spec I have say :
"Sample size
A 16-bit integer that specifies the number of bits in each uncompressed sound sample. Set this field to 8 for 8-bit sound, and to 16 for 16-bit sound."

And in fact the video.mov from my camera have this field set to 16.

But in libmp4.c (L2169), we find
{ FOURCC_ulaw, MP4_ReadBox_sample_soun, MP4_FreeBox_sample_soun }

which imply after finding the codec 'ulaw' we use MP4_ReadBox_sample_soun the parse the box.

Then in MP4_ReadBox_sample_soun we find
MP4_GET2BYTES( p_box->data.p_sample_soun->i_samplesize );
which correspond to the sample size.

But this i_samplesize seems to be the _rel_ sample size (ie. compressed sample size in that case).
It seems to be used to calculate the size of the chunk (as sample number * sample size) to read and pass to the decoder (araw).
I didn't dug enougth to understand how it work, but the fact is a dump output of the araw decoder show that :
- the data decoded is twice as big as it should be
- parts of the data decoded are in fact video data.

I'm sure the problem is here because putting a
p_box->data.p_sample_soun->i_samplesize = 8;
just after the
MP4_GET2BYTES( p_box->data.p_sample_soun->i_samplesize );
solve the problem (for those videos ...)

But I don't know how to solve it properly, and I don't know how this "sample size" should really be interpreted.

Should I fill a bug report or anything ?

(By the way, another quick hack to solve this problem in a video is to put with a hex editor a 0x08 in place of the 0x10 23 bytes after 'ulaw'. Then VLC read it OK, and it doesn't disturb media player classic neither)

Anyway, I was astounded being able to compile VLC without problems. (just download mingw and copy/paste the example command line of the readme!).
Thank you for your great work and your very clear explanations
--
Triff

Posted: 25 May 2004 21:40
by fenrir
I have commited a workaround. (Basically just using samplesize 8 for alaw/ulaw, in mp4.c).
Thanks for the report.

Thank you

Posted: 26 May 2004 18:41
by Triff
Great !
Just tested it from svn source : work perfectly.
Thank you !
--
Triff

Posted: 24 Nov 2004 02:37
by RedMole
umm hi... i have the same problem with VLC 0.8.1:
the sound is messed up when i play the videos from my cam.
can you please tell me how to fix it....?
what you wrote is a bit confusing to me :(

and why dont they fix that :(
the sound was fine with earlier versions of vlc... only the full screen was messed up... and now its the sound *sigh* :)

thank you