首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

Python 中的 socket 模块

import socket help(socket)     Functions:     socket() -- create a new socket object     socketpair() -- create a pair of new socket objects [*]     fromfd() -- create a socket object from an open file descriptor [*]     gethostname() -- return the current hostname     gethostbyname() -- map a hostname to its IP number     gethostbyaddr() -- map an IP number or hostname to DNS info     getservbyname() -- map a service name and a protocol name to a port number     getprotobyname() -- map a protocol name (e.g. 'tcp') to a number     ntohs(), ntohl() -- convert 16, 32 bit int from network to host byte order     htons(), htonl() -- convert 16, 32 bit int from host to network byte order     inet_aton() -- convert IP addr string (123.45.67.89) to 32-bit packed format     inet_ntoa() -- convert 32-bit packed format IP to string (123.45.67.89)     ssl() -- secure socket layer support (only available if configured)     socket.getdefaulttimeout() -- get the default timeout value     socket.setdefaulttimeout() -- set the default timeout value     create_connection() -- connects to an address, with an optional timeout and optional source address. 简单的介绍一下这些函数的作用: 一、socket类方法(直接可以通过socket 类进行调用) 1、gethostbyname() -- map a hostname to its IP number

02

wmv转换mp4格式转换器_avi可以转化成什么格式

原文:http://www.mworkbox.com/wp/work/314.html MP4的视频H264封装有2种格式:h264和avc1,对于这个细节,很容易被忽略。笔者也是在改编LIVE555流媒体时,增加mp4文件类型支持时遇到了该问题。 (一)首先,从原理上了解一下这2种格式的区别: AVC1 描述:H.264 bitstream without start codes.一般通过ffmpeg转码生成的视频,是不带起始码0×00000001的。 H264 描述:H.264 bitstream with start codes.一般对于一下HDVD等电影的压制格式,是带有起始码0×00000001的。 (二)其次,通过VLC播放器,可以查看到具体的格式。打开视频后,通过菜单【工具】/【编解码信息】可以查看到【编解码器】具体格式,举例如下,编解码器信息: 编码: H264 – MPEG-4 AVC (part 10) (avc1) 编码: H264 – MPEG-4 AVC (part 10) (h264) (三)最后,分享一下ffmpeg demux MP4文件后,转换视频流为live555可直接使用的h264 ES流的经验和方法: 针对(avc1),av_read_frame后,取前四个字节为长度,把前四字节直接替换为0×00,0×00,0×00,0×01即可,但注意每个frame可以有多个NAUL:

02
领券