A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
| #!/bin/sh | |
| sleep 5 | |
| ffmpeg -re -f mjpeg -r 10 -i "http://localhost/?action=stream" -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -acodec aac -ab 1k -strict experimental -s 640x360 -vcodec h264 -pix_fmt yuv420p -g 20 -vb 500k -preset ultrafast -crf 31 -r 10 -f flv "rtmp://a.rtmp.youtube.com/live2/xxxx-xxxx-xxxx-xxxx" 2> /home/pi/ffmpeg.log |
| #!/usr/bin/python3 | |
| # -*- coding: utf-8 -*- | |
| from PyQt5.QtGui import QPalette, QKeySequence, QIcon | |
| from PyQt5.QtCore import QDir, Qt, QUrl, QSize, QPoint, QTime, QMimeData, QProcess, QEvent | |
| from PyQt5.QtMultimedia import QMediaContent, QMediaPlayer, QMediaMetaData | |
| from PyQt5.QtMultimediaWidgets import QVideoWidget | |
| from PyQt5.QtWidgets import (QApplication, QFileDialog, QHBoxLayout, QLineEdit, | |
| QPushButton, QSizePolicy, QSlider, QMessageBox, QStyle, QVBoxLayout, | |
| QWidget, QShortcut, QMenu) |
| #!/usr/bin/python3 | |
| # -*- coding: utf-8 -*- | |
| import sys | |
| from PyQt5.QtWidgets import (QWidget, QPushButton, QLineEdit, QProgressBar, QApplication, | |
| QVBoxLayout, QHBoxLayout, QLabel, QFileDialog) | |
| from PyQt5.QtGui import QIcon | |
| from PyQt5.QtCore import QThread, pyqtSignal, QSettings, QStandardPaths | |
| import queue #If this template is not loaded, pyinstaller may not be able to run the requests template after packaging | |
| import requests |
| import asyncio | |
| import random | |
| import time | |
| async def worker(name, queue): | |
| while True: | |
| # Get a "work item" out of the queue. | |
| sleep_for = await queue.get() |
| #!/usr/bin/python3 | |
| # -*- coding: utf-8 -*- | |
| from PyQt5.QtCore import Qt | |
| from PyQt5.QtGui import QImage, QPixmap, QPalette, QPainter | |
| from PyQt5.QtPrintSupport import QPrintDialog, QPrinter | |
| from PyQt5.QtWidgets import QLabel, QSizePolicy, QScrollArea, QMessageBox, QMainWindow, QMenu, QAction, \ | |
| qApp, QFileDialog |
| import random | |
| class Key: | |
| def __init__(self, key=''): | |
| if key == '': | |
| self.key= self.generate() | |
| else: | |
| self.key = key.lower() |
| <html> | |
| <head> | |
| <script src="qrc:///qtwebchannel/qwebchannel.js"></script> | |
| <style> | |
| ::selection { | |
| background:transparent; | |
| } | |
| </style> | |
| </head> |
| from moviepy.editor import * | |
| import numpy as np | |
| clip = VideoFileClip("hams.mkv") | |
| import sounddevice as sd | |
| import soundfile as sf | |
| from queue import Queue | |
| from collections import OrderedDict | |
| import pprint | |
| pp = pprint.PrettyPrinter(indent=4) | |
| print('started') |
A list of useful commands for the FFmpeg command line tool.
Download FFmpeg: https://www.ffmpeg.org/download.html
Full documentation: https://www.ffmpeg.org/ffmpeg.html
| Encoder h264_amf [AMD AMF H.264 Encoder]: | |
| General capabilities: dr1 delay hardware | |
| Threading capabilities: none | |
| Supported hardware devices: d3d11va d3d11va dxva2 dxva2 amf amf | |
| Supported pixel formats: nv12 yuv420p d3d11 dxva2_vld p010le amf bgr0 rgb0 bgra argb rgba x2bgr10le rgbaf16le | |
| h264_amf AVOptions: | |
| -usage <int> E..V....... Encoder Usage (from -1 to 5) (default -1) | |
| transcoding 0 E..V....... Generic Transcoding | |
| ultralowlatency 1 E..V....... Ultra low latency usecase | |
| lowlatency 2 E..V....... Low latency usecase |