Bit Rate to High

About encoding, codec settings, muxers and filter usage
miguelal
New Cone
New Cone
Posts: 4
Joined: 21 Aug 2007 03:33

Bit Rate to High

Postby miguelal » 21 Aug 2007 05:22

I setup this example http://wiki.videolan.org/Streaming_to_A ... dia_Player on a Debian server.

So computer A is a laptop with webcam streaming with the following command line:

c:\progra~1\videolan\vlc\vlc.exe -vvv -I http --ttl 12 dshow:// vdev="USB Video Device" adev="DVC" size="320x240" --sout #transcode{vcodec=DIV3,vb=64,scale=1,acodec=mp3,ab=16,channels=1}:duplicate{dst=std{access=mmsh,mux=asfh,dst=192.168.2.140:8888}}

If I use Windows Media Player on my desktop computer inside the 192.168.2.0 network with http://192.168.2.140:8888 I get a 92 Kbps stream. Perfect.

Computer B is the dedicated Debian Linux Server I hired from a Hosting Company where I setup VLC running with the following command:

vlc -vvv -I http mmsh://COMPUTERAIP:8888 --sout='#standard{access=mmsh,mux=asfh,url=DEBIANIP:8888}'

Computer C is my desktop computer and opening an URL in Windows Media Player to http://DEBIANIP:8888 I see the stream I want but apparently at 1.01 Mbps !!!

I shutter to think the bandwidth I'll use when 100 people are looking!

I tried limiting the rate changing the Debian vlc command line to:

vlc -vvv -I http mmsh://COMPUTERAIP:8888 --sout='#transcode{vb=64, ab=16}:standard{access=mmsh,mux=asfh,url=DEBIANIP:8888}'

and although looking at my log file vlc seems to accept it when I look at the properties Windows Media Player is reporting I still get 1.01Mbps!

How do I limit this enormous bit rate?

funman
Developer
Developer
Posts: 1159
Joined: 03 Sep 2006 04:03
VLC version: master
Operating System: All of them
Location: Lost, please help me

Re: Bit Rate to High

Postby funman » 22 Aug 2007 01:40

please paste the vlc log

miguelal
New Cone
New Cone
Posts: 4
Joined: 21 Aug 2007 03:33

Re: Bit Rate to High

Postby miguelal » 22 Aug 2007 17:15

Here it is.

