Changeset d1e3b1c2518db752f9e31fba2219010d7188003e

Show
Ignore:
Timestamp:
30/06/08 13:42:36 (4 months ago)
Author:
Antoine Cellerier <dionoea@videolan.org>
git-committer:
Antoine Cellerier <dionoea@videolan.org> 1214826156 +0200
git-parent:

[fbaa0ee2d65c9c98b982f27d0b0a541892dda59d]

git-author:
Georgi Chorbadzhiyski <gf@unixsol.org> 1214816434 +0300
Message:

Add --sout-asf-bitrate-override setting to ASF muxer

This patch adds setting to override calculated bit rate outputted
into ASF stream. This is needed in the cases where ASF muxer
receives stream in TS (for example) and can't correctly determine
what output bit rate should be.

Windows Media Player actually uses ASF bitrate setting to calculate
how much to cache and if the output bit rate is wrong it tries to
cache too much or too little.

To test the behaviour before this patch try to stream WMV in TS
container to another VLC that remuxes it into ASF. Open the remuxed
stream into WMP and you'll see how it tries to cache 1%, 2%, 3%
and so on...

Signed-off-by: Antoine Cellerier <dionoea@videolan.org>

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/mux/asf.c

    rfbaa0ee rd1e3b1c  
    6262#define PACKETSIZE_TEXT N_("Packet Size") 
    6363#define PACKETSIZE_LONGTEXT N_("ASF packet size -- default is 4096 bytes") 
     64#define BITRATE_TEXT N_("Bitrate override") 
     65#define BITRATE_LONGTEXT N_("Do not try to guess ASF bitrate. Setting this, allows you to control how Windows Media Player will cache streamed content. Set to audio+video bitrate in bytes") 
     66 
    6467 
    6568vlc_module_begin(); 
     
    8689    add_integer( SOUT_CFG_PREFIX "packet-size", 4096, NULL, PACKETSIZE_TEXT, 
    8790                                 PACKETSIZE_LONGTEXT, VLC_TRUE ); 
     91    add_integer( SOUT_CFG_PREFIX "bitrate-override", 0, NULL, BITRATE_TEXT, 
     92                                 BITRATE_LONGTEXT, VLC_TRUE ); 
    8893 
    8994vlc_module_end(); 
     
    131136    mtime_t         i_preroll_time; 
    132137    int64_t         i_bitrate; 
     138    int64_t         i_bitrate_override; 
    133139 
    134140    int             i_track; 
     
    208214    p_sys->i_preroll_time = 2000; 
    209215    p_sys->i_bitrate    = 0; 
     216    p_sys->i_bitrate_override = 0; 
    210217    p_sys->i_seq        = 0; 
    211218 
     
    213220    p_sys->i_track = 0; 
    214221    p_sys->i_packet_size = config_GetInt( p_mux, "sout-asf-packet-size" ); 
     222    p_sys->i_bitrate_override = config_GetInt( p_mux, "sout-asf-bitrate-override" ); 
    215223    msg_Dbg( p_mux, "Packet size %d", p_sys->i_packet_size); 
     224    if (p_sys->i_bitrate_override) 
     225        msg_Dbg( p_mux, "Bitrate override %d", p_sys->i_bitrate_override); 
    216226    p_sys->i_packet_count= 0; 
    217227 
     
    482492                p_sys->i_bitrate += 512000; 
    483493            } 
     494            if (p_sys->i_bitrate_override) 
     495                p_sys->i_bitrate = p_sys->i_bitrate_override; 
    484496            break; 
    485497        } 
     
    566578                p_sys->i_bitrate += 1000000; 
    567579            } 
     580            if (p_sys->i_bitrate_override) 
     581                p_sys->i_bitrate = p_sys->i_bitrate_override; 
    568582            break; 
    569583        }