[Bug 722672] New: ffmux_dv / avmux_dv reports invalid audio caps.
GStreamer (bugzilla.gnome.org)
bugzilla at gnome.org
Mon Jan 20 21:36:33 PST 2014
https://bugzilla.gnome.org/show_bug.cgi?id=722672
GStreamer | gst-libav | git
Summary: ffmux_dv / avmux_dv reports invalid audio caps.
Classification: Platform
Product: GStreamer
Version: git
OS/Version: All
Status: UNCONFIRMED
Severity: minor
Priority: Normal
Component: gst-libav
AssignedTo: gstreamer-bugs at lists.freedesktop.org
ReportedBy: gnome at mithis.com
QAContact: gstreamer-bugs at lists.freedesktop.org
GNOME version: ---
libav only supports encoding DV with 2 channel, 48kHz, 16bit PCM audio but
avmux_dv reports supporting a wide range of frequencies.
-----------------------------------------
$ gst-inspect-1.0 avmux_dv
<snip>
SINK template: 'audio_%u'
Availability: On request
Has request_new_pad() function: 0x7fc03826a7f0
Capabilities:
audio/x-raw
channels: [ 1, 2 ]
rate: [ 4000, 96000 ]
format: S16LE
layout: interleaved
<snip>
$
-----------------------------------------
The correct output would be;
-----------------------------------------
$ gst-inspect-1.0 avmux_dv
<snip>
SINK template: 'audio_%u'
Availability: On request
Has request_new_pad() function: 0x7fc03826a7f0
Capabilities:
audio/x-raw
channels: [ 2 ]
rate: [ 48000 ]
format: S16LE
layout: interleaved
<snip>
$
-----------------------------------------
If you fail to send the correct 2 channel, 48kHz audio you get an error
something like;
-----------------------------------------
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/ffmux_dv:dvmux: Could not configure
supporting library.
Additional debug info:
gstffmpegmux.c(665): gst_ffmpegmux_collected ():
/GstPipeline:pipeline0/ffmux_dv:dvmux:
Failed to write file header - check codec settings
-----------------------------------------
##############################################
# Where are these caps coming from?
##############################################
The caps come from the following function in gstavcodecmap.c;
-----------------------------------------
static GstCaps *
gst_ff_aud_caps_new (AVCodecContext * context, AVCodec * codec,
enum AVCodecID codec_id, gboolean encode, const char *mimetype,
const char *fieldname, ...)
{
-----------------------------------------
They seem to be from hitting a default else on the following lines in
gstavcodecmap.c;
-----------------------------------------
706 } else {
707 gst_caps_set_simple (caps, "rate", GST_TYPE_INT_RANGE, 4000, 96000,
NULL);
708 }
-----------------------------------------
##############################################
# libavformat DV audio support info
##############################################
>From libavformat/dvenc.c
-----------------------------------------
/* Some checks -- DV format is very picky about its incoming streams */
if (!vst || vst->codec->codec_id != AV_CODEC_ID_DVVIDEO)
goto bail_out;
for (i=0; i<c->n_ast; i++) {
if (c->ast[i] && (c->ast[i]->codec->codec_id !=
AV_CODEC_ID_PCM_S16LE ||
c->ast[i]->codec->sample_rate != 48000 ||
c->ast[i]->codec->channels != 2))
goto bail_out;
}
-----------------------------------------
static int dv_write_header(AVFormatContext *s)
{
if (!dv_init_mux(s)) {
av_log(s, AV_LOG_ERROR, "Can't initialize DV format!\n"
"Make sure that you supply exactly two streams:\n"
" video: 25fps or 29.97fps, audio: 2ch/48kHz/PCM\n"
" (50Mbps allows an optional second audio stream)\n");
return -1;
}
return 0;
}
-----------------------------------------
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list