-- logger module started --
main debug: CPU has capabilities 486 586 MMX MMXEXT SSE SSE2 FPU
main debug: looking for memcpy module: 1 candidate
main debug: using memcpy module "memcpy"
main debug: waiting for thread completion
main debug: thread 1131813808 (playlist) created at priority 0 (playlist/playlist.c:184)
main debug: waiting for thread completion
main debug: thread 1140202416 (preparser) created at priority 0 (playlist/playlist.c:210)
main debug: looking for interface module: 1 candidate
main debug: using interface module "hotkeys"
main debug: thread 1148591024 (interface) created at priority 0 (interface/interface.c:231)
main debug: looking for interface module: 1 candidate
main debug: using interface module "screensaver"
main debug: thread 1156979632 (interface) created at priority 0 (interface/interface.c:231)
main debug: looking for interface module: 1 candidate
logger: using logger...
logger debug: opening logfile `/var/log/vlc/vlc.log'
main debug: using interface module "logger"
main debug: thread 1165368240 (interface) created at priority 0 (interface/interface.c:231)
main debug: adding playlist item `mmsh://refresh.ath.cx:8888' ( mmsh://refresh.ath.cx:8888 )
main debug: adding playlist item `/var/run/vlc.pid' ( /var/run/vlc.pid )
main debug: looking for interface module: 6 candidates
dummy: using the dummy interface module...
main debug: using interface module "dummy"
main debug: thread 1173756848 (manager) created at priority 0 (interface/interface.c:216)
main debug: creating new input thread
main debug: waiting for thread completion
main debug: creating statistics handler
main debug: stream=`standard'
main debug: looking for sout stream module: 1 candidate
main debug: set sout option: sout-standard-access to mmsh
main debug: set sout option: sout-standard-mux to asfh
main warning: Option sout-standard-url is deprecated. You should use sout-standard-dst instead.
main debug: set sout option: sout-standard-dst to 81.92.213.177:8889
stream_out_standard debug: creating `mmsh/asfh://81.92.213.177:8889'
stream_out_standard debug: extension is 177:8889
stream_out_standard debug: extension -> mux=(null)
stream_out_standard debug: using `mmsh/asfh://81.92.213.177:8889'
main debug: looking for sout access module: 1 candidate
main: creating httpd
main debug: net: listening to 81.92.213.177 port 8889
main debug: thread 1182145456 (input) created at priority 0 (input/input.c:266)
main debug: thread 1190534064 (httpd host thread) created at priority 0 (network/httpd.c:1078)
main debug: using sout access module "access_output_http"
stream_out_standard debug: access opened
main debug: looking for sout mux module: 1 candidate
mux_asf debug: asf muxer opened
mux_asf debug: creating asf stream to be used with mmsh
mux_asf debug: Packet size 4096
mux_asf debug: meta data: title='', author='', copyright='', comment='', rating=''
main debug: using sout mux module "mux_asf"
main debug: muxer support adding stream at any time
main debug: muxer prefers to wait for all ES before starting to mux
stream_out_standard debug: mux opened
main debug: using sout stream module "stream_out_standard"
main debug: `/var/run/vlc.pid' gives access `' demux `' path `/var/run/vlc.pid'
main debug: creating demux: access='' demux='' path='/var/run/vlc.pid'
main debug: looking for access_demux module: 2 candidates
main debug: creating access '' path='/var/run/vlc.pid'
main debug: looking for access2 module: 5 candidates
vcd debug: trying .cue file: /var/run/vlc.cue
access_file debug: opening file `/var/run/vlc.pid'
main debug: using access2 module "access_file"
main debug: pre-buffering...
main debug: received first data for our buffer
main debug: creating demux: access='' demux='' path='/var/run/vlc.pid'
main debug: looking for demux2 module: 44 candidates
dtssys warning: cannot peek()
a52sys warning: cannot peek()
ffmpeg debug: couldn't guess format
ps warning: this does not look like an MPEG PS stream, continuing anyway
main debug: using demux2 module "ps"
main debug: looking for a subtitle file in /var/run/
main debug: starting in sync mode
main debug: `/var/run/vlc.pid' successfully opened
ps warning: garbage at input, trying to resync...
main debug: EOF reached
main debug: closing input
main debug: removing module "ps"
main debug: removing module "access_file"
main debug: destroying sout
main debug: destroying chain... (name=standard)
mux_asf debug: Asf muxer closed
access_output_http warning: HTTP sout access cannot seek
main debug: removing module "mux_asf"
main debug: thread 1190534064 joined (network/httpd.c:1134)
main debug: HTTP host removed
main debug: no host left, stopping httpd
access_output_http debug: Close
main debug: removing module "access_output_http"
main debug: removing module "stream_out_standard"
main debug: destroying chain done
main debug: thread 1182145456 joined (input/input.c:413)
main debug: creating new input thread
main debug: waiting for thread completion
main debug: stream=`standard'
main debug: looking for sout stream module: 1 candidate
main debug: thread 1182145456 (input) created at priority 0 (input/input.c:266)
main debug: set sout option: sout-standard-access to mmsh
main debug: set sout option: sout-standard-mux to asfh
main warning: Option sout-standard-url is deprecated. You should use sout-standard-dst instead.
main debug: set sout option: sout-standard-dst to 81.92.213.177:8889
stream_out_standard debug: creating `mmsh/asfh://81.92.213.177:8889'
stream_out_standard debug: extension is 177:8889
stream_out_standard debug: extension -> mux=(null)
stream_out_standard debug: using `mmsh/asfh://81.92.213.177:8889'
main debug: looking for sout access module: 1 candidate
main: creating httpd
main debug: net: listening to 81.92.213.177 port 8889
main debug: thread 1190534064 (httpd host thread) created at priority 0 (network/httpd.c:1078)
main debug: using sout access module "access_output_http"
stream_out_standard debug: access opened
main debug: looking for sout mux module: 1 candidate
mux_asf debug: asf muxer opened
mux_asf debug: creating asf stream to be used with mmsh
mux_asf debug: Packet size 4096
mux_asf debug: meta data: title='', author='', copyright='', comment='', rating=''
main debug: using sout mux module "mux_asf"
main debug: muxer support adding stream at any time
main debug: muxer prefers to wait for all ES before starting to mux
stream_out_standard debug: mux opened
main debug: using sout stream module "stream_out_standard"
main debug: `mmsh://refresh.ath.cx:8888' gives access `mmsh' demux `' path `refresh.ath.cx:8888'
main debug: creating demux: access='mmsh' demux='' path='refresh.ath.cx:8888'
main debug: looking for access_demux module: 0 candidates
main warning: no access_demux module matched "mmsh"
main debug: creating access 'mmsh' path='refresh.ath.cx:8888'
main debug: looking for access2 module: 6 candidates
main debug: net: connecting to refresh.ath.cx port 8888
main debug: connection in progress
main debug: Connection from 83.132.159.182
access_mms debug: HTTP reply 'HTTP/1.0 200 OK'
access_mms debug: stream type = broadcast
main debug: Connection from 213.60.102.192
access_mms error: cannot read data
access_mms debug: complete header size=717
access_mms debug: packet count=4294967295 packet size=4096
access_mms debug: starting stream
main debug: net: connecting to refresh.ath.cx port 8888
main debug: connection in progress
main debug: Connection from 85.240.129.110
main debug: Connection from 86.210.152.228
main debug: Connection from 213.13.123.162
main debug: Connection from 84.91.17.31
access_mms debug: HTTP reply 'HTTP/1.0 200 OK'
access_mms debug: Content-type: application/octet-stream
access_mms debug: Server: Cougar 4.1.0.3921
access_mms debug: Pragma: no-cache
access_mms debug: Pragma: client-id=26500
access_mms debug: Pragma: features="broadcast"
access_mms debug: Cache-Control: no-cache
main debug: using access2 module "access_mms"
main debug: pre-buffering...
main debug: Connection from 193.251.3.194
access_mms warning: packet lost ? (0 != 1)
main debug: Connection from 85.240.121.203
access_mms warning: packet lost ? (8884 != 1)
main debug: Connection from 201.78.238.219
main debug: Connection from 85.240.138.86
main debug: Connection from 87.196.153.73
main debug: Connection from 77.54.62.2
main debug: Connection from 89.180.22.233
main debug: received first data for our buffer
main debug: Connection from 89.181.92.51
main debug: Connection from 201.32.241.78
main debug: Connection from 81.38.119.187
main debug: Connection from 199.67.203.142
main debug: Connection from 85.241.170.146
main debug: pre-buffering done 24576 bytes in 1s - 12 kbytes/s
main debug: creating demux: access='mmsh' demux='' path='refresh.ath.cx:8888'
main debug: looking for demux2 module: 44 candidates
asf debug: found object guid: 0x75b22630-0x668e-0x11cf-0xa6d900aa0062ce6c size:667
asf debug: read "header object" subobj:5, reserved1:1, reserved2:2
asf debug: found object guid: 0x8cabdca1-0xa947-0x11cf-0x8ee400c00c205365 size:104
asf debug: read "file properties object" file_id:0xbabac001-0xae05-0xce07-0x37c1e192fbcc2c2a file_size:717 creation_date:0 data_packets_count:4294967295 play_duration:0 send_duration:0 preroll:2000 flags:1 min_data_packet_size:4096 max_data_packet_size:4096 max_bitrate:96000
asf debug: found object guid: 0x5fbf03b5-0xa92e-0x11cf-0x8ee300c00c205365 size:156
asf debug: read "header extension object" reserved1:0xabd3d211-0xa9ba-0x11cf-0x8ee600c00c205365 reserved2:6 header_extension_size:110
asf debug: found object guid: 0xc5f8cbea-0x5baf-0x4877-0x8467aa8c44fa4cca size:110
asf debug: read "metadata object" 2 entries
asf debug: - AspectRatioX=1
asf debug: - AspectRatioY=1
asf debug: found object guid: 0xb7dc0791-0xa9b7-0x11cf-0x8ee600c00c205365 size:108
asf debug: read "stream Properties object" stream_type:0xf8699e40-0x5b4d-0x11cf-0xa8fd00805f5c442b error_correction_type:0x20fb5700-0x5b55-0x11cf-0xa8fd00805f5c442b time_offset:0 type_specific_data_length:30 error_correction_data_length:0 flags:0x1 stream_number:1
asf debug: found object guid: 0xb7dc0791-0xa9b7-0x11cf-0x8ee600c00c205365 size:129
asf debug: read "stream Properties object" stream_type:0xbc19efc0-0x5b4d-0x11cf-0xa8fd00805f5c442b error_correction_type:0x20fb5700-0x5b55-0x11cf-0xa8fd00805f5c442b time_offset:0 type_specific_data_length:51 error_correction_data_length:0 flags:0x2 stream_number:2
asf debug: found object guid: 0x86d15240-0x311d-0x11d0-0xa3a400a0c90348f6 size:140
asf debug: read "codec list object" reserved_guid:0x86d15241-0x311d-0x11d0-0xa3a400a0c90348f6 codec_entries_count:2
asf debug: - codec[0] audio name:"MPEG Audio Layer 3" description:"" information_length:2
asf debug: - codec[1] video name:"MSMPEG-4 V3 Video" description:"" information_length:4
asf debug: found object guid: 0x75b22636-0x668e-0x11cf-0xa6d900aa0062ce6c size:50
asf debug: read "data object" file_id:0xbabac001-0xae05-0xce07-0x37c1e192fbcc2c2a total data packet:0 reserved:257
asf debug: + 'Unknown' GUID 0x0-0x0-0x0-0x0000000000000000 size:0pos:0
asf debug: + 'Header' GUID 0x75b22630-0x668e-0x11cf-0xa6d900aa0062ce6c size:667pos:0
asf debug: | + 'File Properties' GUID 0x8cabdca1-0xa947-0x11cf-0x8ee400c00c205365 size:104pos:30
asf debug: | + 'Header Extension' GUID 0x5fbf03b5-0xa92e-0x11cf-0x8ee300c00c205365 size:156pos:134
asf debug: | | + 'Metadata' GUID 0xc5f8cbea-0x5baf-0x4877-0x8467aa8c44fa4cca size:110pos:180
asf debug: | + 'Stream Properties' GUID 0xb7dc0791-0xa9b7-0x11cf-0x8ee600c00c205365 size:108pos:290
asf debug: | + 'Stream Properties' GUID 0xb7dc0791-0xa9b7-0x11cf-0x8ee600c00c205365 size:129pos:398
asf debug: | + 'Codec List' GUID 0x86d15240-0x311d-0x11d0-0xa3a400a0c90348f6 size:140pos:527
asf debug: + 'Data' GUID 0x75b22636-0x668e-0x11cf-0xa6d900aa0062ce6c size:50pos:667
asf debug: found 2 streams
main debug: selecting program id=0
asf debug: added new audio stream(codec:0x55,ID:1)
asf debug: added new video stream(ID:2)
main debug: using demux2 module "asf"
main debug: looking for packetizer module: 17 candidates
main debug: using packetizer module "mpeg_audio"
main debug: stream out mode -> no decoder thread
main debug: looking for packetizer module: 17 candidates
main debug: using packetizer module "packetizer_copy"
main debug: stream out mode -> no decoder thread
main debug: starting in sync mode
access_mms warning: unimplemented query in control
main debug: `mmsh://refresh.ath.cx:8888' successfully opened
packetizer_copy debug: need dts > 0
packetizer_copy debug: need dts > 0
packetizer_copy debug: need dts > 0
packetizer_copy debug: need dts > 0
packetizer_copy debug: need dts > 0
packetizer_copy debug: need dts > 0
mpeg_audio debug: MPGA channels:2 samplerate:44100 bitrate:32
main debug: adding a new input
main debug: adding a new input
mux_asf debug: adding input
mux_asf debug: adding mp3 header
main debug: adding a new input
main debug: adding a new input
mux_asf debug: adding input
mux_asf debug: Asf muxer creating header
mux_asf debug: pixel aspect-ratio: 1/1

