[Ffmpeg-devel] DV codec audio incompatibility

Björn Axelsson bjorn.axelsson
Thu Jan 4 13:55:16 CET 2007


Hi,
I believe I have found an incompatibility problem in the audio encoding
part of the ffmpeg DV codec and Microsoft's DirectShow DV codec.

I am streaming ffmpeg-encoded raw DV streams over ieee1394 directly into
the Windows Media Encoder (WME). Streams encoded with ffmpeg appear to
have no audio or silent audio in WME, but with other codec's there's no
such problem. I can also reproduce this in Windows Media Player (WMP) if
the raw stream is wrapped in a type-1 avi file (WMP doesn't play raw
streams, and there's no problem with type-2 avi files).
VLC and MainActor have no problems with the ffmpeg streams, probably
because they come with their own codecs and doesn't use Microsoft's.

A workaround is to pipe the ffmpeg encoded dv stream through the
attached libdv audio recoder program. After doing that the sound works
perfecty both in WME and WMP.

I have confirmed this with the current ffmpeg (SVN rev 7407).

ffmpeg command line:
ffmpeg -i /tmp/testfile.mpg -f dv -ac 2 -ar 48000 -acodec pcm_s16le
-y /dev/dv1394_out
output: 
FFmpeg version SVN-r7407, Copyright (c) 2000-2006 Fabrice Bellard, et
al.
  configuration:
  libavutil version: 49.1.0
  libavcodec version: 51.28.0
  libavformat version: 51.7.0
  built on Jan  4 2007 12:03:35, gcc: 3.3.5 (Debian 1:3.3.5-13)
Input #0, mpegts, from '/tmp/testfile.mpg':
  Duration: 00:00:51.2, start: 226.828000, bitrate: 5939 kb/s
  Stream #0.0[0x104]: Video: mpeg2video, yuv420p, 720x576, 5500 kb/s,
25.00 fps(r)
  Stream #0.1[0x103]: Audio: mp2, 48000 Hz, stereo, 192 kb/s
Output #0, dv, to 'pipe:':
  Stream #0.0: Video: dvvideo, yuv420p, 720x576, q=2-31, 200 kb/s, 25.00
fps(c)
  Stream #0.1: Audio: pcm_s16le, 48000 Hz, stereo, 1536 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop encoding
[dvvideo @ 0x845f65c]Can't process DV frame #1283. Insufficient audio
data or severe sync problem.
[dvvideo @ 0x845f65c]Can't process DV frame #1283. Insufficient audio
data or severe sync problem.
[dvvideo @ 0x845f65c]Can't process DV frame #1283. Insufficient audio
data or severe sync problem.
[dvvideo @ 0x845f65c]Can't process DV frame #1283. Insufficient audio
data or severe sync problem.
[dvvideo @ 0x845f65c]Can't process DV frame #1283. Insufficient audio
data or severe sync problem.
frame= 1289 q=0.0 Lsize=  180422kB time=51.3 bitrate=28791.0kbits/s
video:179859kB audio:9626kB global headers:0kB muxing overhead
-4.782968%

Command line with working workaround:
ffmpeg -i /tmp/testfile.mpg -f dv -ac 2 -ar 48000 -acodec pcm_s16le -y -
| recode_dv_audio > /dev/dv1394_out

Command used to wrap the dv file in type-1 avi for WMP tests:
dvgrab --noavc --format dv1 --stdin < testfile.dv

Windows test machine versions:
  Windows XP Home Edition 2002 SP2 (Acer OEM) 
  WME 9.00.00.2980
  WMP 9.00.00.3349
  DV Video Decoder 6.05.2600.2180 (MS DV Codec)

Please let me know if you further information or example media.

Also, many thanks for the excellent ffmpeg suite!

-- 
Bj?rn Axelsson                    Phone: +46-(0)90-18 98 97
Intinor AB                          Fax: +46-(0)920-757 10
www.intinor.se
Interactive Television & Digital Media Distribution
-------------- next part --------------
A non-text attachment was scrubbed...
Name: recode_dv_audio.c
Type: text/x-csrc
Size: 2926 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070104/d27139d1/attachment.c>



More information about the ffmpeg-devel mailing list