I submitted this to transcode-devel. Didn't get a reply, and I don't want it to
get lost.
When exporting to rawdv format, encoder->samples_this_frame was set to the
number of audio bytes in the frame, not the number of samples. This causes
audio samples to be either dropped or added, and when samples are added, they
contain stack junk.
Example: the DV format encodes the number of audio samples as (nSamples - 1580)
& 0x3F. At 48KHz NTSC, a typical frame contains 1602 samples, and is encoded as
22. Transcode was incorrectly specifying 1602 * 4 = 6408 samples, which is
encoded as 28 -- adding 6 extra samples!
The solution is to divide by 2 * size(int16_t) = 4 (because transcode always
passes 2 channels to dv_encode_full_audio).
Example command:
transcode -i movie.avi -y dvraw -uyvy -o movie.dv