Voz
New Cone
New Cone
Posts: 1
Joined: 09 Sep 2007 15:05

Re: Bit Rate to High

Postby Voz » 11 Sep 2007 15:19

Hi,

How did you solve this?

Matt
Last edited by Voz on 13 Sep 2007 14:08, edited 1 time in total.

funman
Developer
Developer
Posts: 1159
Joined: 03 Sep 2006 04:03
VLC version: master
Operating System: All of them
Location: Lost, please help me

Re: Bit Rate to High

Postby funman » 11 Sep 2007 17:37

you don't specify acodec and vcodec, hence no transcoding happens at all

olegkirillov
Blank Cone
Blank Cone
Posts: 46
Joined: 29 Jun 2008 21:04

Re: Bit Rate to High

Postby olegkirillov » 07 Jul 2008 12:07

Popping the topic up.
I've encountered the same issue streaming from VLC to TVUBroadcaster application. Tried both 0.8.6h (WindowsXPSP2) and 0.9.0 (Centos 5.2) from 20080706 snapshot (built from source).
The sympthom is that VLC does not limit its bitrate when there's no transcoding. I'm streaming preencoded (2-pass CBR for the best possible quality) WMVs of the same res/codec/bitrate (256K) so I do not need to transcode. But TVUBroadcaster is getting flooded by exactly 1024 kbit stream and cannot keep up.
Is there any workaround for this (to conform the stream bitrate to codec's actual bitrate) or I have to hack source to solve my problem?

olegkirillov
Blank Cone
Blank Cone
Posts: 46
Joined: 29 Jun 2008 21:04

Re: Bit Rate to High

Postby olegkirillov » 08 Jul 2008 01:36

Went through stream_output.c, packetizer/copy.c, asf.c - yet have no idea where the rate control may be. I suppose in one of two first files, but where? sout_InputSendBuffer looks suspicious, as well as sout_MuxSendBuffer, but maybe I'm too sleepy to find the rate limiting code... Tried to force the last one to consider the stream as b_waiting_stream with no effect... :( Any ideas?
P.S.: The resulting output stream rate is a kinda strange - it is exactly 1024Kbps.

olegkirillov
Blank Cone
Blank Cone
Posts: 46
Joined: 29 Jun 2008 21:04

Re: Bit Rate to High

Postby olegkirillov » 09 Jul 2008 01:16

Went desperate trying to figure out the location of damn rate limiting mechanism. Even tried usleep in stream_output.c (sout_MuxSendBuffer) - the stream starves but still reports itself as 1024 kbps to TVUBroadcaster.
Anyone please help, I do not want to switch to MS Media Server... :(

olegkirillov
Blank Cone
Blank Cone
Posts: 46
Joined: 29 Jun 2008 21:04

Re: Bit Rate to High

Postby olegkirillov » 13 Jul 2008 22:53

YAAAAAHOWWW! Bingo!
I'm just stupid lame. Searched source right to left and upside down to find that solution is just to use --sout-asf-bitrate-override option!
Anyway now I know how sout works. Or at least I think so. :)


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 1 guest