0

I'm trying to setup ultra-low p2p streaming using FFMPEG and MPlayer with MPEG-TS stream over TCP. As aac codec introduces notable additional latency, I'd like to use libopus instead. When I do so, MPlayer behaves strangely and refuses to play audio, while seemingly detecting correct codec in stream.

Here's ffmpeg command I'm using:

ffmpeg -f x11grab -s 1920x1080 -framerate 60 -i :0.0 -f pulse -ac 2 -i Virtual1.monitor -c:v h264_nvenc -preset llhq -b:v 8000k -profile:v high -rc:v cbr_ld_hq -c:a libopus -b:a 224k -ar 48000 -f mpegts tcp://127.0.0.1:2000

And here is MPlayer and its output:

v@v-home:~$ mplayer -benchmark -demuxer lavf ffmpeg://tcp://127.0.0.1:2000?listen
MPlayer 1.3.0 (Debian), built with gcc-9 (C) 2000-2016 MPlayer Team
do_connect: could not connect to socket
connect: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing ffmpeg://tcp://127.0.0.1:2000?listen.
libavformat version 58.29.100 (external)
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (opus), -aid 0
LAVF: Program 1
VIDEO:  [H264]  1920x1080  0bpp  60.000 fps    0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 58.54.100 (external)
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Cannot find codec for audio format 0x7375704F.
Audio: no sound
Starting playback...
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [vdpau] 1920x1080 => 1920x1080 Planar YV12
V:  32.1   0/  0 22%  7%  0.0% 0 0


MPlayer interrupted by signal 2 in module: video_read_frame
V:  32.1   0/  0 22%  7%  0.0% 0 0

Exiting... (Quit)

Specifying -ac libopus to MPlayer doesn't help but only adds a line that codec was forced to use. aac and libmp3lame codecs work just fine while with speex MPlayer doesn't detect audio at all.

This stream also can be played just fine with ffplay (with audio), but it doesn't fit for my use case due to higher latency it have compared to MPlayer.

0 Answers0