atyenoria / janus-webrtc-gateway-docker

Perfect Docker Image for Media Streaming Expert User ( https://github.com/meetecho/janus-gateway )
688 stars 200 forks source link

'Address already in use' issue #47

Closed wmajerski closed 1 year ago

wmajerski commented 4 years ago

Hi there, I'm trying to understand how to use SDP generated by Janus to use by ffmpeg.

Should I just grab SDP as it is from Janus Admin panel or Chrome Dev Tools and put it into a standalone file? Whenever I do so and try to run the ffmpeg provided in the documentation:

ffmpeg -analyzeduration 300M -probesize 300M -protocol_whitelist file,udp,rtp -i $SDP_FILE -c:v copy -c:a aac -ar 16k -ac 1 -preset ultrafast -tune zerolatency -f flv rtmp://$IP:$PORT/rtmp_relay/atyenoria

I get the following error:

[udp @ 0x55ad1d9f6300] bind failed: Address already in use

Should the SDP be edited manually after it's copied from Janus?

Another thing is: I'm getting an error regarding flv - vp8 compatibility when I run the ffpeg command:

ffmpeg -analyzeduration 300M -probesize 300M -protocol_whitelist file,udp,rtp -i $SDP_FILE -c:v copy -c:a aac -ar 16k -ac 1 -preset ultrafast -tune zerolatency -f flv rtmp://$IP:$PORT/rtmp_relay/atyenoria

[flv @ 0x55e2a7cfcc00] Video codec vp8 not compatible with flv

Do you have any idea why I'm getting this? My Janus room is configured to use 'vp8', also my SDP expects VP8.

When I replace -c:v copy with -c:v h264 I'm able to forward the stream:

ffmpeg -analyzeduration 300M -probesize 300M -protocol_whitelist file,udp,rtp -i $SDP_FILE -c:v h264 -c:a aac -ar 16k -ac 1 -preset ultrafast -tune zerolatency -f flv rtmp://$IP:$PORT/rtmp_relay/atyenoria

Please advise and thank you for your work!

dvision1979 commented 4 years ago

Hi @wmajerski Indeed you need to transcode the vp8 video to H264 and the PCM audio to AAC and encapsulate in FLV format, according to RTMP specs. Can you share the details on how were you able to forward the stream. How did you produce the SDP file and so on? I am trying to stream from the video room test plugin/demo to ffmpeg. Thank you in advance.

yangjiaojiao commented 3 years ago

Is your problem solved?@wmajerski

probeData.buf_size= 0x259../Utils/FFmpegDemuxer.h 0x9a [INFO ][19:27:39] FFmpeg avformat_open_input before../Utils/FFmpegDemuxer.h 0x9e Input #0, sdp, from '': Duration: 00:00:00.00, start: 0.000000, bitrate: N/A [INFO ][19:27:39] FFmpeg av_dump_format../Utils/FFmpegDemuxer.h 0xa2 [udp @ 0x7f96288482c0] bind failed: Address already in use [INFO ][19:27:39] FFmpeg avformat_open_input after../Utils/FFmpegDemuxer.h 0xa5 Segmentation fault (core dumped)

how to fix ? i also add ffmpeg to janus , faced same problem .