Author: Ranveer Kumar

Everybody has each choice I have Python 3 Tkinter Rail route Ticket Reservation The executives Framework Utilizing MySQL Data set GUI Work area Application I have the choice to compose this article. I’m composing this article to determine your questions. We ask that you comprehend this article well. Python 3 Tkinter Railway Ticket Reservation Management System Using MySQL Database GUI Desktop App from binhex import openrsrc from PIL import Image, ImageDraw, ImageFont import qrcode import random import os import datetime import mysql.connector mydb=mysql.connector.connect(host=’localhost’,user=’root’,password=’L2zylpdt’,db=’trs’,port=’3306′) def pnr(): num = str(input(“Enter the PNR number : “)) if (num.isdigit()): sql = “SELECT * FROM…

Read More

Python 3 OpenGL Content to Execute Bresenham Circle Circular segment Calculation GUI Work area Application There might be many questions with regards to this article. We trust that subsequent to perusing this article all questions will be settled. How about we go to the article. Python 3 OpenGL Script to Implement Bresenham Circle Arc Algorithm GUI Desktop App #@MKchaudhary 15th sept 2018 #Bresenham’s circle drawing python opengl program from OpenGL.GL import * from OpenGL.GLU import * from OpenGL.GLUT import * import sys def init(): glClearColor(0.0,1.0,1.0,0.0) glColor3f(1.0,0.0,0.0) glPointSize(2.0) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluOrtho2D(0.0,640.0,0.0,480.0) def readinput_circle(): global xcenter,ycenter,radius xcenter=input(‘xCenter:’) ycenter=input(‘yCenter:’) radius=input(‘Radius:’) def setPixel(xcoordinate,ycoordinate): glBegin(GL_POINTS)…

Read More

What we will see through this article is we will find exhaustively about Spasm Tac Toe Game In Python. Spasm Tac-Toe is an extremely straightforward two-player game. So just two players can play simultaneously. This game is otherwise called Noughts and Cross or Xs and operating system game. One player plays with X, the other player plays with O. In this game we have a board with a 3X3 framework. The quantity of stages can be expanded. This game is played by two people. In the first place, we draw a board with a 3 × 3 square lattice. On…

Read More

Python 3 CLI Project to Go to Instagram Live Video Using RTMP & Stream Key Without Using OBS Studio in Command Line pip install InstaLiveCLI <span class=”pl-k”>from</span> <span class=”pl-v”>InstaLiveCLI</span> <span class=”pl-k”>import</span> <span class=”pl-v”>InstaLiveCLI</span> <span class=”pl-s1″>live</span> <span class=”pl-c1″>=</span> <span class=”pl-v”>InstaLiveCLI</span>()<span class=”pl-s1″>live</span>.<span class=”pl-en”>start</span>() python3 live_broadcast.py -u yourInstagramUsername -p yourPassword -proxy user:password@ip:port <span class=”pl-k”>from</span> <span class=”pl-v”>InstaLiveCLI</span> <span class=”pl-k”>import</span> <span class=”pl-v”>InstaLiveCLI</span> <span class=”pl-s1″>live</span> <span class=”pl-c1″>=</span> <span class=”pl-v”>InstaLiveCLI</span>(<span class=”pl-s1″>username</span><span class=”pl-c1″>=</span><span class=”pl-s”>’foo'</span>,<span class=”pl-s1″>password</span><span class=”pl-c1″>=</span><span class=”pl-s”>’bar'</span>)<span class=”pl-s”>”””</span><span class=”pl-s”>And you can access all the function on the class</span><span class=”pl-s”>You can read the documentation!</span><span class=”pl-s”>”””</span><span class=”pl-s1″>live</span>.<span class=”pl-en”>create_broadcast</span>() <span class=”pl-c”>#for example</span><span class=”pl-en”>print</span>(<span class=”pl-s1″>live</span>.<span class=”pl-s1″>stream_key</span>) <span class=”pl-c”># …</span> python3 live_broadcast.py

Read More

Python 3 FFMPEG Script to Restream to YOUTUBE, Facebook Using RTSP & RTMP Protocol in Command Line import requests,time,json,os,sys zaman=time.strftime(“%d/%m/%Y”) def fileidwrite(id):f = open(“id.txt”, “w”)f.write(str(id))f.close()def fileidread():f = open(“id.txt”)a=f.read()print af.close()return a def facebook(end=False):access_token=”EAAZAzzkWc9V0BAF8mhE8WMcRrvfwqOpAQQF…”url = “https://graph.facebook.com/v3.2/me/live_videos”querystring = {“status”:”LIVE_NOW”,”title”:”TEST Live Video “,”description”: “@mzuvin https://github.com/mzuvin “+str(zaman),”access_token”: str(access_token)}if(end):response = requests.request(“POST”, “https://graph.facebook.com/”+str(fileidread())+”/?end_live_video=true&access_token=”+access_token)else:response = requests.request(“POST”, url, params=querystring)liste=json.loads(response.text)id=liste[‘id’]print listefileidwrite(str(id))os.system(‘ffmpeg -re -i “http://SHOUTcastRadioServerUrl/” -loop 1 -i background.jpg -vcodec libx264 -preset veryfast -maxrate 2500k -bufsize 3368k -vf “format=yuv420p” -g 60 -acodec libmp3lame -b:a 198k -ar 44100 -f flv -s 1280×720 “‘+liste[‘stream_url’]+'”‘) try:arg=str(sys.argv[1])except:arg=”” if(arg==”end”):facebook(True)else:facebook()

