[Libav-user] Muxing sample for FLTP input and FLTP audio, loses stereo audio
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
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;
int16_t *q1 = (int16_t *) samples;
int16_t *q2 = (int16_t *) samples;
for (j = 0; j < frame_size; j++)
v = (int)(sin(t) * 10000);
v = (int)(tan(t) * 10000);
*q1++ = v;
*q2++ = v;
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...
More information about the Libav-user