[Libav-user] Muxing sample for FLTP input and FLTP audio, loses stereo audio

Taha Ansari mtaha.ansari at gmail.com
Mon Jan 20 11:59:13 CET 2014


Based on muxing sample that comes with FFmpeg docs, I have modified it,
from input format as S16 to FLTP (planar stereo), and outputting to webm
format (stereo).

Since input is now FLTP, I am filling two arrays, then encoding again to
FLTP. There are no obvious errors given on screen, but the resulting webm
video does not play any audio (just the video content). This is just proof
of concept in understanding things; here is an added (crude) function to
fill up input FLTP stereo buffer:

static void get_audio_frame_for_planar_stereo(int16_t **samples, int
frame_size, int nb_channels)
    int j, i, v[2];
    int16_t *q1 = (int16_t *) samples[0];
    int16_t *q2 = (int16_t *) samples[1];

    for (j = 0; j < frame_size; j++)
        v[0] = (int)(sin(t) * 10000);
        v[1] = (int)(tan(t) * 10000);
        *q1++ = v[0];
        *q2++ = v[1];
        t     += tincr;
        tincr += tincr2;

Which I am calling from inside write_audio_frame() function.

Note also, wherever code reffered AV_SAMPLE_FMT_S16 as input, I have
changed to AV_SAMPLE_FMT_FLTP.

Whole workable source is here:


When run with ffprobe.exe, with these instructions:

ffprobe -show_packets output.webm >output.txt

I see nothing out of ordinary, all pts/dts values appear to be in place:


Could someone highlight cause of this mus-interpretation?

Thanks for your time...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20140120/dfb91c86/attachment.html>

More information about the Libav-user mailing list