
Estoy intentando configurar una transmisión p2p ultrabaja usando FFMPEG y MPlayer con transmisión MPEG-TS a través de TCP. Como aac
el códec introduce una latencia adicional notable, me gustaría usarlo libopus
en su lugar. Cuando lo hago, MPlayer se comporta de manera extraña y se niega a reproducir audio, mientras aparentemente detecta el códec correcto en la transmisión.
Aquí está el comando ffmpeg que estoy usando:
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
Y aquí está MPlayer y su resultado:
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)
Especificar -ac libopus
MPlayer no ayuda, solo agrega una línea que el códec se vio obligado a usar. aac
y libmp3lame
los códecs funcionan bien mientras que speex
MPlayer no detecta audio en absoluto.
Esta transmisión también se puede reproducir bien ffplay
(con audio), pero no se ajusta a mi caso de uso debido a la mayor latencia que tiene en comparación con MPlayer.