Hey guys, i'm new here. Based on you guys's post, i have been looking to do this picture to picture without a udp server, so I used point to point. here is how I make it work:
on the sender side, i would have this command ready to go: (don't start until receiver starts)
/usr/local/ffmpeg/bin/ffmpeg -loglevel fatal -re -i input_1 -re -i link_2 -filter_complex "[1]scale=iw/3:ih/3 [pip]; [0][pip] overlay=main_w-overlay_w-10:main_h-overlay_h-10[v]" -map "[v]" -map 0:1 -map 1:1 -metadata:s:a:0 language=bul -metadata:s:a:0 title="BTV" -metadata:s:a:1 language=eng -metadata:s:a:1 title="NOVA" -strict -2 -ac 2 -ar 44100 -vcodec libx264 -preset ultrafast -acodec aac -metadata service_provider=PiP -metadata service_name=BTV+NOVA -f mpegts tcp://receiver_IP:receiver_Port
on the receiver side, in my case it's tvh's mux, use command list this, this will have both audio track to select:
pipe:///usr/local/ffmpeg/bin/ffmpeg -i tcp://receiver_IP:receiver_Port?listen -map 0:0 -map 0:1 -map 0:2 -c:v copy -c:a:0 copy -c:a:1 copy -f mpegts pipe:1
receiver_IP is simply tvh's local ip address.
now play this mux, wait a few second, then start the sender command. you'll be able to find service and create channel from there.
Once you have the channel, always start playing channel first, wait a few second, then start the sender command (otherwise, the command will quit itself because there's no receiver found I guess).
i don't know how to do it using udp.
hope this helps.