java - FFMpeg - Merge multiple rtmp stream inputs to a single rtmp output -


i'm trying combine/merge 2 rtmp streams , publish 'em stream

ex.:

ffmpeg -i rtmp://ip:1935/live/micmystream7 -i rtmp://ip:1935/live/mystream7  -strict -2  -f flv rtmp://ip:1935/live/bcove7 

the scenario following, got stream comes user's microphone first 1 (micmystream7) , got stream user 1 has audio , video(mystream7).

as talking each other when user speaking, other 1 listening , vice versa.

my idea set third stream called (bcove) "merge" both of them have spectators listening entire conversation between them.

this log ffmpeg printed although couldn't recognize message helped me out.

paulo@paulo-desktop:~$ ffmpeg -re -i rtmp://ip:1935/live/micmystream7 -i rtmp://ip:1935/live/mystream7  -strict -2  -f flv rtmp://ip:1935/live/bcove7 ffmpeg version n-56029-g2ffead9 copyright (c) 2000-2013 ffmpeg developers   built on sep  4 2013 11:05:57 gcc 4.7 (ubuntu/linaro 4.7.3-1ubuntu1)   configuration:    libavutil      52. 43.100 / 52. 43.100   libavcodec     55. 31.100 / 55. 31.100   libavformat    55. 16.100 / 55. 16.100   libavdevice    55.  3.100 / 55.  3.100   libavfilter     3. 83.102 /  3. 83.102   libswscale      2.  5.100 /  2.  5.100   libswresample   0. 17.103 /  0. 17.103 input #0, flv, 'rtmp://ip:1935/live/micmystream7':   metadata:     author          :      copyright       :      description     :      keywords        :      rating          :      title           :      presetname      : medium bandwidth (300 kbps) - vp6     creationdate    : wed sep  4 16:41:52 2013                     :      videodevice     : built-in isight     videokeyframe_frequency: 5     audiodevice     : external microphone     audiochannels   : 1     audioinputvolume: 75   duration: n/a, start: 0.000000, bitrate: 253 kb/s     stream #0:0: video: vp6f, yuv420p, 320x240, 204 kb/s, 44.83 tbr, 1k tbn, 1k tbc     stream #0:1: audio: mp3, 22050 hz, mono, s16p, 49 kb/s input #1, flv, 'rtmp://ip:1935/live/mystream7':   metadata:     author          :      copyright       :      description     :      keywords        :      rating          :      title           :      presetname      : custom     creationdate    : wed sep  4 12:02:24 2013                     :      videodevice     : facetime hd camera (built-in)     videokeyframe_frequency: 5     audiodevice     : internal microphone     audiochannels   : 1     audioinputvolume: 75   duration: n/a, start: 0.000000, bitrate: 253 kb/s     stream #1:0: video: vp6f, yuv420p, 320x240, 204 kb/s, 45.08 tbr, 1k tbn, 1k tbc     stream #1:1: audio: mp3, 22050 hz, mono, s16p, 49 kb/s output #0, flv, 'rtmp://ip:1935/live/bcove7':   metadata:     author          :      copyright       :      description     :      keywords        :      rating          :      title           :      presetname      : medium bandwidth (300 kbps) - vp6     creationdate    : wed sep  4 16:41:52 2013                     :      videodevice     : built-in isight     videokeyframe_frequency: 5     audiodevice     : external microphone     audiochannels   : 1     audioinputvolume: 75     encoder         : lavf55.16.100     stream #0:0: video: flv1 (flv) ([2][0][0][0] / 0x0002), yuv420p, 320x240, q=2-31, 200 kb/s, 1k tbn, 44.83 tbc     stream #0:1: audio: adpcm_swf ([1][0][0][0] / 0x0001), 22050 hz, mono, s16, 88 kb/s stream mapping:   stream #0:0 -> #0:0 (vp6f -> flv)   stream #0:1 -> #0:1 (mp3 -> adpcm_swf) press [q] stop, [?] [mp3 @ 0x3625ec0] overread, skip -9 enddists: -3 -300:14.44 bitrate= 224.0kbits/s     [mp3 @ 0x3625ec0] overread, skip -7 enddists: -3 -30:26.39 bitrate= 203.5kbits/s   

thanks in advance

copy video stream , merge 2 mono steams

try amerge audio filter:

ffmpeg -i rtmp://ip:1935/live/micmystream7 -i rtmp://ip:1935/live/mystream7 \ -codec:v copy -filter_complex "[0:a][1:a]amerge" -codec:a aac -strict -2 \ -f flv rtmp://ip:1935/live/bcove7 

...or use -ac 2:

ffmpeg -i rtmp://ip:1935/live/micmystream7 -i rtmp://ip:1935/live/mystream7 \ -codec:v copy -ac 2 -codec:a aac -strict -2 -f flv rtmp://ip:1935/live/bcove7 

i added -codec:v copy stream copy video instead of re-encoding it. unable try commands right now, untested, , not able reply until monday.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -