Home/News | About | Download | Documentation | Forum | Bug Reports | Contact | Donations | Consulting | Projects | Legal | Security | FATE


This forum has not been maintained for a long time and will probably get deleted in the near future.
For faster responses to your questions, please use StackOverflow instead and tag your questions with "FFmpeg".
If you need a backup of the posts from this forum, please contact me directly.

stream opus over rtsp

Discussions about problems encountered using ffplay.
Forum rules
FFmpeg is in a state of perpetual development and we do not currently have the person power to backport fixes to official releases. As such, if you wish to query or report a bug, you must try with the latest development branch revision of FFmpeg to confirm the issue still exists. The latest FFmpeg can be downloaded from here: http://www.ffmpeg.org/download.html

stream opus over rtsp

Postby alexinthesky » Fri May 20, 2016 9:19 am

Hi I am having an issue with playing an rstp/rtp stream with opus codec.
I have one feed outputing two streams with ffserver. Here is the relevant ffserver section :

Code: Select all
HTTPPort 8090
RTSPPort 8091
HTTPBindAddress 0.0.0.0
RTSPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 1000
CustomLog -

<Feed feed1.ffm>
File /tmp/feed1.ffm
FileMaxSize 200K
</Feed>
# MP3 audio
<Stream stream.mp3>
Feed feed1.ffm
Format rtp
AudioCodec libmp3lame
AudioChannels 2
AudioSampleRate 48000
AudioBitRate 256
Preroll 3
AVOptionAudio flags +global_header
NoVideo
</Stream>
<Stream stream.opu>
Feed feed1.ffm
Format rtp
AudioCodec libopus
AudioChannels 2
AudioSampleRate 48000
AudioBitRate 256
Preroll 3
AVOptionAudio flags +global_header
NoVideo
</Stream>



feeding ffserver with the command:


Code: Select all
/usr/bin/ffmpeg -re  -f alsa -i hw:Loopback,1,0 http ://127.0.0.1:8090/feed1.ffm
ffmpeg version 3.0.2 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-avresample --enable-fontconfig --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libdcadec --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-netcdf --enable-shared --enable-version3 --enable-x11grab --host-cflags='"-fPIC"'
  libavutil      55. 17.103 / 55. 17.103
  libavcodec     57. 24.102 / 57. 24.102
  libavformat    57. 25.100 / 57. 25.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 31.100 /  6. 31.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, alsa, from 'hw:Loopback,1,0':
  Duration: N/A, start: 1463735199.621069, bitrate: 1536 kb/s
    Stream #0:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
Output #0, ffm, to 'http ://127.0.0.1:8090/feed1.ffm':
  Metadata:
    creation_time   : 2016-05-20 11:06:39
    encoder         : Lavf57.25.100
    Stream #0:0: Audio: mp3 (libmp3lame), 48000 Hz, stereo, s32p, 256 kb/s
    Metadata:
      encoder         : Lavc57.24.102 libmp3lame
    Stream #0:1: Audio: opus (libopus), 48000 Hz, stereo, s16, 256 kb/s
    Metadata:
      encoder         : Lavc57.24.102 libopus
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le (native) -> mp3 (libmp3lame))
  Stream #0:0 -> #0:1 (pcm_s16le (native) -> opus (libopus))
Press [q] to stop, [?] for help
size=     388kB time=00:00:05.79 bitrate= 548.1kbits/s speed=   1x


ffplay can play the mp3 stream, but not the opus stream :

Code: Select all
ffplay -nodisp  rtsp://192.168.1.29:8091/stream.opu -loglevel debug
ffplay version 3.0.2 Copyright (c) 2003-2016 the FFmpeg developers
  built with gcc 5.3.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-avresample --enable-fontconfig --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libdcadec --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-netcdf --enable-shared --enable-version3 --enable-x11grab --host-cflags='"-fPIC"'
  libavutil      55. 17.103 / 55. 17.103
  libavcodec     57. 24.102 / 57. 24.102
  libavformat    57. 25.100 / 57. 25.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 31.100 /  6. 31.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[tcp @ 0xaa803e60] No default whitelist set   0KB sq=    0B f=0/0   
[rtsp @ 0xaa803900] SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Title
c=IN IP4 0.0.0.0
t=0 0
a=tool:libavformat 57.25.100
m=audio 0 RTP/AVP 96
b=AS:256
a=rtpmap:96 opus/48000/2
a=fmtp:96 sprop-stereo:1
a=control:streamid=0

