LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-19-2015, 08:36 AM   #1
mina86
Member
 
Registered: Aug 2008
Distribution: Debian
Posts: 517

Rep: Reputation: 229Reputation: 229Reputation: 229
opusdec doesn’t decode streams


Ive set up my MPD to start encoding streamed output using opus codec. It works quite well, I can connect to it with Firefox and hear the audio.

I wanted to set it to work on command line and thus tried:
Code:
wget http://$MPD_HOST/ -O - | opusdec --force-wav - - | aplay
For some reason though, opusdec does not generate any output when working on streams. For example, if I save some of the stream to a file and try decoding it, the result is empty:
Code:
$ wget http://$MPD_HOST/ -O test.opus
--2015-03-19 14:28:56--  http:///
Connecting to 127.0.0.1:6090... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [audio/ogg]
Saving to: test.opus

    [ <=>                                   ] 319,433     12.3KB/s             ^C
$ opusinfo test.opus 
Processing file "test.opus"...

New logical stream (#1, serial: 6b7012fd): type opus
Encoded with libopus 1.1
WARNING: sequence number gap in stream 1. Got page 1506 when expecting page 2. Indicates missing data. (normal for live streams)
WARNING: discontinuity in stream (1)
WARNING: EOS not set on stream 1 (normal for live streams)
Opus stream 1:
	Pre-skip: 312
	Playback gain: 0 dB
	Channels: 2
	Original sample rate: 48000Hz
	Packet duration:   20.0ms (max),   20.0ms (avg),   20.0ms (min)
	Page duration:    360.0ms (max),  246.6ms (avg),   20.0ms (min)
	Total data length: 319433 bytes (overhead: 1.35)
	Playback length: 0m:25.393s
	Average bitrate: 100.6 kb/s, w/o overhead: 99.28 kb/s
$ opusdec test.opus test.pcm
Decoding to 48000 Hz (2 channels)
Encoded with libopus 1.1
Decoding complete.        
$ ls -l
total 312
-rw------- 1 mpn eng 319433 Mar 19 14:29 test.opus
-rw------- 1 mpn eng      0 Mar 19 14:29 test.pcm
Things work great with stand alone files:
Code:
$ opusinfo ehren-paper_lights-96.opus 
Processing file "ehren-paper_lights-96.opus"...

New logical stream (#1, serial: 35f25b46): type opus
Encoded with libopus 1.0.1-rc3
User comments section follows...
	ENCODER=opusenc from opus-tools 0.1.5
	artist=Ehren Starks
	title=Paper Lights
	album=Lines Build Walls
	date=2005-09-05
	copyright=Copyright 2005 Ehren Starks
	license=http://creativecommons.org/licenses/by-nc-sa/1.0/
	organization=magnatune.com
Opus stream 1:
	Pre-skip: 356
	Playback gain: 0 dB
	Channels: 2
	Original sample rate: 44100Hz
	Packet duration:   20.0ms (max),   20.0ms (avg),   20.0ms (min)
	Page duration:   1000.0ms (max),  996.2ms (avg),  120.0ms (min)
	Total data length: 2629170 bytes (overhead: 0.695)
	Playback length: 3m:48.106s
	Average bitrate: 92.21 kb/s, w/o overhead: 91.57 kb/s
Logical stream 1 ended
$ opusdec - - <ehren-paper_lights-96.opus >ehren-paper_lights-96.pcm
Decoding to 44100 Hz (2 channels)
Encoded with libopus 1.0.1-rc3
ENCODER=opusenc from opus-tools 0.1.5
artist=Ehren Starks
title=Paper Lights
album=Lines Build Walls
date=2005-09-05
copyright=Copyright 2005 Ehren Starks
license=http://creativecommons.org/licenses/by-nc-sa/1.0/
organization=magnatune.com
Decoding complete.        
$ ls -l ehren-paper_lights-96.*
-rw------- 1 mpn eng  2629170 Feb 27  2013 ehren-paper_lights-96.opus
-rw------- 1 mpn eng 40238016 Mar 19 14:31 ehren-paper_lights-96.pcm
What makes things infinitely stranger is that it used to work just fine, but at one point Ive stopped the wget-opusdec-aplay pipe and when I started it again, it opusdec refused to cooperate.

Does anyone have any ideas? How to debug it? Or pointers to some command-line stream players supporting opus codec?

Code:
$ opusdec -V
opusdec opus-tools 0.1.8 (using libopus 1.1)
Copyright (C) 2008-2013 Xiph.Org Foundation
$ opusinfo -V
opusinfo from opus-tools 0.1.8

Last edited by mina86; 03-19-2015 at 08:38 AM.
 
Old 03-23-2015, 01:36 PM   #2
mina86
Member
 
Registered: Aug 2008
Distribution: Debian
Posts: 517

Original Poster
Rep: Reputation: 229Reputation: 229Reputation: 229
With help from mark4o at #opus I identified this as a bug in MPD and made a patch in case anyone else is experiencing this.
 
  


Reply

Tags
mpd, opus, opusdec, streaming


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
procmailrc decode data from base64 encoded emails - trying to decode with uudeview garyrickert Linux - Software 6 10-06-2015 03:41 PM
Clementine doesn't play streams -> "Couldn't create gstreamer source element for <url Squall90 Slackware 3 11-09-2010 01:43 AM
Tshark gzipped traffic doesn't decode with -V switch mattseanbachman Linux - Newbie 1 04-18-2010 08:34 PM
How to decode gpg? ashkael Linux - Newbie 5 02-22-2007 11:18 AM
mplayer decode bendeco13 Programming 3 10-31-2004 11:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration