Extract audio from a YouTube video file
ffmpeg -i INPUT.mp4 -ab 256k OUTPUT.mp3Cut 3s length
ffmpeg -y -ss 00:00:03 -i INPUT.mp4 -codec copy OUTPUT.mp4| 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') |
| <html> | |
| <head> | |
| <script src="qrc:///qtwebchannel/qwebchannel.js"></script> | |
| <style> | |
| ::selection { | |
| background:transparent; | |
| } | |
| </style> | |
| </head> |
| import random | |
| class Key: | |
| def __init__(self, key=''): | |
| if key == '': | |
| self.key= self.generate() | |
| else: | |
| self.key = key.lower() |
| #!/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 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 -*- | |
| 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 |
| #!/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) |
| #!/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 |
Extract audio from a YouTube video file
ffmpeg -i INPUT.mp4 -ab 256k OUTPUT.mp3Cut 3s length
ffmpeg -y -ss 00:00:03 -i INPUT.mp4 -codec copy OUTPUT.mp4This tutorial will work you through steps of configuring an FFmpeg build tailored for RTMP streaming on macOS. At first I think of making it support general live streaming, with additional protocols like HLS, but to keep things simple let's stick with RTMP for now. (Anyway, I do include HLS in the protocol list as well as some related bitstream filters but it's untested.)
The built FFmpeg executable should