[rtsp @ 0xaa803900] audio codec set to: opus
[rtsp @ 0xaa803900] audio samplerate set to: 48000
[rtsp @ 0xaa803900] audio channels set to: 2
[rtp @ 0xaa804ca0] No default whitelist set
[udp @ 0xaa800b30] No default whitelist set
[udp @ 0xaa800b30] end receive buffer size reported is 131072
[udp @ 0xaa800a50] No default whitelist set
[udp @ 0xaa800a50] end receive buffer size reported is 131072
[NULL @ 0xaa8071f0] setting jitter buffer size to 500    0B f=0/0   
[rtsp @ 0xaa803900] hello state=0
^C[root@music ~]# ffplay -nodisp  rtsp://192.168.1.29:8091/stream.mp3 -loglevel debug
ffplay version 3.0.2 Copyright (c) 2003-2016 the FFmpeg developers
  built with gcc 5.3.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-avresample --enable-fontconfig --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libdcadec --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-netcdf --enable-shared --enable-version3 --enable-x11grab --host-cflags='"-fPIC"'
  libavutil      55. 17.103 / 55. 17.103
  libavcodec     57. 24.102 / 57. 24.102
  libavformat    57. 25.100 / 57. 25.100
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 31.100 /  6. 31.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[tcp @ 0xaa803e60] No default whitelist set   0KB sq=    0B f=0/0   
[rtsp @ 0xaa803900] SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Title
c=IN IP4 0.0.0.0
t=0 0
a=tool:libavformat 57.25.100
m=audio 0 RTP/AVP 14
b=AS:256
a=control:streamid=0

[rtp @ 0xaa800b10] No default whitelist set
[udp @ 0xaa800640] No default whitelist set
[udp @ 0xaa800640] end receive buffer size reported is 131072
[udp @ 0xaa800480] No default whitelist set
[udp @ 0xaa800480] end receive buffer size reported is 131072
[NULL @ 0xaa800710] setting jitter buffer size to 500
[rtsp @ 0xaa803900] hello state=0
[rtsp @ 0xaa803900] All info found 0KB vq=    0KB sq=    0B f=0/0   
Input #0, rtsp, from 'rtsp://192.168.1.29:8091/stream.mp3':
  Metadata:
    title           : No Title
  Duration: N/A, start: 62041.891067, bitrate: 256 kb/s
    Stream #0:0, 2, 1/90000: Audio: mp3, 48000 Hz, stereo, s16p, 256 kb/s
detected 2 logical cores
[ffplay_abuffer @ 0xaa804210] Setting 'sample_rate' to value '48000'
[ffplay_abuffer @ 0xaa804210] Setting 'sample_fmt' to value 's16p'
[ffplay_abuffer @ 0xaa804210] Setting 'channels' to value '2'
[ffplay_abuffer @ 0xaa804210] Setting 'time_base' to value '1/48000'
[ffplay_abuffer @ 0xaa804210] Setting 'channel_layout' to value '0x3'
[ffplay_abuffer @ 0xaa804210] tb:1/48000 samplefmt:s16p samplerate:48000 chlayout:0x3
[ffplay_abuffersink @ 0xaa845080] auto-inserting filter 'auto-inserted resampler 0' between the filter 'ffplay_abuffer' and the filter 'ffplay_abuffersink'
[AVFilterGraph @ 0xaa8005f0] query_formats: 2 queried, 0 merged, 3 already done, 0 delayed
[auto-inserted resampler 0 @ 0xaa845810] [SWR @ 0xaa846250] Using s16p internally between filters
[auto-inserted resampler 0 @ 0xaa845810] ch:2 chl:stereo fmt:s16p r:48000Hz -> ch:2 chl:stereo fmt:s16 r:48000Hz
Audio frame changed from rate:48000 ch:2 fmt:s16p layout:stereo serial:-1 to rate:48000 ch:2 fmt:s16p layout:stereo serial:1
[ffplay_abuffer @ 0xac701bb0] Setting 'sample_rate' to value '48000'
[ffplay_abuffer @ 0xac701bb0] Setting 'sample_fmt' to value 's16p'
[ffplay_abuffer @ 0xac701bb0] Setting 'channels' to value '2'
[ffplay_abuffer @ 0xac701bb0] Setting 'time_base' to value '1/48000'
[ffplay_abuffer @ 0xac701bb0] Setting 'channel_layout' to value '0x3'
[ffplay_abuffer @ 0xac701bb0] tb:1/48000 samplefmt:s16p samplerate:48000 chlayout:0x3
[ffplay_abuffersink @ 0xac701f50] auto-inserting filter 'auto-inserted resampler 0' between the filter 'ffplay_abuffer' and the filter 'ffplay_abuffersink'
[AVFilterGraph @ 0xac7019e0] query_formats: 2 queried, 0 merged, 3 already done, 0 delayed
[auto-inserted resampler 0 @ 0xac7028b0] [SWR @ 0xac702ac0] Using s16p internally between filters
[auto-inserted resampler 0 @ 0xac7028b0] ch:2 chl:stereo fmt:s16p r:48000Hz -> ch:2 chl:stereo fmt:s16 r:48000Hz




Do I miss something in my ffserver section? Maybe some option to give to ffplay ( force input stream type? )
Any help is appreciated !

Alex
alexinthesky
 
Posts: 2
Joined: Fri May 20, 2016 9:02 am

Return to ffplay

Who is online

Users browsing this forum: No registered users and 1 guest