On 02/14/2012 02:43 PM, Ronald S. Bultje wrote:My question was, however, about parameters that get passed to the underlying network transport - e.g., for udp, you use to be able to specify the socket buffer size. My h264 IP camera produces I-frames that are ~220KB, and with the default 64K socket buffer size, they got corrupted. It ws possible, in the past, to pass a buffer argument (as in the example I gave above). How can you do that today, short of recompiling libav with a different #define RX_BUFFER_SIZE ?I don't think we have anything called RX_BUFFER_SIZE in our tree, and nothing prevents you from passing ?x=y value pairs that will be transmitted as part of the HTTP or RTSP URI straight to the server. The whole point of the avoptions API switch was that we would leave such URIs intact, to make it easier for you to pass option/value pairs to the server regardless of implementation details in Libav. Sorry, I was confusing with UDP_TX_BUF_SIZE, and trying to figure out the problem, I realized I have also upgraded the camera firmware (which might cause the camera to behave differently), so while I'm sure about the behavior now, I'm not sure exactly about previous versions. So, let me please start again with a clean slate: If you look at udp.c (just git pulled), routine udp_open actually parses the URI looking for libav-specific instructions such as "reuse", "ttl", "localport", "pkt_size", "buffer_size", "connect" and "localaddr". Specifically, the "buffer_size" parameter (which defaults to UDP_MAX_PKT_SIZE=65536 for reading) is used to set the UDP buffer size. I need to increase that buffer size significantly (to > 256KB) so that packets don't get lost., because I-frames at 1280x720 are already 220KB/sec. I can recompile replacing the default buffer_size from UDP_MAX_PKT_SIZE to (e.g.) 4*UDP_MAX_PKT_SIZE, but I'd rather do that with configuration and use a stock libav. So, the question is: given that I'm passing an rtsp url ("rtsp://a.b.c.d/axis-media/media.amp"), how do I set buffer_size and/or ttl? There does not appear to be an avoption based way to do that, but maybe I'm missing something? (This is also relevant to setting the timeout for tcp transports, and I guess; although the http transport does seem to get its parameters from avoptions; and rtsp does pass "localport", "ttl" and "connect" parameter to udp somehow) |
_______________________________________________ libav-api mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-api
