[Ffmpeg-devel] [PATCH] Sending more than one RTP streams

Kite Flyer kiteflyer77
Mon Apr 16 09:51:08 CEST 2007


Hi

On 4/12/07, Luca Abeni <lucabe72 at email.it> wrote:
> Hi
>
> Kite Flyer wrote:
> > Hi,
> >
> > I'm trying to stream *both* audio and video from an mpeg file to RTP
> > destination urls. This is what I'm doing:
> > -----
> > $ ./ffmpeg -f mpeg -i ../test/video/sample.mpeg -vcodec mpeg1video -b
> > 400kb -ac
> > odec mp2 -ab 56kb -f rtp rtp://192.168.50.7:6970
>
> You have to specify two RTP destinations (with different port numbers,
> for example).
> Try something like
> ./ffmpeg -re -i /tmp/test.mpg -vcodec copy -an \
> -f rtp rtp://127.0.0.1:10000 -i /tmp/test.mpg -vn \
> -acodec copy -f rtp rtp://127.0.0.1:20000
>
Great! "-re" option makes ffmpeg take entire audio/ video duration to
stream it. I need this.

> If I remember well, for this to work you would have to fix the "-an" and
> "-vn" options handling (the "video only" and "audio only" state is
> currently not reset at the new input file). I should have a patch for
> this; I'll send it later.
I'm doing the same in the attached patch. It should save time for new
people wanting to do the same.

>
>
> Obviously, you will have to generate the SDP file by hand...
I've tested (AMR-NB audio alongwith MPEG4 video) with QuickTime.
Another sample run output is attached:

$ ./ffmpeg -re -i ../test/video/sample.mpeg -vcodec copy -an -f rtp rtp://192.1
68.52.35:6970?localport=5004 -i ../test/video/sample.mpeg -acodec copy -vn -f r
tp rtp://192.168.52.35:6980?localport=5014
FFmpeg version SVN-r8743, Copyright (c) 2000-2007 Fabrice Bellard, et al.
  configuration: --enable-pthreads
  libavutil version: 49.4.0
  libavcodec version: 51.40.3
  libavformat version: 51.12.1
  built on Apr 16 2007 12:09:54, gcc: 3.4.4 (cygming special) (gdc 0.12, using d
md 0.125)
Input #0, mpeg, from '../test/video/sample.mpeg':
  Duration: 00:00:13.4, start: 1.053656, bitrate: 606 kb/s
  Stream #0.0[0x1e0]: Video: mpeg1video, yuv420p, 160x120, 400 kb/s, 25.00 fps(r
)
  Stream #0.1[0x1c0]: Audio: mp2, 44100 Hz, mono, 56 kb/s
Input #1, mpeg, from '../test/video/sample.mpeg':
  Duration: 00:00:13.4, start: 1.053656, bitrate: 606 kb/s
  Stream #1.0[0x1e0]: Video: mpeg1video, yuv420p, 160x120, 400 kb/s, 25.00 fps(r
)
  Stream #1.1[0x1c0]: Audio: mp2, 44100 Hz, mono, 56 kb/s
Output #0, rtp, to 'rtp://192.168.52.35:6970?localport=5004':
  Stream #0.0: Video: mpeg1video, yuv420p, 160x120, q=2-31, 400 kb/s, 25.00 fps(
c)
Output #1, rtp, to 'rtp://192.168.52.35:6980?localport=5014':
  Stream #1.0: Audio: mp2, 44100 Hz, mono, 56 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #0.1 -> #1.0
Press [q] to stop encoding
frame=  435 fps= 25 q=0.0 Lsize=     865kB time=17.3 bitrate= 408.3kbits/s
video:848kB audio:119kB global headers:0kB muxing overhead -10.594108%

$
>
>
>                                 Luca
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>
Thanks,
Subrata
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reset-an-vn-on-opt_input_file.patch
Type: application/octet-stream
Size: 311 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070416/a5a212b1/attachment.obj>



More information about the ffmpeg-devel mailing list