[FFmpeg-devel] [PATCH] Realmedia / RTSP (RDT)

Michael Niedermayer michaelni
Thu Jan 3 22:29:25 CET 2008

On Thu, Jan 03, 2008 at 09:34:43AM -0500, Ronald S. Bultje wrote:
> in headers (specifying codec/bitrate/etc.), and then let ffplay select which
> one to use using .discard, send that to the server and start playing, but
> this doesn't appear to be used yet, so I guess some work in ffplay would be
> needed also, right? 


the selection can be best made by using eval.c functionality
that is for example:

ffplay -select_stream 'b*lte(b,100k)*lte(w,640)'

that would select the stream with the largest bitrate <= 100k and width <=640
"lte" means less than or equal (see eval.c)

the implementation would just look something like

for(i=0; i<nstreams; i++){
    AVStream *st= stream[i];
    int typ= st->codec.codec_type;
    values[0]= st->codec.bitrate;
    values[1]= st->codec.width;
    values[2]= st->codec.height;

    score= ff_parse_eval(e[typ], values, NULL);
    if(score > best_score[codec.typ]){
        stream[ best_i[typ] ]->discard= AVDISCARD_ALL;
        best_score[typ]= score;
        best_i[typ]= i;
        st->discard= AVDISCARD_ALL;


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080103/fd3c200c/attachment.pgp>

More information about the ffmpeg-devel mailing list