[FFmpeg-devel] got RTP encoding to support XVID codec

Nash Tsai nash.tsai
Fri Mar 12 10:45:20 CET 2010


Hi,

I've got RTP encoding to support XVID and works great with VLC media
player with its output SDP, will be great if you can accept this
patch.

> ffmpeg.exe -v 9 -f vfwcap -r 30 -i 0 -vcodec libxvid -s 640x480 -b 400kb -aspect 4:3 -f rtp rtp://localhost:5004
FFmpeg version SVN-r22452, Copyright (c) 2000-2010 the FFmpeg developers
  built on Mar 12 2010 16:55:52 with gcc 3.4.5 (mingw-vista special r3)
  configuration: --enable-static --disable-shared --enable-memalign-hack --enabl
e-gpl --enable-version3 --enable-libxvid
  libavutil     50.11. 0 / 50.11. 0
  libavcodec    52.58. 0 / 52.58. 0
  libavformat   52.55. 0 / 52.55. 0
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.10. 0 /  0.10. 0
[vfwcap @ 0172d8c0]Estimating duration from bitrate, this may be inaccurate
Input #0, vfwcap, from '0':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: mjpeg, yuvj422p, 640x480, 30 tbr, 1k tbn, 30 tbc
nash log: av_encode
Output #0, rtp, to 'rtp://localhost:5004':
  Metadata:
    encoder         : Lavf52.55.0
    Stream #0.0: Video: libxvid, yuv420p, 640x480 [PAR 1:1 DAR 4:3], q=2-31, 400
 kb/s, 90k tbn, 30 tbc
Stream mapping:
  Stream #0.0 -> #0.0
SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 127.0.0.1
t=0 0
a=tool:libavformat 52.55.0
m=video 5004 RTP/AVP 96
b=AS:400
a=rtpmap:96 MP4V-ES/90000
a=fmtp:96 profile-level-id=1

Press [q] to stop encoding
*** 4 dup!
*** 4 dup!
frame=   11 fps=  0 q=6.0 size=      39kB time=0.37 bitrate= 860.4kbits/s dup=8
*** 5 dup!
*** 5 dup!
frame=   23 fps=  0 q=8.0 Lsize=      72kB time=0.77 bitrate= 773.1kbits/s dup=1
8 drop=0
video:72kB audio:0kB global headers:0kB muxing overhead 1.069490%
Received signal 2: terminating.

BR,
Nash
-------------- next part --------------
Index: libavformat/rtpenc.c
===================================================================
--- libavformat/rtpenc.c	(revision 22452)
+++ libavformat/rtpenc.c	(working copy)
@@ -54,6 +54,7 @@
     case CODEC_ID_MPEG2TS:
     case CODEC_ID_AMR_NB:
     case CODEC_ID_AMR_WB:
+    case CODEC_ID_XVID:
         return 1;
     default:
         return 0;
Index: libavformat/sdp.c
===================================================================
--- libavformat/sdp.c	(revision 22452)
+++ libavformat/sdp.c	(working copy)
@@ -226,6 +226,7 @@
             av_strlcatf(buff, size, "a=rtpmap:%d H263-2000/90000\r\n", payload_type);
             break;
         case CODEC_ID_MPEG4:
+        case CODEC_ID_XVID:
             if (c->extradata_size) {
                 config = extradata2config(c);
             }



More information about the ffmpeg-devel mailing list