Read More

Python 3 PYQT5 FFMPEG Script to Build Live Audio Streaming Server Using RTMP Protocol in Command Line from fbs_runtime.application_context.PyQt5 import ApplicationContextfrom PyQt5.QtWidgets import QWidget, QPushButton, QVBoxLayout, QLabel, \ QSlider, QHBoxLayout, QComboBox, QLineEditfrom PyQt5.QtCore import Qt import sysimport subprocessfrom threading import Timer class FFMPEG: def __init__(self): self.device_cmd = [‘ffmpeg’, ‘-list_devices’, ‘true’, ‘-f’, ‘dshow’, ‘-i’, ‘dummy’] self.stream_cmd_base = [ ‘ffmpeg’, ‘-re’, ‘-f’, ‘lavfi’, ‘-i’, ‘color=size=640×480:rate=6:color=black’ ] self.stream_audio_option = [ ‘-ac’, ‘2’, ‘-c:a’, ‘aac’, ‘-ar’, ‘44100’, ‘-b:a’, ‘160k’ ] self.amix_cmd = [ ‘-filter_complex’, ‘amix=inputs=2:duration=longest’ ] self.dshow_cmd = [ ‘-f’, ‘dshow’, ‘-i’ ] self.rtmp_addr = ‘rtmp://global-live.mux.com:5222/app/’ self.current_stream = None def get_input_devices(self): proc = subprocess.run(self.device_cmd,…

Read More

The mobile phone has become an essential part of everyone’s life. With their smartphones at hand, people can make calls and send messages whenever and wherever they want, have access to all kinds of information, get driving directions, take photos and videos, surf the Internet, watch videos on YouTube, listen to music, play games, and so much more! However, there is one problem with these devices that bother their owners – short battery life! Over the years we have seen a lot of improvements in smartphones batteries – they’re getting bigger and bigger in capacity. Today, mobile devices have become…

Read More

Python 3 OpenCV Script to Extract Frames of MP4 Video & Save It as PNG/JPEG Images # Importing all necessary librariesimport cv2import os # Read the video from specified pathcam = cv2.VideoCapture(“video.mp4”) try:# creating a folder named dataif not os.path.exists(‘data’):os.makedirs(‘data’) # if not created then raise errorexcept OSError:print (‘Error: Creating directory of data’) # framecurrentframe = 0 while(True):# reading from frameret,frame = cam.read() if ret:# if video is still left continue creating imagesname = ‘./data/frame’ + str(currentframe) + ‘.jpg’print (‘Creating…’ + name) # writing the extracted imagescv2.imwrite(name, frame) # increasing counter so that it will# show how many frames are…

Read More

Python 3 FFMPEG Script to Build & Extract Facial Recognition From RTMP Live Streaming Video in Browser import syssys.path.append(‘/home/raiy/.local/lib/python3.7/site-packages’) # Path for import following libs import cv2import face_recognitionimport numpy as npfrom datetime import datetimeimport time def extractFaces(media_path, filename, output_path): cap = cv2.VideoCapture(media_path + filename) extracted, face_areas = [], [] process_this_frame = True num_of_captured = 0 while True: try: ret, frame = cap.read() #cv2.imshow(frame) small_frame = cv2.resize(frame, (0, 0), fx=0.25, fy=0.25) except: break rgb_small_frame = small_frame[:, :, ::-1] if process_this_frame: locations = face_recognition.face_locations(rgb_small_frame, number_of_times_to_upsample=3) # Only works when number_of_times_to_upsample = 3 captured = face_recognition.face_encodings(rgb_small_frame, locations) for i, face in enumerate(captured): top,…

Read More

Python 3 FFMPEG Script to Convert BLOB Data to RTMP Live Video Streaming in Browser Using HTML5 #! /usr/bin/env python3.6 import argparseimport loggingfrom asyncio import get_event_loop import asyncioimport socketio from aiohttp import webfrom subprocess import Popen, PIPE, DEVNULL sio = socketio.AsyncServer()logger = logging.getLogger(‘transfer-logger’)server = None class FFMPEGProcess: DEFAULT_LIFE = 6 LIFE_STEP = 3 ffmpeg = None rtmp_url = None options = None key = None def __init__(self, key: str, rtmp_url: str): self.life = self.DEFAULT_LIFE self.key = key self.rtmp_url = rtmp_url self.options = [ ‘ffmpeg’, ‘-vcodec’, ‘libvpx’, ‘-i’, ‘-‘, ‘-c:v’, ‘libx264’, ‘-preset’, ‘veryfast’, ‘-tune’, ‘zerolatency’, ‘-an’, ‘-bufsize’, ‘1000’, ‘-f’, ‘flv’, rtmp_url…

Read More