79267037

Date: 2024-12-10 04:51:30
Score: 0.5
Natty:
Report link

To answer my own question,

This was the right method, however, ffmpeg needs a lot of input data to start receiving the stream and the test files were simply not long enough.

So for testing I have changed from test files to test desktop captures.

I will now describe the new process.

On my monitor, I have two web pages with gifs playing in a loop.

I capture these using ffmpeg ddagrab functionality example : -filter_complex "ddagrab=...

and they are cropped using the crop function example : crop=649:461:16:475

Here are the two full transmitter command lines, transmitting to udp://239.0.0.1:9991 and udp://239.0.0.1:9992

ffmpeg -hide_banner -filter_complex "ddagrab=framerate=30:output_idx=1:video_size=3840x2160,hwdownload,format=bgra,crop=649:461:16:475,scale=1280:720[out]" -map "[out]" -colorspace bt709 -chroma_sample_location left -c:v h264_nvenc -preset p1 -tune ull -bufsize 600k -g 15 -pix_fmt nv12 -flags low_delay -f mpegts udp://239.0.0.1:9991

ffmpeg -hide_banner -filter_complex "ddagrab=framerate=30:output_idx=1:video_size=3840x2160,hwdownload,format=bgra,crop=649:461:16:1500,scale=1280:720[out]" -map "[out]" -colorspace bt709 -chroma_sample_location left -c:v h264_nvenc -preset p1 -tune ull -bufsize 600k -g 15 -pix_fmt nv12 -flags low_delay -f mpegts udp://239.0.0.1:9992

I have also prepared two receiver test windows using ffplay as follows

ffplay -hide_banner -fflags nobuffer -flags low_delay -probesize 32 -analyzeduration 0 -max_delay 0 "udp://239.0.0.1:9991

ffplay -hide_banner -fflags nobuffer -flags low_delay -probesize 32 -analyzeduration 0 -max_delay 0 "udp://239.0.0.1:9992

and lastly the ffmpeg concatenation command as previously described

ffmpeg -hide_banner -i "udp://239.0.0.1:9991" -i "udp://239.0.0.1:9992" -filter_complex "[0:v:0][1:v:0]hstack=inputs=2" -c:v libx264 -preset ultrafast -f mpegts "udp://239.0.0.1:9990"

This command is being run on a separate computer on the same LAN, L2 segment

lastly, another ffplay command listening on udp://239.0.0.1:9990 will receive the final product


A demonstration of this process can be observed here

https://youtu.be/lVSAH_58VR4

Here are a few observations

1 It takes a while to start

2 Latency is high (multiple seconds)

3 Once started, if either of the streams goes out, the full stream is out

4 If you accidentally send two stream in port 9991, as I did at the beginning, the stream will alternate but still work a little and not crash, impressive !

5 And the worst part, when the stream stops because one input is stopped, the working stream will remain in buffer. This will increase delay and the stream will be permanently be desynced as the buffer is never dropped

Please supply alternative answers to alleviate these shortcomings

thanks !

Reasons:
  • Blacklisted phrase (0.5): thanks
  • Blacklisted phrase (1): youtu.be
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
Posted by: Shodan