[FFmpeg-devel] [PATCH 03/10] spdifenc: handle prepadded DTS streams

Anssi Hannula anssi.hannula
Wed Dec 29 22:08:55 CET 2010

On 29.12.2010 18:50, Carl Eugen Hoyos wrote:
> Anssi Hannula <anssi.hannula <at> iki.fi> writes:
>> Some DTS streams (like dts-in-wav or dts-in-disc) are already padded for
>> S/PDIF transmission by having their frame size set to exactly match the
>> S/PDIF bitrate. In this case, no preamble can be added, so do not add
>> it. (DTS is a special case and can be transmitted through S/PDIF without
>> the IEC 61937 headers)
> Could you point me to a sample ( http://samples.mplayerhq.hu/A-codecs/DTS/ ) and
> a command line?

(most likely the other .wav samples there as well)

ffmpeg -f dts -i file.wav -f spdif -acodec copy output.spdif

You'll also need to hack ffmpeg to not exit on the invalid first frame:
diff --git a/ffmpeg.c b/ffmpeg.c
index aaee87b..3b4fd6d 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -756,7 +756,7 @@ static void write_frame(AVFormatContext *s, AVPacket
*pkt, AVCodecContext *avctx
     ret= av_interleaved_write_frame(s, pkt);
     if(ret < 0){
         print_error("av_interleaved_write_frame()", ret);
-        ffmpeg_exit(1);
+      //  ffmpeg_exit(1);

Anssi Hannula

More information about the ffmpeg-devel mailing list