问题:python如何运行ffmpeg进程视频直播?

方法:

rtsp = '"%s"' % m.rtsp
rtmp = 'rtmp://192.168.1.12:1935/live/id%d' % m.id
cmd_str1 = 'ffmpeg -rtsp_transport tcp -i'
cmd_str2 = '-f flv -vcodec copy'
cmd = cmd_str1.split() + [rtsp] + cmd_str2.split() + [rtmp]
cmd_str = ' '.join(cmd)
# 不用shell不行
# p = subprocess.Popen(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE)
p = subprocess.Popen(cmd_str, shell=True, stderr=subprocess.PIPE, stdout=subprocess.PIPE)

阅读全文

问题:如何进行多进程抓取数据?

方法:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from multiprocessing import Pool
import requests
from time import sleep

fin = open('pass_list.txt', 'r', encoding='UTF-8', errors='ignore')
host = 'http://xxx.com/'

阅读全文

问题:科达摄像机rtsp取流地址是什么?

解决:

海康旧版本

rtsp://username:password@//ch/
举例1:DS-9016HF-ST的IP通道01主码流:
rtsp://admin:12345@172.6.22.106:554/h264/ch33/main/av_stream
举例2:
DS-9016HF-ST的模拟通道01子码流:
rtsp://admin:12345@172.6.22.106:554/h264/ch1/sub/av_stream
举例3:DS-9016HF-ST的零通道主码流(零通道无子码流):
rtsp://admin:12345@172.6.22.106:554/h264/ch0/main/av_stream
举例4:DS-2DF7274-A的第三码流:
rtsp://admin:12345@172.6.10.11:554/h264/ch1/stream3/av_stream

阅读全文