Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to multicast two videos to two different ports of a multicast address. I am able to send one video to one port at a time. But I want a command where both the videos are sent to the ports at the same time. I used the command

{ffmpeg -i  stream1_small.ts -vcodec copy -acodec copy -f mpegts -re "udp://239.101.101.1:1234?ttl=1&pkt_size=1316" &
ffmpeg -i  stream2_small.ts -vcodec copy -acodec copy -f mpegts -re "udp://239.101.101.1:1235?ttl=1&pkt_size=1316" &}

When i execute the command stream2_small.ts is streamed to the port 1235 but stream1_small.ts is giving a error as

Output #0, mpegts, to 'udp://239.101.101.1:1234?ttl=1&pkt_size=1315
':
  Metadata:
    encoder         : Lavf53.4.0
    Stream #0.0: Video: mpeg2video, yuv420p, 360x180 [PAR 8:9 DAR 16:9], q=2-31, 104857 kb/s, 90k tbn, 25 tbc
    Stream #0.1(eng): Audio: ac3, 48000 Hz, stereo, 96 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #0.1
Press [q] to stop, [?] for help
[mpegts @ 0xaacc360] max_analyze_duration 5000000 reached at 5000000

Please tell me what mistake i am doing

share|improve this question
up vote 4 down vote accepted

I'm not sure what this error is, but:

  • have you tried each (!) command separately - do they both in fact work?
  • have you tried running them in parallel, but each in its own shell?

It is however possible to stream them both with one ffmpeg command. Assuming each input has a single video and a single audio stream:

ffmpeg
  -i stream1_small.ts
  -i stream2_small.ts
  -vcodec copy -acodec copy -f mpegts -re "udp://239.101.101.1:1234?ttl=1&pkt_size=1316" -map 0.0 -map 0.1
  -vcodec copy -acodec copy -f mpegts -re "udp://239.101.101.1:1235?ttl=1&pkt_size=1316" -map 1.0 -map 1.1
share|improve this answer
    
Thanks lot Ambroz Bizjak... it worked for me... – iwant2learn Jul 20 '11 at 12:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .