User avatar
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

arecord works but avconv produces Non-monotonous DTS errors

Thu Feb 12, 2015 8:21 pm

Hi I'm trying to capture audio from a video capture card on a Pi 2

The following works perfectly and I can play the recording back with aplay

Code: Select all

 arecord -d 30 -c 2 -D plughw:1,0 -v -r 48000 -t wav -f S16_LE -M record.wav
However if I attempt the simplest capture using the same device with avconv as described in the avconv man page with:

Code: Select all

 avconv -f alsa -i hw:1,0 alsaout.wav
I get the following [alsa @ 0x1d8f5c0] ALSA buffer xrun and Non-monotonous DTS in output stream 0:0: errors

Code: Select all

 avconv -f alsa -i hw:1,0 alsaout.wav
avconv version 9.14-6:9.14-1rpi1rpi1, Copyright (c) 2000-2014 the Libav developers
  built on Jul 22 2014 15:08:12 with gcc 4.6 (Debian 4.6.3-14+rpi1)
[alsa @ 0x1d8f5c0] Estimating duration from bitrate, this may be inaccurate
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, alsa, from 'hw:1,0':
  Duration: N/A, start: 88158.999714, bitrate: N/A
    Stream #0.0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
File 'alsaout.wav' already exists. Overwrite ? [y/N] y
Output #0, wav, to 'alsaout.wav':
  Metadata:
    ISFT            : Lavf54.20.4
    Stream #0.0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le -> pcm_s16le)
Press ctrl-c to stop encoding
[alsa @ 0x1d8f5c0] ALSA buffer xrun.
Non-monotonous DTS in output stream 0:0; previous: 191461, current: 191440; changing to 191462. This may result in incorrect timestamps in the output file.
Non-monotonous DTS in output stream 0:0; previous: 191462, current: 191448; changing to 191463. This may result in incorrect timestamps in the output file.
Non-monotonous DTS in output stream 0:0; previous: 191463, current: 191431; changing to 191464. This may result in incorrect timestamps in the output file.
Non-monotonous DTS in output stream 0:0; previous: 191464, current: 191439; changing to 191465. This may result in incorrect timestamps in the output file.
Non-monotonous DTS in output stream 0:0; previous: 191465, current: 191417; changing to 191466. This may result in incorrect timestamps in the output file.
I've tried explicitly adding parameters to match the input and output bitrates etc with:

Code: Select all

avconv -f alsa -ar 48000 -ac 2 -b 1536k -i hw:=1,0 -ar 48000 -ac 2 -b 1536k alsaout.wav
however I get the same errors:

Code: Select all

pi@pi2 ~ $ avconv -f alsa -ar 48000 -ac 2 -b 1536k -i hw:=1,0 -ar 48000 -ac 2 -b 1536k alsaout.wav
avconv version 9.14-6:9.14-1rpi1rpi1, Copyright (c) 2000-2014 the Libav developers
  built on Jul 22 2014 15:08:12 with gcc 4.6 (Debian 4.6.3-14+rpi1)
[alsa @ 0x754760] Estimating duration from bitrate, this may be inaccurate
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, alsa, from 'hw:=1,0':
  Duration: N/A, start: 88639.999837, bitrate: N/A
    Stream #0.0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
File 'alsaout.wav' already exists. Overwrite ? [y/N] y
Output #0, wav, to 'alsaout.wav':
  Metadata:
    ISFT            : Lavf54.20.4
    Stream #0.0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le -> pcm_s16le)
Press ctrl-c to stop encoding
[alsa @ 0x754760] ALSA buffer xrun.
Non-monotonous DTS in output stream 0:0; previous: 143522, current: 143504; changing to 143523. This may result in incorrect timestamps in the output file.
Non-monotonous DTS in output stream 0:0; previous: 143523, current: 143466; changing to 143524. This may result in incorrect timestamps in the output file.
Non-monotonous DTS in output stream 0:0; previous: 143524, current: 143426; changing to 143525. This may result in incorrect timestamps in the output file.
Non-monotonous DTS in output stream 0:0; previous: 143525, current: 143383; changing to 143526. This may result in incorrect timestamps in the output file.
Non-monotonous DTS in output stream 0:0; previous: 143526, current: 143370; changing to 143527. This may result in incorrect timestamps in the output file.
Has anyone got any ideas on what I am doing wrong or how to fix the issue?

Thanks for any input on this.

Fergal

tvjon
Posts: 715
Joined: Mon Jan 07, 2013 9:11 am

Re: arecord works but avconv produces Non-monotonous DTS err

Fri Feb 13, 2015 7:43 pm

Fergal,
seems to be commonplace. I made an aac file & had similar error results, but the file seemed ok:

pi@pi2 ~ $ avconv -f alsa -ac 1 -i hw:1,0 -vn -c:a aac -strict experimental test.aac

This works ok, interestingly:

arecord -d 30 -c 2 -D plughw:1,0 -v -r 48000 -t wav -f S16_LE -M -| avconv -i pipe:0 -acodec libmp3lame -aq 128k file.mp3

What's your capture device?

User avatar
fbutler
Posts: 302
Joined: Thu Mar 15, 2012 4:09 pm
Location: Surrey, England

Re: arecord works but avconv produces Non-monotonous DTS err

Fri Feb 13, 2015 8:57 pm

tvjon wrote:Fergal,
seems to be commonplace. I made an aac file & had similar error results, but the file seemed ok:

pi@pi2 ~ $ avconv -f alsa -ac 1 -i hw:1,0 -vn -c:a aac -strict experimental test.aac

This works ok, interestingly:

arecord -d 30 -c 2 -D plughw:1,0 -v -r 48000 -t wav -f S16_LE -M -| avconv -i pipe:0 -acodec libmp3lame -aq 128k file.mp3
Thanks, I'll try that over the weekend along with a few other combinations
tvjon wrote:What's your capture device
It's a Pinnacle Dazzle 107 HW Rev 1.1 with an Em28xx chipset

Return to “Graphics, sound and multimedia”