Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- CCEdit-main/src/taming-transformers/data/coco_annotations_100/train2017/000000010077.jpg +3 -0
- CCEdit-main/src/taming-transformers/data/coco_annotations_100/train2017/000000010114.jpg +3 -0
- CCEdit-main/src/taming-transformers/data/coco_annotations_100/train2017/000000010166.jpg +3 -0
- CCEdit-main/src/taming-transformers/data/coco_annotations_100/train2017/000000010430.jpg +3 -0
- CCEdit-main/src/taming-transformers/data/coco_annotations_100/train2017/000000010434.jpg +3 -0
- CCEdit-main/src/taming-transformers/data/coco_annotations_100/val2017/000000011197.jpg +3 -0
- CCEdit-main/src/taming-transformers/data/coco_annotations_100/val2017/000000013004.jpg +3 -0
- CCEdit-main/src/taming-transformers/data/coco_annotations_100/val2017/000000014380.jpg +3 -0
- CCEdit-main/src/taming-transformers/data/coco_annotations_100/val2017/000000014888.jpg +3 -0
- CCEdit-main/src/taming-transformers/data/coco_annotations_100/val2017/000000017178.jpg +3 -0
- CCEdit-main/src/taming-transformers/data/coco_annotations_100/val2017/000000018150.jpg +3 -0
- CCEdit-main/src/taming-transformers/data/coco_annotations_100/val2017/000000018380.jpg +3 -0
- CCEdit-main/src/taming-transformers/data/coco_annotations_100/val2017/000000018575.jpg +3 -0
- ControlVideo-master/LICENSE +21 -0
- ControlVideo-master/app.py +348 -0
- ControlVideo-master/cog.yaml +53 -0
- ControlVideo-master/predict.py +164 -0
- ControlVideo-master/requirements.txt +38 -0
- pix2video-main/code/__pycache__/common.cpython-313.pyc +0 -0
- pix2video-main/code/__pycache__/custom_utils.cpython-313.pyc +0 -0
- pix2video-main/code/__pycache__/file_utils.cpython-313.pyc +0 -0
- pix2video-main/code/__pycache__/video_model_cross_frame_attn.cpython-313.pyc +0 -0
- pix2video-main/code/common.py +102 -0
- pix2video-main/code/custom_utils.py +143 -0
- pix2video-main/code/file_utils.py +226 -0
- pix2video-main/code/test_cfg.py +142 -0
- pix2video-main/code/video_model_cross_frame_attn.py +538 -0
- pix2video-main/ffmpeg-7.0.2-i686-static/GPLv3.txt +674 -0
- pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffmpeg-all.txt +0 -0
- pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffmpeg-bitstream-filters.txt +890 -0
- pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffmpeg-codecs.txt +0 -0
- pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffmpeg-devices.txt +1915 -0
- pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffmpeg-filters.txt +0 -0
- pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffmpeg-formats.txt +0 -0
- pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffmpeg-protocols.txt +1960 -0
- pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffmpeg-resampler.txt +259 -0
- pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffmpeg-scaler.txt +156 -0
- pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffmpeg-utils.txt +1267 -0
- pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffmpeg.txt +0 -0
- pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffprobe.txt +1008 -0
- pix2video-main/ffmpeg-7.0.2-i686-static/readme.txt +67 -0
- pix2video-main/mydiffusers/mydiffusers.egg-info/PKG-INFO +3 -0
- pix2video-main/mydiffusers/mydiffusers.egg-info/SOURCES.txt +141 -0
- pix2video-main/mydiffusers/mydiffusers.egg-info/dependency_links.txt +1 -0
- pix2video-main/mydiffusers/mydiffusers.egg-info/top_level.txt +1 -0
- pix2video-main/mydiffusers/mydiffusers/schedulers/__pycache__/__init__.cpython-313.pyc +0 -0
- pix2video-main/mydiffusers/mydiffusers/schedulers/__pycache__/__init__.cpython-38.pyc +0 -0
- pix2video-main/mydiffusers/mydiffusers/schedulers/__pycache__/scheduling_ddim.cpython-313.pyc +0 -0
- pix2video-main/mydiffusers/mydiffusers/schedulers/__pycache__/scheduling_ddim.cpython-38.pyc +0 -0
- pix2video-main/mydiffusers/mydiffusers/schedulers/__pycache__/scheduling_ddpm.cpython-313.pyc +0 -0
CCEdit-main/src/taming-transformers/data/coco_annotations_100/train2017/000000010077.jpg
ADDED
|
Git LFS Details
|
CCEdit-main/src/taming-transformers/data/coco_annotations_100/train2017/000000010114.jpg
ADDED
|
Git LFS Details
|
CCEdit-main/src/taming-transformers/data/coco_annotations_100/train2017/000000010166.jpg
ADDED
|
Git LFS Details
|
CCEdit-main/src/taming-transformers/data/coco_annotations_100/train2017/000000010430.jpg
ADDED
|
Git LFS Details
|
CCEdit-main/src/taming-transformers/data/coco_annotations_100/train2017/000000010434.jpg
ADDED
|
Git LFS Details
|
CCEdit-main/src/taming-transformers/data/coco_annotations_100/val2017/000000011197.jpg
ADDED
|
Git LFS Details
|
CCEdit-main/src/taming-transformers/data/coco_annotations_100/val2017/000000013004.jpg
ADDED
|
Git LFS Details
|
CCEdit-main/src/taming-transformers/data/coco_annotations_100/val2017/000000014380.jpg
ADDED
|
Git LFS Details
|
CCEdit-main/src/taming-transformers/data/coco_annotations_100/val2017/000000014888.jpg
ADDED
|
Git LFS Details
|
CCEdit-main/src/taming-transformers/data/coco_annotations_100/val2017/000000017178.jpg
ADDED
|
Git LFS Details
|
CCEdit-main/src/taming-transformers/data/coco_annotations_100/val2017/000000018150.jpg
ADDED
|
Git LFS Details
|
CCEdit-main/src/taming-transformers/data/coco_annotations_100/val2017/000000018380.jpg
ADDED
|
Git LFS Details
|
CCEdit-main/src/taming-transformers/data/coco_annotations_100/val2017/000000018575.jpg
ADDED
|
Git LFS Details
|
ControlVideo-master/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2023 YaboZhang
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
ControlVideo-master/app.py
ADDED
|
@@ -0,0 +1,348 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import os
|
| 3 |
+
import shutil
|
| 4 |
+
import subprocess
|
| 5 |
+
import cv2
|
| 6 |
+
import numpy as np
|
| 7 |
+
import math
|
| 8 |
+
|
| 9 |
+
from huggingface_hub import snapshot_download
|
| 10 |
+
|
| 11 |
+
os.environ['CUDA_LAUNCH_BLOCKING'] = '1'
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
model_ids = [
|
| 15 |
+
'runwayml/stable-diffusion-v1-5',
|
| 16 |
+
'lllyasviel/sd-controlnet-depth',
|
| 17 |
+
'lllyasviel/sd-controlnet-canny',
|
| 18 |
+
'lllyasviel/sd-controlnet-openpose',
|
| 19 |
+
"lllyasviel/control_v11p_sd15_softedge",
|
| 20 |
+
"lllyasviel/control_v11p_sd15_scribble",
|
| 21 |
+
"lllyasviel/control_v11p_sd15_lineart_anime",
|
| 22 |
+
"lllyasviel/control_v11p_sd15_lineart",
|
| 23 |
+
"lllyasviel/control_v11f1p_sd15_depth",
|
| 24 |
+
"lllyasviel/control_v11p_sd15_canny",
|
| 25 |
+
"lllyasviel/control_v11p_sd15_openpose",
|
| 26 |
+
"lllyasviel/control_v11p_sd15_normalbae"
|
| 27 |
+
]
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
for model_id in model_ids:
|
| 31 |
+
model_name = model_id.split('/')[-1]
|
| 32 |
+
snapshot_download(model_id, cache_dir=f'checkpoints/{model_name}')
|
| 33 |
+
|
| 34 |
+
def load_model(model_id):
|
| 35 |
+
local_dir = f'checkpoints/stable-diffusion-v1-5'
|
| 36 |
+
# Check if the directory exists
|
| 37 |
+
if os.path.exists(local_dir):
|
| 38 |
+
# Delete the directory if it exists
|
| 39 |
+
shutil.rmtree(local_dir)
|
| 40 |
+
|
| 41 |
+
model_name = model_id.split('/')[-1]
|
| 42 |
+
snapshot_download(model_id, local_dir=f'checkpoints/{model_name}')
|
| 43 |
+
os.rename(f'checkpoints/{model_name}', f'checkpoints/stable-diffusion-v1-5')
|
| 44 |
+
return "model loaded"
|
| 45 |
+
|
| 46 |
+
def get_frame_count(filepath):
|
| 47 |
+
if filepath is not None:
|
| 48 |
+
video = cv2.VideoCapture(filepath)
|
| 49 |
+
frame_count = int(video.get(cv2.CAP_PROP_FRAME_COUNT))
|
| 50 |
+
|
| 51 |
+
video.release()
|
| 52 |
+
|
| 53 |
+
# LIMITS
|
| 54 |
+
if frame_count > 100 :
|
| 55 |
+
frame_count = 100 # limit to 100 frames to avoid cuDNN errors
|
| 56 |
+
|
| 57 |
+
return gr.update(maximum=frame_count)
|
| 58 |
+
|
| 59 |
+
else:
|
| 60 |
+
return gr.update(value=1, maximum=100 )
|
| 61 |
+
|
| 62 |
+
def get_video_dimension(filepath):
|
| 63 |
+
video = cv2.VideoCapture(filepath)
|
| 64 |
+
width = int(video.get(cv2.CAP_PROP_FRAME_WIDTH))
|
| 65 |
+
height = int(video.get(cv2.CAP_PROP_FRAME_HEIGHT))
|
| 66 |
+
fps = int(video.get(cv2.CAP_PROP_FPS))
|
| 67 |
+
frame_count = int(video.get(cv2.CAP_PROP_FRAME_COUNT))
|
| 68 |
+
video.release()
|
| 69 |
+
return width, height, fps, frame_count
|
| 70 |
+
|
| 71 |
+
def resize_video(input_vid, output_vid, width, height, fps):
|
| 72 |
+
print(f"RESIZING ...")
|
| 73 |
+
# Open the input video file
|
| 74 |
+
video = cv2.VideoCapture(input_vid)
|
| 75 |
+
|
| 76 |
+
# Create a VideoWriter object to write the resized video
|
| 77 |
+
fourcc = cv2.VideoWriter_fourcc(*'mp4v') # Codec for the output video
|
| 78 |
+
output_video = cv2.VideoWriter(output_vid, fourcc, fps, (width, height))
|
| 79 |
+
|
| 80 |
+
while True:
|
| 81 |
+
# Read a frame from the input video
|
| 82 |
+
ret, frame = video.read()
|
| 83 |
+
if not ret:
|
| 84 |
+
break
|
| 85 |
+
|
| 86 |
+
# Resize the frame to the desired dimensions
|
| 87 |
+
resized_frame = cv2.resize(frame, (width, height))
|
| 88 |
+
|
| 89 |
+
# Write the resized frame to the output video file
|
| 90 |
+
output_video.write(resized_frame)
|
| 91 |
+
|
| 92 |
+
# Release the video objects
|
| 93 |
+
video.release()
|
| 94 |
+
output_video.release()
|
| 95 |
+
print(f"RESIZE VIDEO DONE!")
|
| 96 |
+
return output_vid
|
| 97 |
+
|
| 98 |
+
def make_nearest_multiple_of_32(number):
|
| 99 |
+
remainder = number % 32
|
| 100 |
+
if remainder <= 16:
|
| 101 |
+
number -= remainder
|
| 102 |
+
else:
|
| 103 |
+
number += 32 - remainder
|
| 104 |
+
return number
|
| 105 |
+
|
| 106 |
+
def change_video_fps(input_path):
|
| 107 |
+
print(f"CHANGING FIANL OUTPUT FPS")
|
| 108 |
+
cap = cv2.VideoCapture(input_path)
|
| 109 |
+
# Check if the final file already exists
|
| 110 |
+
if os.path.exists('output_video.mp4'):
|
| 111 |
+
# Delete the existing file
|
| 112 |
+
os.remove('output_video.mp4')
|
| 113 |
+
output_path = 'output_video.mp4'
|
| 114 |
+
fourcc = cv2.VideoWriter_fourcc(*'mp4v')
|
| 115 |
+
output_fps = 12
|
| 116 |
+
output_size = (int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)), int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)))
|
| 117 |
+
out = cv2.VideoWriter(output_path, fourcc, output_fps, output_size)
|
| 118 |
+
|
| 119 |
+
frame_count = 0
|
| 120 |
+
while cap.isOpened():
|
| 121 |
+
ret, frame = cap.read()
|
| 122 |
+
if not ret:
|
| 123 |
+
break
|
| 124 |
+
|
| 125 |
+
# Write the current frame to the output video multiple times to increase the frame rate
|
| 126 |
+
for _ in range(output_fps // 8):
|
| 127 |
+
out.write(frame)
|
| 128 |
+
|
| 129 |
+
frame_count += 1
|
| 130 |
+
print(f'Processed frame {frame_count}')
|
| 131 |
+
|
| 132 |
+
cap.release()
|
| 133 |
+
out.release()
|
| 134 |
+
cv2.destroyAllWindows()
|
| 135 |
+
|
| 136 |
+
return 'output_video.mp4'
|
| 137 |
+
|
| 138 |
+
def run_inference(prompt, video_path, version_condition, video_length, seed):
|
| 139 |
+
|
| 140 |
+
seed = math.floor(seed)
|
| 141 |
+
o_width = get_video_dimension(video_path)[0]
|
| 142 |
+
o_height = get_video_dimension(video_path)[1]
|
| 143 |
+
version, condition = version_condition.split("+")
|
| 144 |
+
|
| 145 |
+
# Prepare dimensions
|
| 146 |
+
if o_width > 512 :
|
| 147 |
+
# Calculate the new height while maintaining the aspect ratio
|
| 148 |
+
n_height = int(o_height / o_width * 512)
|
| 149 |
+
n_width = 512
|
| 150 |
+
else:
|
| 151 |
+
n_height = o_height
|
| 152 |
+
n_width = o_width
|
| 153 |
+
|
| 154 |
+
# Make sure new dimensions are multipe of 32
|
| 155 |
+
r_width = make_nearest_multiple_of_32(n_width)
|
| 156 |
+
r_height = make_nearest_multiple_of_32(n_height)
|
| 157 |
+
print(f"multiple of 32 sizes : {r_width}x{r_height}")
|
| 158 |
+
|
| 159 |
+
# Get FPS of original video input
|
| 160 |
+
original_fps = get_video_dimension(video_path)[2]
|
| 161 |
+
if original_fps > 12 :
|
| 162 |
+
print(f"FPS is too high: {original_fps}")
|
| 163 |
+
target_fps = 12
|
| 164 |
+
else :
|
| 165 |
+
target_fps = original_fps
|
| 166 |
+
print(f"NEW INPUT FPS: {target_fps}, NEW LENGTH: {video_length}")
|
| 167 |
+
|
| 168 |
+
# Check if the resized file already exists
|
| 169 |
+
if os.path.exists('resized.mp4'):
|
| 170 |
+
# Delete the existing file
|
| 171 |
+
os.remove('resized.mp4')
|
| 172 |
+
|
| 173 |
+
resized = resize_video(video_path, 'resized.mp4', r_width, r_height, target_fps)
|
| 174 |
+
resized_video_fcount = get_video_dimension(resized)[3]
|
| 175 |
+
print(f"RESIZED VIDEO FRAME COUNT: {resized_video_fcount}")
|
| 176 |
+
|
| 177 |
+
# Make sure new total frame count is enough to handle chosen video length
|
| 178 |
+
if video_length > resized_video_fcount :
|
| 179 |
+
video_length = resized_video_fcount
|
| 180 |
+
# video_length = int((target_fps * video_length) / original_fps)
|
| 181 |
+
|
| 182 |
+
output_path = 'output/'
|
| 183 |
+
os.makedirs(output_path, exist_ok=True)
|
| 184 |
+
|
| 185 |
+
# Check if the file already exists
|
| 186 |
+
if os.path.exists(os.path.join(output_path, f"result.mp4")):
|
| 187 |
+
# Delete the existing file
|
| 188 |
+
os.remove(os.path.join(output_path, f"result.mp4"))
|
| 189 |
+
|
| 190 |
+
print(f"RUNNING INFERENCE ...")
|
| 191 |
+
if video_length > 16:
|
| 192 |
+
command = f"python inference.py --prompt '{prompt}' --condition '{condition}' --video_path '{resized}' --output_path '{output_path}' --temp_video_name 'result' --width {r_width} --height {r_height} --seed {seed} --video_length {video_length} --smoother_steps 19 20 --version {version} --is_long_video"
|
| 193 |
+
else:
|
| 194 |
+
command = f"python inference.py --prompt '{prompt}' --condition '{condition}' --video_path '{resized}' --output_path '{output_path}' --temp_video_name 'result' --width {r_width} --height {r_height} --seed {seed} --video_length {video_length} --smoother_steps 19 20 --version {version} "
|
| 195 |
+
|
| 196 |
+
try:
|
| 197 |
+
subprocess.run(command, shell=True)
|
| 198 |
+
except cuda.Error as e:
|
| 199 |
+
return f"CUDA Error: {e}", None
|
| 200 |
+
except RuntimeError as e:
|
| 201 |
+
return f"Runtime Error: {e}", None
|
| 202 |
+
|
| 203 |
+
# Construct the video path
|
| 204 |
+
video_path_output = os.path.join(output_path, f"result.mp4")
|
| 205 |
+
|
| 206 |
+
# Resize to original video input size
|
| 207 |
+
#o_width = get_video_dimension(video_path)[0]
|
| 208 |
+
#o_height = get_video_dimension(video_path)[1]
|
| 209 |
+
#resize_video(video_path_output, 'resized_final.mp4', o_width, o_height, target_fps)
|
| 210 |
+
|
| 211 |
+
# Check generated video FPS
|
| 212 |
+
gen_fps = get_video_dimension(video_path_output)[2]
|
| 213 |
+
print(f"GEN VIDEO FPS: {gen_fps}")
|
| 214 |
+
final = change_video_fps(video_path_output)
|
| 215 |
+
print(f"FINISHED !")
|
| 216 |
+
|
| 217 |
+
return final
|
| 218 |
+
# return final, gr.Group.update(visible=True)
|
| 219 |
+
|
| 220 |
+
|
| 221 |
+
css="""
|
| 222 |
+
#col-container {max-width: 810px; margin-left: auto; margin-right: auto;}
|
| 223 |
+
.animate-spin {
|
| 224 |
+
animation: spin 1s linear infinite;
|
| 225 |
+
}
|
| 226 |
+
@keyframes spin {
|
| 227 |
+
from {
|
| 228 |
+
transform: rotate(0deg);
|
| 229 |
+
}
|
| 230 |
+
to {
|
| 231 |
+
transform: rotate(360deg);
|
| 232 |
+
}
|
| 233 |
+
}
|
| 234 |
+
#share-btn-container {
|
| 235 |
+
display: flex;
|
| 236 |
+
padding-left: 0.5rem !important;
|
| 237 |
+
padding-right: 0.5rem !important;
|
| 238 |
+
background-color: #000000;
|
| 239 |
+
justify-content: center;
|
| 240 |
+
align-items: center;
|
| 241 |
+
border-radius: 9999px !important;
|
| 242 |
+
max-width: 13rem;
|
| 243 |
+
}
|
| 244 |
+
#share-btn-container:hover {
|
| 245 |
+
background-color: #060606;
|
| 246 |
+
}
|
| 247 |
+
#share-btn {
|
| 248 |
+
all: initial;
|
| 249 |
+
color: #ffffff;
|
| 250 |
+
font-weight: 600;
|
| 251 |
+
cursor:pointer;
|
| 252 |
+
font-family: 'IBM Plex Sans', sans-serif;
|
| 253 |
+
margin-left: 0.5rem !important;
|
| 254 |
+
padding-top: 0.5rem !important;
|
| 255 |
+
padding-bottom: 0.5rem !important;
|
| 256 |
+
right:0;
|
| 257 |
+
}
|
| 258 |
+
#share-btn * {
|
| 259 |
+
all: unset;
|
| 260 |
+
}
|
| 261 |
+
#share-btn-container div:nth-child(-n+2){
|
| 262 |
+
width: auto !important;
|
| 263 |
+
min-height: 0px !important;
|
| 264 |
+
}
|
| 265 |
+
#share-btn-container .wrap {
|
| 266 |
+
display: none !important;
|
| 267 |
+
}
|
| 268 |
+
#share-btn-container.hidden {
|
| 269 |
+
display: none!important;
|
| 270 |
+
}
|
| 271 |
+
img[src*='#center'] {
|
| 272 |
+
display: block;
|
| 273 |
+
margin: auto;
|
| 274 |
+
}
|
| 275 |
+
"""
|
| 276 |
+
with gr.Blocks(css=css) as demo:
|
| 277 |
+
with gr.Column(elem_id="col-container"):
|
| 278 |
+
gr.Markdown("""
|
| 279 |
+
<h1 style="text-align: center;">ControlVideo: Training-free Controllable Text-to-Video Generation</h1>
|
| 280 |
+
<p style="text-align: center;">
|
| 281 |
+
[<a href="https://arxiv.org/abs/2305.13077" style="color:blue;">arXiv</a>]
|
| 282 |
+
[<a href="https://github.com/YBYBZhang/ControlVideo" style="color:blue;">GitHub</a>]
|
| 283 |
+
</p>
|
| 284 |
+
<p style="text-align: center;"> ControlVideo adapts ControlNet to the video counterpart without any finetuning, aiming to directly inherit its high-quality and consistent generation. </p>
|
| 285 |
+
""")
|
| 286 |
+
|
| 287 |
+
with gr.Column():
|
| 288 |
+
with gr.Row():
|
| 289 |
+
video_path = gr.Video(label="Input video", source="upload", type="filepath", visible=True, elem_id="video-in")
|
| 290 |
+
video_res = gr.Video(label="result", elem_id="video-out")
|
| 291 |
+
|
| 292 |
+
# with gr.Column():
|
| 293 |
+
# video_res = gr.Video(label="result", elem_id="video-out")
|
| 294 |
+
# with gr.Group(elem_id="share-btn-container", visible=False) as share_group:
|
| 295 |
+
# community_icon = gr.HTML(community_icon_html)
|
| 296 |
+
# loading_icon = gr.HTML(loading_icon_html)
|
| 297 |
+
# share_button = gr.Button("Share to community", elem_id="share-btn")
|
| 298 |
+
with gr.Row():
|
| 299 |
+
chosen_model = gr.Dropdown(label="Diffusion model (*1.5)", choices=['runwayml/stable-diffusion-v1-5','nitrosocke/Ghibli-Diffusion'], value="runwayml/stable-diffusion-v1-5", allow_custom_value=True)
|
| 300 |
+
model_status = gr.Textbox(label="status")
|
| 301 |
+
load_model_btn = gr.Button("load model (optional)")
|
| 302 |
+
prompt = gr.Textbox(label="prompt", info="If you loaded a custom model, do not forget to include Prompt trigger", elem_id="prompt-in")
|
| 303 |
+
with gr.Column():
|
| 304 |
+
video_length = gr.Slider(label="Video length", info="How many frames do you want to process ? For demo purpose, max is set to 24", minimum=1, maximum=12, step=1, value=2)
|
| 305 |
+
with gr.Row():
|
| 306 |
+
# version = gr.Dropdown(label="ControlNet version", choices=["v10", "v11"], value="v10")
|
| 307 |
+
version_condition = gr.Dropdown(label="ControlNet version + Condition",
|
| 308 |
+
choices=["v10+depth_midas", "v10+canny", "v10+openpose", "v11+softedge_pidinet", "v11+softedge_pidsafe",
|
| 309 |
+
"v11+softedge_hed", "v11+softedge_hedsafe", "v11+scribble_hed", "v11+scribble_pidinet", "v11+lineart_anime",
|
| 310 |
+
"v11+lineart_coarse", "v11+lineart_realistic", "v11+depth_midas", "v11+depth_leres", "v11+depth_leres++",
|
| 311 |
+
"v11+depth_zoe", "v11+canny", "v11+openpose", "v11+openpose_face", "v11+openpose_faceonly", "v11+openpose_full",
|
| 312 |
+
"v11+openpose_hand", "v11+normal_bae"], value="v10+depth_midas")
|
| 313 |
+
seed = gr.Number(label="seed", value=42)
|
| 314 |
+
submit_btn = gr.Button("Submit")
|
| 315 |
+
|
| 316 |
+
|
| 317 |
+
gr.Examples(
|
| 318 |
+
examples=[["James bond moonwalks on the beach.", "./data/moonwalk.mp4", 'v10+openpose', 15, 42],
|
| 319 |
+
["A striking mallard floats effortlessly on the sparkling pond.", "./data/mallard-water.mp4", "v11+depth_midas", 15, 42]],
|
| 320 |
+
fn=run_inference,
|
| 321 |
+
inputs=[prompt,
|
| 322 |
+
video_path,
|
| 323 |
+
version_condition,
|
| 324 |
+
video_length,
|
| 325 |
+
seed,
|
| 326 |
+
],
|
| 327 |
+
# outputs=[video_res, share_group],
|
| 328 |
+
outputs=video_res,
|
| 329 |
+
cache_examples=False
|
| 330 |
+
)
|
| 331 |
+
|
| 332 |
+
# share_button.click(None, [], [], _js=share_js)
|
| 333 |
+
load_model_btn.click(fn=load_model, inputs=[chosen_model], outputs=[model_status], queue=False)
|
| 334 |
+
video_path.change(fn=get_frame_count,
|
| 335 |
+
inputs=[video_path],
|
| 336 |
+
outputs=[video_length],
|
| 337 |
+
queue=False
|
| 338 |
+
)
|
| 339 |
+
submit_btn.click(fn=run_inference,
|
| 340 |
+
inputs=[prompt,
|
| 341 |
+
video_path,
|
| 342 |
+
version_condition,
|
| 343 |
+
video_length,
|
| 344 |
+
seed,
|
| 345 |
+
],
|
| 346 |
+
outputs=video_res)
|
| 347 |
+
|
| 348 |
+
demo.queue(max_size=12).launch()
|
ControlVideo-master/cog.yaml
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Configuration for Cog ⚙️
|
| 2 |
+
# Reference: https://github.com/replicate/cog/blob/main/docs/yaml.md
|
| 3 |
+
|
| 4 |
+
build:
|
| 5 |
+
gpu: true
|
| 6 |
+
cuda: "11.6"
|
| 7 |
+
system_packages:
|
| 8 |
+
- "libgl1-mesa-glx"
|
| 9 |
+
- "libglib2.0-0"
|
| 10 |
+
python_version: "3.8"
|
| 11 |
+
python_packages:
|
| 12 |
+
- "accelerate==0.17.1"
|
| 13 |
+
- "addict==2.4.0"
|
| 14 |
+
- "basicsr==1.4.2"
|
| 15 |
+
- "bitsandbytes==0.35.4"
|
| 16 |
+
- "clip==0.2.0"
|
| 17 |
+
- "cmake==3.25.2"
|
| 18 |
+
- "controlnet-aux==0.0.4"
|
| 19 |
+
- "decord==0.6.0"
|
| 20 |
+
- "deepspeed==0.8.0"
|
| 21 |
+
- "diffusers==0.14.0"
|
| 22 |
+
- "easydict==1.10"
|
| 23 |
+
- "einops==0.6.0"
|
| 24 |
+
- "ffmpy==0.3.0"
|
| 25 |
+
- "ftfy==6.1.1"
|
| 26 |
+
- "imageio==2.25.1"
|
| 27 |
+
- "imageio-ffmpeg==0.4.8"
|
| 28 |
+
- "moviepy==1.0.3"
|
| 29 |
+
- "numpy==1.24.2"
|
| 30 |
+
- "omegaconf==2.3.0"
|
| 31 |
+
- "opencv-python==4.7.0.68"
|
| 32 |
+
- "pandas==1.5.3"
|
| 33 |
+
- "pillow==9.4.0"
|
| 34 |
+
- "scikit-image==0.19.3"
|
| 35 |
+
- "scipy==1.10.1"
|
| 36 |
+
- "tensorboard==2.12.0"
|
| 37 |
+
- "tensorboard-data-server==0.7.0"
|
| 38 |
+
- "tensorboard-plugin-wit==1.8.1"
|
| 39 |
+
- "termcolor==2.2.0"
|
| 40 |
+
- "thinc==8.1.10"
|
| 41 |
+
- "timm==0.6.12"
|
| 42 |
+
- "tokenizers==0.13.2"
|
| 43 |
+
- "torch==1.13.1"
|
| 44 |
+
- "torchvision==0.14.1"
|
| 45 |
+
- "tqdm==4.64.1"
|
| 46 |
+
- "transformers==4.26.1"
|
| 47 |
+
- "wandb==0.13.10"
|
| 48 |
+
- "xformers==0.0.16"
|
| 49 |
+
- "positional_encodings==6.0.1"
|
| 50 |
+
- "mediapipe==0.10.0"
|
| 51 |
+
- "triton==2.0.0.post1"
|
| 52 |
+
|
| 53 |
+
predict: "predict.py:Predictor"
|
ControlVideo-master/predict.py
ADDED
|
@@ -0,0 +1,164 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Prediction interface for Cog ⚙️
|
| 2 |
+
# https://github.com/replicate/cog/blob/main/docs/python.md
|
| 3 |
+
import os
|
| 4 |
+
import numpy as np
|
| 5 |
+
import argparse
|
| 6 |
+
import imageio
|
| 7 |
+
import torch
|
| 8 |
+
|
| 9 |
+
from einops import rearrange
|
| 10 |
+
from diffusers import DDIMScheduler, AutoencoderKL
|
| 11 |
+
from transformers import CLIPTextModel, CLIPTokenizer
|
| 12 |
+
import controlnet_aux
|
| 13 |
+
from controlnet_aux import OpenposeDetector, CannyDetector, MidasDetector
|
| 14 |
+
|
| 15 |
+
from models.pipeline_controlvideo import ControlVideoPipeline
|
| 16 |
+
from models.util import save_videos_grid, read_video, get_annotation
|
| 17 |
+
from models.unet import UNet3DConditionModel
|
| 18 |
+
from models.controlnet import ControlNetModel3D
|
| 19 |
+
from models.RIFE.IFNet_HDv3 import IFNet
|
| 20 |
+
from cog import BasePredictor, Input, Path
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
sd_path = "checkpoints/stable-diffusion-v1-5"
|
| 24 |
+
inter_path = "checkpoints/flownet.pkl"
|
| 25 |
+
controlnet_dict = {
|
| 26 |
+
"pose": "checkpoints/sd-controlnet-openpose",
|
| 27 |
+
"depth": "checkpoints/sd-controlnet-depth",
|
| 28 |
+
"canny": "checkpoints/sd-controlnet-canny",
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
controlnet_parser_dict = {
|
| 32 |
+
"pose": OpenposeDetector,
|
| 33 |
+
"depth": MidasDetector,
|
| 34 |
+
"canny": CannyDetector,
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
POS_PROMPT = " ,best quality, extremely detailed, HD, ultra-realistic, 8K, HQ, masterpiece, trending on artstation, art, smooth"
|
| 38 |
+
NEG_PROMPT = "longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, deformed body, bloated, ugly, unrealistic"
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
class Predictor(BasePredictor):
|
| 42 |
+
def setup(self):
|
| 43 |
+
"""Load the model into memory to make running multiple predictions efficient"""
|
| 44 |
+
|
| 45 |
+
self.tokenizer = CLIPTokenizer.from_pretrained(sd_path, subfolder="tokenizer")
|
| 46 |
+
self.text_encoder = CLIPTextModel.from_pretrained(
|
| 47 |
+
sd_path, subfolder="text_encoder"
|
| 48 |
+
).to(dtype=torch.float16)
|
| 49 |
+
self.vae = AutoencoderKL.from_pretrained(sd_path, subfolder="vae").to(
|
| 50 |
+
dtype=torch.float16
|
| 51 |
+
)
|
| 52 |
+
self.unet = UNet3DConditionModel.from_pretrained_2d(
|
| 53 |
+
sd_path, subfolder="unet"
|
| 54 |
+
).to(dtype=torch.float16)
|
| 55 |
+
self.interpolater = IFNet(ckpt_path=inter_path).to(dtype=torch.float16)
|
| 56 |
+
self.scheduler = DDIMScheduler.from_pretrained(sd_path, subfolder="scheduler")
|
| 57 |
+
self.controlnet = {
|
| 58 |
+
k: ControlNetModel3D.from_pretrained_2d(controlnet_dict[k]).to(
|
| 59 |
+
dtype=torch.float16
|
| 60 |
+
)
|
| 61 |
+
for k in ["depth", "canny", "pose"]
|
| 62 |
+
}
|
| 63 |
+
self.annotator = {k: controlnet_parser_dict[k]() for k in ["depth", "canny"]}
|
| 64 |
+
self.annotator["pose"] = controlnet_parser_dict["pose"].from_pretrained(
|
| 65 |
+
"lllyasviel/ControlNet", cache_dir="checkpoints"
|
| 66 |
+
)
|
| 67 |
+
|
| 68 |
+
def predict(
|
| 69 |
+
self,
|
| 70 |
+
prompt: str = Input(
|
| 71 |
+
description="Text description of target video",
|
| 72 |
+
default="A striking mallard floats effortlessly on the sparkling pond.",
|
| 73 |
+
),
|
| 74 |
+
video_path: Path = Input(description="source video"),
|
| 75 |
+
condition: str = Input(
|
| 76 |
+
default="depth",
|
| 77 |
+
choices=["depth", "canny", "pose"],
|
| 78 |
+
description="Condition of structure sequence",
|
| 79 |
+
),
|
| 80 |
+
video_length: int = Input(
|
| 81 |
+
default=15, description="Length of synthesized video"
|
| 82 |
+
),
|
| 83 |
+
smoother_steps: str = Input(
|
| 84 |
+
default="19, 20",
|
| 85 |
+
description="Timesteps at which using interleaved-frame smoother, separate with comma",
|
| 86 |
+
),
|
| 87 |
+
is_long_video: bool = Input(
|
| 88 |
+
default=False,
|
| 89 |
+
description="Whether to use hierarchical sampler to produce long video",
|
| 90 |
+
),
|
| 91 |
+
num_inference_steps: int = Input(
|
| 92 |
+
description="Number of denoising steps", default=50
|
| 93 |
+
),
|
| 94 |
+
guidance_scale: float = Input(
|
| 95 |
+
description="Scale for classifier-free guidance", ge=1, le=20, default=12.5
|
| 96 |
+
),
|
| 97 |
+
seed: str = Input(
|
| 98 |
+
default=None, description="Random seed. Leave blank to randomize the seed"
|
| 99 |
+
),
|
| 100 |
+
) -> Path:
|
| 101 |
+
"""Run a single prediction on the model"""
|
| 102 |
+
if seed is None:
|
| 103 |
+
seed = int.from_bytes(os.urandom(2), "big")
|
| 104 |
+
else:
|
| 105 |
+
seed = int(seed)
|
| 106 |
+
print(f"Using seed: {seed}")
|
| 107 |
+
|
| 108 |
+
generator = torch.Generator(device="cuda")
|
| 109 |
+
generator.manual_seed(seed)
|
| 110 |
+
|
| 111 |
+
pipe = ControlVideoPipeline(
|
| 112 |
+
vae=self.vae,
|
| 113 |
+
text_encoder=self.text_encoder,
|
| 114 |
+
tokenizer=self.tokenizer,
|
| 115 |
+
unet=self.unet,
|
| 116 |
+
controlnet=self.controlnet[condition],
|
| 117 |
+
interpolater=self.interpolater,
|
| 118 |
+
scheduler=self.scheduler,
|
| 119 |
+
)
|
| 120 |
+
|
| 121 |
+
pipe.enable_vae_slicing()
|
| 122 |
+
pipe.enable_xformers_memory_efficient_attention()
|
| 123 |
+
pipe.to("cuda")
|
| 124 |
+
|
| 125 |
+
# Step 1. Read a video
|
| 126 |
+
video = read_video(video_path=str(video_path), video_length=video_length)
|
| 127 |
+
|
| 128 |
+
# Step 2. Parse a video to conditional frames
|
| 129 |
+
pil_annotation = get_annotation(video, self.annotator[condition])
|
| 130 |
+
|
| 131 |
+
# Step 3. inference
|
| 132 |
+
smoother_steps = [int(s) for s in smoother_steps.split(",")]
|
| 133 |
+
|
| 134 |
+
if is_long_video:
|
| 135 |
+
window_size = int(np.sqrt(video_length))
|
| 136 |
+
sample = pipe.generate_long_video(
|
| 137 |
+
prompt + POS_PROMPT,
|
| 138 |
+
video_length=video_length,
|
| 139 |
+
frames=pil_annotation,
|
| 140 |
+
num_inference_steps=num_inference_steps,
|
| 141 |
+
smooth_steps=smoother_steps,
|
| 142 |
+
window_size=window_size,
|
| 143 |
+
generator=generator,
|
| 144 |
+
guidance_scale=guidance_scale,
|
| 145 |
+
negative_prompt=NEG_PROMPT,
|
| 146 |
+
).videos
|
| 147 |
+
else:
|
| 148 |
+
sample = pipe(
|
| 149 |
+
prompt + POS_PROMPT,
|
| 150 |
+
video_length=video_length,
|
| 151 |
+
frames=pil_annotation,
|
| 152 |
+
num_inference_steps=num_inference_steps,
|
| 153 |
+
smooth_steps=smoother_steps,
|
| 154 |
+
generator=generator,
|
| 155 |
+
guidance_scale=guidance_scale,
|
| 156 |
+
negative_prompt=NEG_PROMPT,
|
| 157 |
+
).videos
|
| 158 |
+
|
| 159 |
+
out_path = "/tmp/out.mp4"
|
| 160 |
+
save_videos_grid(sample, out_path)
|
| 161 |
+
del pipe
|
| 162 |
+
torch.cuda.empty_cache()
|
| 163 |
+
|
| 164 |
+
return Path(out_path)
|
ControlVideo-master/requirements.txt
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
accelerate==0.17.1
|
| 2 |
+
addict==2.4.0
|
| 3 |
+
basicsr==1.4.2
|
| 4 |
+
bitsandbytes==0.35.4
|
| 5 |
+
clip==0.1.0
|
| 6 |
+
cmake==3.25.2
|
| 7 |
+
controlnet-aux==0.0.6
|
| 8 |
+
decord==0.6.0
|
| 9 |
+
deepspeed==0.8.0
|
| 10 |
+
diffusers==0.14.0
|
| 11 |
+
easydict==1.10
|
| 12 |
+
einops==0.6.0
|
| 13 |
+
ffmpy==0.3.0
|
| 14 |
+
ftfy==6.1.1
|
| 15 |
+
imageio==2.25.1
|
| 16 |
+
imageio-ffmpeg==0.4.8
|
| 17 |
+
moviepy==1.0.3
|
| 18 |
+
numpy==1.24.2
|
| 19 |
+
omegaconf==2.3.0
|
| 20 |
+
opencv-python==4.7.0.68
|
| 21 |
+
pandas==1.5.3
|
| 22 |
+
pillow==9.4.0
|
| 23 |
+
scikit-image==0.19.3
|
| 24 |
+
scipy==1.10.1
|
| 25 |
+
tensorboard==2.12.0
|
| 26 |
+
tensorboard-data-server==0.7.0
|
| 27 |
+
tensorboard-plugin-wit==1.8.1
|
| 28 |
+
termcolor==2.2.0
|
| 29 |
+
thinc==8.1.10
|
| 30 |
+
timm==0.6.12
|
| 31 |
+
tokenizers==0.13.2
|
| 32 |
+
|
| 33 |
+
tqdm==4.64.1
|
| 34 |
+
transformers==4.26.1
|
| 35 |
+
wandb==0.13.10
|
| 36 |
+
|
| 37 |
+
modelcards
|
| 38 |
+
huggingface_hub<0.26.0
|
pix2video-main/code/__pycache__/common.cpython-313.pyc
ADDED
|
Binary file (7.45 kB). View file
|
|
|
pix2video-main/code/__pycache__/custom_utils.cpython-313.pyc
ADDED
|
Binary file (5.2 kB). View file
|
|
|
pix2video-main/code/__pycache__/file_utils.cpython-313.pyc
ADDED
|
Binary file (10.7 kB). View file
|
|
|
pix2video-main/code/__pycache__/video_model_cross_frame_attn.cpython-313.pyc
ADDED
|
Binary file (26.9 kB). View file
|
|
|
pix2video-main/code/common.py
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
import imageio
|
| 3 |
+
import numpy as np
|
| 4 |
+
|
| 5 |
+
device = torch.device('cuda:0') if torch.cuda.is_available() else torch.device('cpu')
|
| 6 |
+
torch_dtype=torch.float32
|
| 7 |
+
|
| 8 |
+
def warp(latents, warp_grid):
|
| 9 |
+
'''
|
| 10 |
+
warp_grid: b-by-h-by-w-by-2
|
| 11 |
+
'''
|
| 12 |
+
if len(latents) == 0:
|
| 13 |
+
return [], []
|
| 14 |
+
|
| 15 |
+
#resize warp grid
|
| 16 |
+
warp_grid = torch.permute(warp_grid, (0,3,1,2))
|
| 17 |
+
warp_grid = torch.nn.functional.interpolate(warp_grid, size=(latents[0].shape[2], latents[0].shape[3]))
|
| 18 |
+
warp_grid = torch.permute(warp_grid, (0,2,3,1))
|
| 19 |
+
|
| 20 |
+
mask = torch.ones_like(latents[0]).to(device)
|
| 21 |
+
mask[:,:,0,0] = 0
|
| 22 |
+
warped_mask = torch.nn.functional.grid_sample(mask, warp_grid.repeat(latents[0].shape[0],1,1,1), mode='nearest', padding_mode='zeros').to(device)
|
| 23 |
+
|
| 24 |
+
warped_latents = []
|
| 25 |
+
for i in range(len(latents)):
|
| 26 |
+
warped_latent = torch.nn.functional.grid_sample(latents[i], warp_grid.repeat(latents[i].shape[0],1,1,1), mode='nearest').to(device)
|
| 27 |
+
warped_latents.append(warped_latent)
|
| 28 |
+
|
| 29 |
+
return warped_latents, warped_mask
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
def get_intermediate_latents_from_warped_images(embedding_optimization, null_inversion, prev_img, prev_result, depth, org_prompt, edit_prompt, grid, W, H):
|
| 33 |
+
#warp mask
|
| 34 |
+
warp_grid = torch.permute(grid, (0,3,1,2))
|
| 35 |
+
warp_grid = torch.nn.functional.interpolate(warp_grid, size=(H//8, W//8))
|
| 36 |
+
warp_grid = torch.permute(warp_grid, (0,2,3,1))
|
| 37 |
+
mask = torch.ones(1,4,H//8,W//8).to(device)
|
| 38 |
+
mask[:,:,0,0] = 0
|
| 39 |
+
warped_mask = torch.nn.functional.grid_sample(mask, warp_grid.repeat(mask.shape[0],1,1,1), mode='nearest', padding_mode="zeros").to(device)
|
| 40 |
+
imageio.imwrite('/home/ceylan/warped_mask.png', torch.permute(warped_mask[0,:3,:,:], (1,2,0)).detach().cpu().numpy())
|
| 41 |
+
|
| 42 |
+
#warp the original and edited previous result
|
| 43 |
+
warp_grid = torch.permute(grid, (0,3,1,2))
|
| 44 |
+
warp_grid = torch.nn.functional.interpolate(warp_grid, size=(prev_img.shape[0], prev_img.shape[1]))
|
| 45 |
+
warp_grid = torch.permute(warp_grid, (0,2,3,1))
|
| 46 |
+
|
| 47 |
+
warped_edited_img = torch.nn.functional.grid_sample(torch.permute(torch.from_numpy(prev_result.astype(np.float32)).unsqueeze(dim=0),(0,3,1,2)).to(device), warp_grid, mode='bilinear', padding_mode="border").to(device)
|
| 48 |
+
warped_edited_img = torch.permute(warped_edited_img[0,:3,:,:], (1,2,0)).detach().cpu().numpy().astype(np.uint8)
|
| 49 |
+
imageio.imwrite('/home/ceylan/warped_edited.png', warped_edited_img)
|
| 50 |
+
|
| 51 |
+
warped_org_img = torch.nn.functional.grid_sample(torch.permute(torch.from_numpy(prev_img.astype(np.float32)).unsqueeze(dim=0),(0,3,1,2)).to(device), warp_grid, mode='bilinear', padding_mode="border").to(device)
|
| 52 |
+
warped_org_img = torch.permute(warped_org_img[0,:3,:,:], (1,2,0)).detach().cpu().numpy().astype(np.uint8)
|
| 53 |
+
imageio.imwrite('/home/ceylan/warped_original.png', warped_org_img)
|
| 54 |
+
|
| 55 |
+
enc_edited = embedding_optimization.image2latent(warped_edited_img)
|
| 56 |
+
|
| 57 |
+
#invert the warped original image
|
| 58 |
+
#null_inversion.init_prompt(org_prompt)
|
| 59 |
+
#_, ddim_latents_org = null_inversion.ddim_inversion(warped_org_img, depth.to(device))
|
| 60 |
+
#ddim_latents_org = ddim_latents_org[::-1]
|
| 61 |
+
(image_gt, image_enc), x_t_org, uncond_emb_org, inverted_image, ddim_latents_org = null_inversion.invert_with_depth( warped_org_img, depth, org_prompt,
|
| 62 |
+
num_inner_steps=10)
|
| 63 |
+
|
| 64 |
+
#edit the warped original image
|
| 65 |
+
result, ddim_latents_edit = embedding_optimization.img2img_with_optimization(warped_org_img, depth, edit_prompt,
|
| 66 |
+
prev_img = enc_edited,
|
| 67 |
+
prev_latents = ddim_latents_org,
|
| 68 |
+
warp_grid=None, warp_mask=None,
|
| 69 |
+
optimize_cond=False, optimize_null=True,
|
| 70 |
+
init_latent = x_t_org.to(device),
|
| 71 |
+
uncond_embeddings=uncond_emb_org, inverted_noise=ddim_latents_org,
|
| 72 |
+
w_residual=0.0, w_encode=0.01,
|
| 73 |
+
match_gradient=False)
|
| 74 |
+
|
| 75 |
+
#result, ddim_latents_edit = embedding_optimization.img2img_cfg(warped_org_img, depth, edit_prompt,
|
| 76 |
+
# ref_latent=embedding_optimization.image2latent(warped_edited_img),
|
| 77 |
+
# init_latent = x_t_org.to(device), uncond_embeddings=uncond_emb_org)
|
| 78 |
+
|
| 79 |
+
image = (result / 2 + 0.5).clamp(0, 1)
|
| 80 |
+
image = image.cpu().permute(0, 2, 3, 1).numpy()[0]
|
| 81 |
+
image = (image * 255).astype(np.uint8)
|
| 82 |
+
imageio.imwrite('/home/ceylan/warped_original_edited.png', image)
|
| 83 |
+
|
| 84 |
+
#invert the warped edited frame based on the warped original
|
| 85 |
+
#null_inversion.init_prompt(edit_prompt)
|
| 86 |
+
#_, ddim_latents_edit = null_inversion.ddim_inversion_ref(warped_edited_img, ddim_latents_org, ref_embedding=uncond_embeddings, depth=depth.to(device))
|
| 87 |
+
#ddim_latents_edit = ddim_latents_edit[::-1]
|
| 88 |
+
|
| 89 |
+
#_, ddim_latents_edit_no_opt = null_inversion.ddim_inversion(warped_edited_img, depth.to(device))
|
| 90 |
+
#ddim_latents_edit_no_opt = ddim_latents_edit_no_opt[::-1]
|
| 91 |
+
#
|
| 92 |
+
##encode the warped image
|
| 93 |
+
#prev_result = ddim_latents_edit[-1]
|
| 94 |
+
|
| 95 |
+
#residuals
|
| 96 |
+
prev_latents = []
|
| 97 |
+
for j in range(len(ddim_latents_edit)):
|
| 98 |
+
prev_latents.append(ddim_latents_edit[j]- ddim_latents_org[j])
|
| 99 |
+
print(torch.nn.functional.mse_loss(ddim_latents_edit[j], ddim_latents_org[j]))
|
| 100 |
+
#print(torch.nn.functional.mse_loss(ddim_latents_edit_no_opt[j], ddim_latents_org[j]))
|
| 101 |
+
|
| 102 |
+
return ddim_latents_org, prev_latents, enc_edited, warped_mask
|
pix2video-main/code/custom_utils.py
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import itertools
|
| 2 |
+
import math
|
| 3 |
+
import os
|
| 4 |
+
import random
|
| 5 |
+
import numpy as np
|
| 6 |
+
import torch
|
| 7 |
+
import torch.utils.checkpoint
|
| 8 |
+
import torch.nn.functional as F
|
| 9 |
+
from mydiffusers.models.attention import CrossAttention
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
def create_custom_diffusion(unet, finetune_layers):
|
| 13 |
+
for name, params in unet.named_parameters():
|
| 14 |
+
found = False
|
| 15 |
+
for j in range(len(finetune_layers)):
|
| 16 |
+
if finetune_layers[j] in name:
|
| 17 |
+
params.requires_grad = True
|
| 18 |
+
found = True
|
| 19 |
+
print(name)
|
| 20 |
+
break
|
| 21 |
+
if not found:
|
| 22 |
+
params.requires_grad = False
|
| 23 |
+
|
| 24 |
+
#duygu: this is the custom forward function we define for the attention layer
|
| 25 |
+
#duygu: ignore: warp_grid, key_matrix, value_matrix, query_matrix, f_emb
|
| 26 |
+
def new_forward(self, hidden_states, **kwargs):
|
| 27 |
+
batch_size, sequence_length, _ = hidden_states.shape
|
| 28 |
+
crossattn = False
|
| 29 |
+
selfattn = False
|
| 30 |
+
context = None
|
| 31 |
+
self_attn_query_features_cond=None
|
| 32 |
+
warp_grid=None
|
| 33 |
+
if 'context' in kwargs:
|
| 34 |
+
context = kwargs['context']
|
| 35 |
+
elif 'encoder_hidden_states' in kwargs:
|
| 36 |
+
context = kwargs['encoder_hidden_states']
|
| 37 |
+
selfattn = True
|
| 38 |
+
|
| 39 |
+
if 'self_attn_query_features_cond' in kwargs:
|
| 40 |
+
self_attn_query_features_cond=kwargs['self_attn_query_features_cond']
|
| 41 |
+
if self_attn_query_features_cond is not None:
|
| 42 |
+
selfattn = True
|
| 43 |
+
|
| 44 |
+
if context is not None:
|
| 45 |
+
crossattn = True
|
| 46 |
+
else:
|
| 47 |
+
#duygu:if self_attn_query_features_cond is not provided we fill it with hidden_states
|
| 48 |
+
#this is equivalent to running the original self attention
|
| 49 |
+
if self_attn_query_features_cond is None and hidden_states.shape[0] > 1:
|
| 50 |
+
self_attn_query_features_cond = torch.zeros_like(hidden_states).to(hidden_states.device)
|
| 51 |
+
j = 0
|
| 52 |
+
while j < hidden_states.shape[0]:
|
| 53 |
+
self_attn_query_features_cond[j] = hidden_states[j+1]
|
| 54 |
+
self_attn_query_features_cond[j+1] = hidden_states[j+1]
|
| 55 |
+
j += 2
|
| 56 |
+
selfattn = True
|
| 57 |
+
elif self_attn_query_features_cond is None:
|
| 58 |
+
#self_attn_query_features_cond = torch.cat([torch.zeros_like(hidden_states).to(hidden_states.device)]*2, dim = 1)
|
| 59 |
+
#self_attn_query_features_cond[:, 0:hidden_states.shape[1], :] = hidden_states
|
| 60 |
+
#self_attn_query_features_cond[:, hidden_states.shape[1]:, :] = hidden_states
|
| 61 |
+
|
| 62 |
+
self_attn_query_features_cond = hidden_states
|
| 63 |
+
selfattn = True
|
| 64 |
+
|
| 65 |
+
context = context if context is not None else hidden_states
|
| 66 |
+
|
| 67 |
+
if selfattn:
|
| 68 |
+
query = self.to_q(hidden_states)
|
| 69 |
+
|
| 70 |
+
key = self.to_k(self_attn_query_features_cond)
|
| 71 |
+
|
| 72 |
+
value = self.to_v(self_attn_query_features_cond)
|
| 73 |
+
|
| 74 |
+
#print('self attn')
|
| 75 |
+
#key = self.to_k(self_attn_query_features_cond)
|
| 76 |
+
#value = self.to_v(self_attn_query_features_cond)
|
| 77 |
+
else:
|
| 78 |
+
query = self.to_q(hidden_states)
|
| 79 |
+
|
| 80 |
+
key = self.to_k(context)
|
| 81 |
+
value = self.to_v(context)
|
| 82 |
+
|
| 83 |
+
dim = query.shape[-1]
|
| 84 |
+
|
| 85 |
+
query = self.reshape_heads_to_batch_dim(query)
|
| 86 |
+
key = self.reshape_heads_to_batch_dim(key)
|
| 87 |
+
value = self.reshape_heads_to_batch_dim(value)
|
| 88 |
+
|
| 89 |
+
# TODO(PVP) - mask is currently never used. Remember to re-implement when used
|
| 90 |
+
|
| 91 |
+
# attention, what we cannot get enough of
|
| 92 |
+
if self._use_memory_efficient_attention_xformers:
|
| 93 |
+
hidden_states = self._memory_efficient_attention_xformers(query, key, value)
|
| 94 |
+
# Some versions of xformers return output in fp32, cast it back to the dtype of the input
|
| 95 |
+
hidden_states = hidden_states.to(query.dtype)
|
| 96 |
+
else:
|
| 97 |
+
if self._slice_size is None or query.shape[0] // self._slice_size == 1:
|
| 98 |
+
hidden_states = self._attention(query, key, value)
|
| 99 |
+
else:
|
| 100 |
+
hidden_states = self._sliced_attention(query, key, value, sequence_length, dim)
|
| 101 |
+
|
| 102 |
+
# linear proj
|
| 103 |
+
hidden_states = self.to_out[0](hidden_states)
|
| 104 |
+
# dropout
|
| 105 |
+
hidden_states = self.to_out[1](hidden_states)
|
| 106 |
+
return hidden_states
|
| 107 |
+
|
| 108 |
+
def change_forward(unet):
|
| 109 |
+
for layer in unet.children():
|
| 110 |
+
if type(layer) == CrossAttention:
|
| 111 |
+
bound_method = new_forward.__get__(layer, layer.__class__)
|
| 112 |
+
setattr(layer, 'forward', bound_method)
|
| 113 |
+
else:
|
| 114 |
+
change_forward(layer)
|
| 115 |
+
|
| 116 |
+
change_forward(unet)
|
| 117 |
+
return unet
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
def save_progress(unet, save_path, finetune_layers):
|
| 121 |
+
delta_dict = {'unet': {} }
|
| 122 |
+
|
| 123 |
+
for name, params in unet.named_parameters():
|
| 124 |
+
for j in range(len(finetune_layers)):
|
| 125 |
+
if finetune_layers[j] in name:
|
| 126 |
+
delta_dict['unet'][name] = params.cpu().clone()
|
| 127 |
+
|
| 128 |
+
torch.save(delta_dict, save_path)
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
def load_model(unet, save_path, finetune_layers):
|
| 132 |
+
st = torch.load(save_path)
|
| 133 |
+
|
| 134 |
+
print(st.keys())
|
| 135 |
+
for name, params in unet.named_parameters():
|
| 136 |
+
for j in range(len(finetune_layers)):
|
| 137 |
+
if finetune_layers[j] in name:
|
| 138 |
+
params.data.copy_(st['unet'][f'{name}'])
|
| 139 |
+
|
| 140 |
+
|
| 141 |
+
def freeze_params(params):
|
| 142 |
+
for param in params:
|
| 143 |
+
param.requires_grad = False
|
pix2video-main/code/file_utils.py
ADDED
|
@@ -0,0 +1,226 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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da:0') if torch.cuda.is_available() else torch.device('cpu')
|
| 10 |
+
|
| 11 |
+
def get_data_paths(folder_path, output_path, noFrames, reverse=False):
|
| 12 |
+
image_paths = []
|
| 13 |
+
depth_paths = []
|
| 14 |
+
noise_paths = []
|
| 15 |
+
output_paths = []
|
| 16 |
+
frame_numbers = []
|
| 17 |
+
|
| 18 |
+
for i in range(noFrames):
|
| 19 |
+
f = '%06d.png' % (i)
|
| 20 |
+
|
| 21 |
+
image_paths.append(os.path.join(folder_path, f))
|
| 22 |
+
depth_paths.append(os.path.join(folder_path, f[:-3]+'npy'))
|
| 23 |
+
noise_paths.append(os.path.join(folder_path, f[:-4]))
|
| 24 |
+
output_paths.append(os.path.join(output_path, f))
|
| 25 |
+
frame_numbers.append(i)
|
| 26 |
+
|
| 27 |
+
if reverse:
|
| 28 |
+
image_paths = image_paths[::-1]
|
| 29 |
+
depth_paths = depth_paths[::-1]
|
| 30 |
+
noise_paths = noise_paths[::-1]
|
| 31 |
+
output_paths = output_paths[::-1]
|
| 32 |
+
frame_numbers = frame_numbers[::-1]
|
| 33 |
+
|
| 34 |
+
return image_paths, depth_paths, noise_paths, output_paths, frame_numbers
|
| 35 |
+
|
| 36 |
+
def load_512(image_path, output_path='', left=0, right=0, top=0, bottom=0):
|
| 37 |
+
if type(image_path) is str:
|
| 38 |
+
image = np.array(Image.open(image_path).convert("RGB"))[:, :, :3]
|
| 39 |
+
else:
|
| 40 |
+
image = image_path
|
| 41 |
+
h, w, c = image.shape
|
| 42 |
+
left = min(left, w-1)
|
| 43 |
+
right = min(right, w - left - 1)
|
| 44 |
+
top = min(top, h - left - 1)
|
| 45 |
+
bottom = min(bottom, h - top - 1)
|
| 46 |
+
image = image[top:h-bottom, left:w-right]
|
| 47 |
+
|
| 48 |
+
#h, w, c = image.shape
|
| 49 |
+
#if h < w:
|
| 50 |
+
# offset = (w - h) // 2
|
| 51 |
+
# image = image[:, offset:offset + h]
|
| 52 |
+
#elif w < h:
|
| 53 |
+
# offset = (h - w) // 2
|
| 54 |
+
# image = image[offset:offset + w]
|
| 55 |
+
|
| 56 |
+
h, w, c = image.shape
|
| 57 |
+
|
| 58 |
+
if False:
|
| 59 |
+
#if h % 64 != 0 or w % 64 != 0:
|
| 60 |
+
|
| 61 |
+
w, h = map(lambda x: x - x % 64, (w, h)) # resize to integer multiple of 64
|
| 62 |
+
|
| 63 |
+
while w > 512 or h > 512:
|
| 64 |
+
w /= 2
|
| 65 |
+
h /= 2
|
| 66 |
+
|
| 67 |
+
image = Image.fromarray(image)
|
| 68 |
+
|
| 69 |
+
image = image.resize((int(w), int(h)), resample=PIL.Image.LANCZOS)
|
| 70 |
+
|
| 71 |
+
if output_path != '':
|
| 72 |
+
imageio.imwrite(output_path, np.array(image))
|
| 73 |
+
else:
|
| 74 |
+
imageio.imwrite(output_path, np.array(image))
|
| 75 |
+
|
| 76 |
+
image = np.array(image.convert("RGB"))
|
| 77 |
+
|
| 78 |
+
image = Image.fromarray(image).resize((512, 512))
|
| 79 |
+
image = np.array(image.convert("RGB"))
|
| 80 |
+
|
| 81 |
+
return image
|
| 82 |
+
|
| 83 |
+
def load_512_crop(image_path, output_path='', left=0, right=0, top=0, bottom=0):
|
| 84 |
+
if type(image_path) is str:
|
| 85 |
+
image = np.array(Image.open(image_path).convert("RGB"))[:, :, :3]
|
| 86 |
+
else:
|
| 87 |
+
image = image_path
|
| 88 |
+
h, w, c = image.shape
|
| 89 |
+
left = min(left, w-1)
|
| 90 |
+
right = min(right, w - left - 1)
|
| 91 |
+
top = min(top, h - left - 1)
|
| 92 |
+
bottom = min(bottom, h - top - 1)
|
| 93 |
+
image = image[top:h-bottom, left:w-right]
|
| 94 |
+
|
| 95 |
+
h, w, c = image.shape
|
| 96 |
+
if h < w:
|
| 97 |
+
offset = (w - h) #// 2
|
| 98 |
+
image = image[:, offset:offset + h]
|
| 99 |
+
elif w < h:
|
| 100 |
+
offset = (h - w)//2
|
| 101 |
+
#offset -= 200
|
| 102 |
+
image = image[offset:offset + w]
|
| 103 |
+
#image = image[300:offset+300]
|
| 104 |
+
|
| 105 |
+
h, w, c = image.shape
|
| 106 |
+
|
| 107 |
+
image = Image.fromarray(image)
|
| 108 |
+
|
| 109 |
+
image = image.resize((512, 512), resample=PIL.Image.LANCZOS)
|
| 110 |
+
|
| 111 |
+
if output_path != '':
|
| 112 |
+
imageio.imwrite(output_path, np.array(image))
|
| 113 |
+
else:
|
| 114 |
+
imageio.imwrite(output_path, np.array(image))
|
| 115 |
+
|
| 116 |
+
image = np.array(image.convert("RGB"))
|
| 117 |
+
|
| 118 |
+
#image = Image.fromarray(image).resize((1024, 1024))
|
| 119 |
+
#image = np.array(image.convert("RGB"))
|
| 120 |
+
|
| 121 |
+
return image
|
| 122 |
+
|
| 123 |
+
def load_inversion_epsilon( invert_path, input_image, depth, prompt, null_inversion,
|
| 124 |
+
warp_grid=None, warp_mask=None,
|
| 125 |
+
num_inner_steps=10):
|
| 126 |
+
if os.path.exists(invert_path+'_epsilon.npy'):
|
| 127 |
+
inverted_noise = np.load(invert_path + '_inverted_latent.npy')
|
| 128 |
+
uncond_embeddings = np.load(invert_path + '_uncond_emb.npy')
|
| 129 |
+
epsilon_list = np.load(invert_path + '_epsilon.npy')
|
| 130 |
+
else:
|
| 131 |
+
x_t, uncond_embeddings, inverted_image, inverted_noise, epsilon_list = null_inversion.invert_with_depth( input_image,
|
| 132 |
+
depth,
|
| 133 |
+
prompt,
|
| 134 |
+
num_inner_steps = num_inner_steps,
|
| 135 |
+
verbose=True)
|
| 136 |
+
inverted_noise = torch.stack(inverted_noise).detach().cpu().numpy()
|
| 137 |
+
uncond_embeddings = torch.stack(uncond_embeddings).detach().cpu().numpy()
|
| 138 |
+
epsilon_list = torch.stack(epsilon_list).detach().cpu().numpy()
|
| 139 |
+
with open(invert_path + '_inverted_latent.npy', 'wb') as of:
|
| 140 |
+
np.save(of, inverted_noise)
|
| 141 |
+
with open(invert_path + '_uncond_emb.npy', 'wb') as of:
|
| 142 |
+
np.save(of, uncond_embeddings)
|
| 143 |
+
with open(invert_path + '_epsilon.npy', 'wb') as of:
|
| 144 |
+
np.save(of, epsilon_list)
|
| 145 |
+
|
| 146 |
+
return inverted_noise, uncond_embeddings, epsilon_list
|
| 147 |
+
|
| 148 |
+
def load_inversion( invert_path, input_image, depth, prompt, null_inversion,
|
| 149 |
+
ref_latents = None, warp_grid=None, warp_mask=None,
|
| 150 |
+
num_inner_steps=10):
|
| 151 |
+
if os.path.exists(invert_path+'_inverted_latent.npy'):
|
| 152 |
+
inverted_noise = np.load(invert_path + '_inverted_latent.npy')
|
| 153 |
+
uncond_embeddings = np.load(invert_path + '_uncond_emb.npy')
|
| 154 |
+
else:
|
| 155 |
+
if ref_latents is not None:
|
| 156 |
+
(image_gt, image_enc), x_t, uncond_embeddings, inverted_image, inverted_noise = null_inversion.invert_with_depth_with_ref( input_image,
|
| 157 |
+
depth,
|
| 158 |
+
prompt,
|
| 159 |
+
ref_latents,
|
| 160 |
+
warp_grid,
|
| 161 |
+
warp_mask,
|
| 162 |
+
num_inner_steps=num_inner_steps,
|
| 163 |
+
verbose=True)
|
| 164 |
+
else:
|
| 165 |
+
(image_gt, image_enc), x_t, uncond_embeddings, inverted_image, inverted_noise = null_inversion.invert_with_depth( input_image,
|
| 166 |
+
depth,
|
| 167 |
+
prompt,
|
| 168 |
+
num_inner_steps = num_inner_steps,
|
| 169 |
+
verbose=True)
|
| 170 |
+
inverted_noise = torch.stack(inverted_noise).detach().cpu().numpy()
|
| 171 |
+
uncond_embeddings = torch.stack(uncond_embeddings).detach().cpu().numpy()
|
| 172 |
+
with open(invert_path + '_inverted_latent.npy', 'wb') as of:
|
| 173 |
+
np.save(of, inverted_noise)
|
| 174 |
+
with open(invert_path + '_uncond_emb.npy', 'wb') as of:
|
| 175 |
+
np.save(of, uncond_embeddings)
|
| 176 |
+
|
| 177 |
+
return inverted_noise, uncond_embeddings
|
| 178 |
+
|
| 179 |
+
def load_depth(model, depth_path, input_image, W=512, H=512, inverted=False):
|
| 180 |
+
|
| 181 |
+
if os.path.exists(depth_path):
|
| 182 |
+
depth = np.load(depth_path)
|
| 183 |
+
|
| 184 |
+
else:
|
| 185 |
+
pixel_values = model.feature_extractor(images=[input_image], return_tensors="pt").pixel_values
|
| 186 |
+
pixel_values = pixel_values.to(device=device)
|
| 187 |
+
depth = model.depth_estimator(pixel_values).predicted_depth
|
| 188 |
+
depth = depth.permute((1,2,0)).squeeze(dim=-1)
|
| 189 |
+
depth = depth.detach().cpu().numpy()
|
| 190 |
+
with open(depth_path, 'wb') as of:
|
| 191 |
+
np.save(of, depth)
|
| 192 |
+
inverted=False
|
| 193 |
+
|
| 194 |
+
indices = np.where(depth != -1)
|
| 195 |
+
bg_indices = np.where(depth == -1)
|
| 196 |
+
d_values = depth[indices[0], indices[1]]
|
| 197 |
+
min_d = np.min(d_values)
|
| 198 |
+
max_d = np.max(d_values)
|
| 199 |
+
|
| 200 |
+
if inverted:
|
| 201 |
+
if len(bg_indices[0] > 0):
|
| 202 |
+
depth[bg_indices] = max_d + 10
|
| 203 |
+
max_d = max_d + 10
|
| 204 |
+
depth = -depth
|
| 205 |
+
else:
|
| 206 |
+
if len(bg_indices[0] > 0):
|
| 207 |
+
depth[bg_indices] = min_d - 10
|
| 208 |
+
min_d = min_d - 10
|
| 209 |
+
|
| 210 |
+
depth = torch.from_numpy(depth)
|
| 211 |
+
depth = rearrange(depth, 'h w -> 1 1 h w')
|
| 212 |
+
|
| 213 |
+
depth_min, depth_max = torch.amin(depth, dim=[1, 2, 3], keepdim=True), torch.amax(depth, dim=[1, 2, 3],
|
| 214 |
+
keepdim=True)
|
| 215 |
+
depth = torch.nn.functional.interpolate(
|
| 216 |
+
depth,
|
| 217 |
+
size=(H//8,W//8),
|
| 218 |
+
mode="bilinear",
|
| 219 |
+
align_corners=False,
|
| 220 |
+
)
|
| 221 |
+
depth_min, depth_max = torch.amin(depth, dim=[1, 2, 3], keepdim=True), torch.amax(depth, dim=[1, 2, 3],
|
| 222 |
+
keepdim=True)
|
| 223 |
+
depth = 2. * (depth - depth_min) / (depth_max - depth_min) - 1.
|
| 224 |
+
depth = depth.to(device).type(torch.FloatTensor)
|
| 225 |
+
|
| 226 |
+
return depth
|
pix2video-main/code/test_cfg.py
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from tqdm.notebook import tqdm
|
| 2 |
+
import torch
|
| 3 |
+
from mydiffusers import StableDiffusionPipeline, StableDiffusionDepth2ImgPipeline, DDIMScheduler
|
| 4 |
+
import numpy as np
|
| 5 |
+
import abc
|
| 6 |
+
import shutil
|
| 7 |
+
from PIL import Image
|
| 8 |
+
from pytorch_lightning import seed_everything
|
| 9 |
+
import os
|
| 10 |
+
import cv2
|
| 11 |
+
import contextlib
|
| 12 |
+
import imageio
|
| 13 |
+
import argparse
|
| 14 |
+
import json
|
| 15 |
+
|
| 16 |
+
from video_model_cross_frame_attn import *
|
| 17 |
+
from file_utils import *
|
| 18 |
+
from common import *
|
| 19 |
+
|
| 20 |
+
def create_video_with_images(glob_pattern: str, output_filename: str):
|
| 21 |
+
os.system(f"ffmpeg -pattern_type glob -i '{glob_pattern}' -c:v libx264 -r 30 -pix_fmt yuv420p {output_filename}")
|
| 22 |
+
|
| 23 |
+
def create_gif_with_images(glob_pattern: str, output_filename: str):
|
| 24 |
+
os.system(f"ffmpeg -f image2 -framerate 30 -pattern_type glob -i '{glob_pattern}' -loop -1 {output_filename}")
|
| 25 |
+
|
| 26 |
+
def read_jsonl(jsonl_path):
|
| 27 |
+
with open(jsonl_path, 'r') as f:
|
| 28 |
+
lines = f.readlines()
|
| 29 |
+
return [json.loads(line) for line in lines]
|
| 30 |
+
|
| 31 |
+
def extract_frames(video_path, output_dir):
|
| 32 |
+
if not os.path.exists(output_dir):
|
| 33 |
+
os.makedirs(output_dir)
|
| 34 |
+
cap = cv2.VideoCapture(video_path)
|
| 35 |
+
frame_count = 0
|
| 36 |
+
while True:
|
| 37 |
+
ret, frame = cap.read()
|
| 38 |
+
if not ret:
|
| 39 |
+
break
|
| 40 |
+
frame_path = os.path.join(output_dir, f"frame_{frame_count:04d}.png")
|
| 41 |
+
cv2.imwrite(frame_path, frame)
|
| 42 |
+
frame_count += 1
|
| 43 |
+
cap.release()
|
| 44 |
+
return frame_count
|
| 45 |
+
|
| 46 |
+
def load_512(image_path):
|
| 47 |
+
try:
|
| 48 |
+
image = Image.open(image_path).convert("RGB")
|
| 49 |
+
image = image.resize((512, 512))
|
| 50 |
+
return np.array(image)
|
| 51 |
+
except Exception as e:
|
| 52 |
+
print(f"Error loading image {image_path}: {e}")
|
| 53 |
+
return None
|
| 54 |
+
|
| 55 |
+
def get_data_paths_from_frames(frame_dir, output_path, noFrames):
|
| 56 |
+
image_paths = [os.path.join(frame_dir, f"frame_{i:04d}.png") for i in range(noFrames)]
|
| 57 |
+
depth_paths = [os.path.join(frame_dir, f"depth_{i:04d}.png") for i in range(noFrames)]
|
| 58 |
+
noise_paths = [os.path.join(frame_dir, f"noise_{i:04d}.pt") for i in range(noFrames)]
|
| 59 |
+
output_paths = [os.path.join(output_path, f"output_{i:04d}.png") for i in range(noFrames)]
|
| 60 |
+
frame_numbers = list(range(noFrames))
|
| 61 |
+
return image_paths, depth_paths, noise_paths, output_paths, frame_numbers
|
| 62 |
+
|
| 63 |
+
scheduler = DDIMScheduler(beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear", clip_sample=False, set_alpha_to_one=False)
|
| 64 |
+
MY_TOKEN = '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'
|
| 65 |
+
LOW_RESOURCE = False
|
| 66 |
+
NUM_DDIM_STEPS = 50
|
| 67 |
+
GUIDANCE_SCALE = 7.5
|
| 68 |
+
MAX_NUM_WORDS = 77
|
| 69 |
+
model_id = "/home/wangjuntong/pix2video-main/stable-diffusion-2-depth/"
|
| 70 |
+
ldm_stable = StableDiffusionDepth2ImgPipeline.from_pretrained(model_id, use_auth_token=MY_TOKEN, scheduler=scheduler).to(device)
|
| 71 |
+
|
| 72 |
+
tokenizer = ldm_stable.tokenizer
|
| 73 |
+
|
| 74 |
+
seed = 2147483647
|
| 75 |
+
seed_everything(seed)
|
| 76 |
+
|
| 77 |
+
strength = 1.0
|
| 78 |
+
|
| 79 |
+
parser = argparse.ArgumentParser()
|
| 80 |
+
parser.add_argument("--jsonl_path", type=str, default="path/to/your/jsonl/file.jsonl")
|
| 81 |
+
parser.add_argument("--output_root", type=str, default="./output")
|
| 82 |
+
parser.add_argument("--temp_frame_dir", type=str, default="./temp_frames")
|
| 83 |
+
parser.add_argument("--inversion_root", type=str, default="/home/wangjuntong/video_editing_dataset/inversion")
|
| 84 |
+
opt = parser.parse_args()
|
| 85 |
+
|
| 86 |
+
jsonl_data = read_jsonl(opt.jsonl_path)
|
| 87 |
+
|
| 88 |
+
for item in jsonl_data:
|
| 89 |
+
video_name = os.path.basename(item['video'])
|
| 90 |
+
video_path = os.path.join("/home/wangjuntong/video_editing_dataset/all_sourse", item['video'])
|
| 91 |
+
output_path = os.path.join(opt.output_root, video_name)
|
| 92 |
+
temp_frame_dir = os.path.join(opt.temp_frame_dir, video_name)
|
| 93 |
+
inversion_path = os.path.join(opt.inversion_root, video_name)
|
| 94 |
+
|
| 95 |
+
if not os.path.exists(output_path):
|
| 96 |
+
os.makedirs(output_path)
|
| 97 |
+
|
| 98 |
+
noFrames = extract_frames(video_path, temp_frame_dir)
|
| 99 |
+
if noFrames == 0:
|
| 100 |
+
print(f"Error: No frames extracted from {video_path}")
|
| 101 |
+
continue
|
| 102 |
+
|
| 103 |
+
image_paths, depth_paths, noise_paths, output_paths, frame_numbers = get_data_paths_from_frames(temp_frame_dir, output_path, noFrames)
|
| 104 |
+
|
| 105 |
+
images = []
|
| 106 |
+
for i in range(noFrames):
|
| 107 |
+
image_path = image_paths[i]
|
| 108 |
+
input_image = load_512(image_path)
|
| 109 |
+
if input_image is not None:
|
| 110 |
+
images.append(input_image)
|
| 111 |
+
else:
|
| 112 |
+
print(f"Skipping frame {i} due to loading failure")
|
| 113 |
+
|
| 114 |
+
if not images:
|
| 115 |
+
print(f"Error: No valid images loaded for {video_path}")
|
| 116 |
+
continue
|
| 117 |
+
|
| 118 |
+
depths = []
|
| 119 |
+
for i in range(len(images)):
|
| 120 |
+
H = images[i].shape[0]
|
| 121 |
+
W = images[i].shape[1]
|
| 122 |
+
depth = load_depth(ldm_stable, depth_paths[i], images[i], W=W, H=H)
|
| 123 |
+
depths.append(depth)
|
| 124 |
+
|
| 125 |
+
dataset = VideoDataset(ldm_stable, images, depths, temp_frame_dir, inversion_path, device, 0)
|
| 126 |
+
|
| 127 |
+
video_model = VideoModel(ldm_stable, NUM_DDIM_STEPS, GUIDANCE_SCALE, output_path, [item['prompt']], item['prompt'], no_frames=len(images),
|
| 128 |
+
use_keyframe_only=0, device=device,
|
| 129 |
+
classifier_guidance_flag=1, per_frame_classifier_guidance=1,
|
| 130 |
+
use_self_attention_injection=1, target_index=25).to(device)
|
| 131 |
+
|
| 132 |
+
video_model.perform_inversion(dataset)
|
| 133 |
+
|
| 134 |
+
video_model.test(dataset, output_path, [item['edit_prompt']])
|
| 135 |
+
|
| 136 |
+
glob_pattern = os.path.join(output_path, './*.png')
|
| 137 |
+
gif_output = os.path.join(output_path, 'out_cfg.gif')
|
| 138 |
+
create_gif_with_images(glob_pattern, gif_output)
|
| 139 |
+
mp4_output = os.path.join(output_path, 'out_cfg.mp4')
|
| 140 |
+
create_video_with_images(glob_pattern, mp4_output)
|
| 141 |
+
|
| 142 |
+
shutil.rmtree(temp_frame_dir)
|
pix2video-main/code/video_model_cross_frame_attn.py
ADDED
|
@@ -0,0 +1,538 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch
|
| 2 |
+
from torch.utils.data import Dataset, DataLoader
|
| 3 |
+
import numpy as np
|
| 4 |
+
from torch.optim.adam import Adam
|
| 5 |
+
|
| 6 |
+
import torch.nn.functional as nnf
|
| 7 |
+
from mydiffusers import DDIMScheduler
|
| 8 |
+
from mydiffusers.models.embeddings import TimestepEmbedding, Timesteps
|
| 9 |
+
from PIL import Image
|
| 10 |
+
import imageio
|
| 11 |
+
from tqdm import tqdm
|
| 12 |
+
import os
|
| 13 |
+
from file_utils import *
|
| 14 |
+
from custom_utils import *
|
| 15 |
+
from pytorch_lightning import seed_everything
|
| 16 |
+
from random import randrange
|
| 17 |
+
import time
|
| 18 |
+
|
| 19 |
+
class VideoDataset(Dataset):
|
| 20 |
+
""" Dataset for loading the Human Alloy data. In this case, images are
|
| 21 |
+
chosen within a video.
|
| 22 |
+
"""
|
| 23 |
+
|
| 24 |
+
def __init__(self, image_model, image_array, depth_array, data_path, inversion_path, device, is_reverse=False):
|
| 25 |
+
self.image_array = image_array
|
| 26 |
+
self.model = image_model
|
| 27 |
+
self.device = device
|
| 28 |
+
|
| 29 |
+
self.image_latents = []
|
| 30 |
+
self.depth = []
|
| 31 |
+
self.inversions = []
|
| 32 |
+
|
| 33 |
+
self.data_path = data_path
|
| 34 |
+
self.inversion_path = inversion_path
|
| 35 |
+
|
| 36 |
+
for i in range(len(image_array)):
|
| 37 |
+
self.image_latents.append(self.image2latent(image_array[i]))
|
| 38 |
+
self.depth.append(depth_array[i].to(self.device))
|
| 39 |
+
|
| 40 |
+
inv_path = os.path.join(inversion_path, '%06d.pt' % i)
|
| 41 |
+
if os.path.exists(inv_path):
|
| 42 |
+
inv = torch.load(inv_path)
|
| 43 |
+
if len(inv) > 1:
|
| 44 |
+
inv = inv[-1]
|
| 45 |
+
self.inversions.append(inv.to(self.device))
|
| 46 |
+
|
| 47 |
+
H = image_array[0].shape[0]
|
| 48 |
+
W = image_array[0].shape[1]
|
| 49 |
+
|
| 50 |
+
self.no_frames = len(image_array)
|
| 51 |
+
self.local_neighbor_indices = [-2, -1, 1, 2]
|
| 52 |
+
|
| 53 |
+
self.keyframe_index = 0
|
| 54 |
+
self.is_reverse = is_reverse
|
| 55 |
+
if is_reverse:
|
| 56 |
+
self.keyframe_index = self.no_frames-1
|
| 57 |
+
print('keyframe_index:%d\n' % self.keyframe_index)
|
| 58 |
+
|
| 59 |
+
@torch.no_grad()
|
| 60 |
+
def image2latent(self, image):
|
| 61 |
+
with torch.no_grad():
|
| 62 |
+
if type(image) is Image:
|
| 63 |
+
image = np.array(image)
|
| 64 |
+
if type(image) is torch.Tensor and image.dim() == 4:
|
| 65 |
+
latents = image
|
| 66 |
+
else:
|
| 67 |
+
image = torch.from_numpy(image).type(torch.FloatTensor) / 127.5 - 1
|
| 68 |
+
image = image.permute(2, 0, 1).unsqueeze(0).to(self.device)
|
| 69 |
+
latents = self.model.vae.encode(image)['latent_dist'].mean
|
| 70 |
+
latents = latents * 0.18215
|
| 71 |
+
return latents
|
| 72 |
+
|
| 73 |
+
def __getitem__(self, index):
|
| 74 |
+
neighbor_index = index-1
|
| 75 |
+
if neighbor_index < 0:
|
| 76 |
+
neighbor_index += self.no_frames
|
| 77 |
+
elif neighbor_index >= self.no_frames:
|
| 78 |
+
neighbor_index -= self.no_frames
|
| 79 |
+
|
| 80 |
+
return {'latent' : self.image_latents[index],
|
| 81 |
+
'depth': self.depth[index],
|
| 82 |
+
'frame' : torch.tensor(index, device=self.device),
|
| 83 |
+
'neighbor': self.image_latents[neighbor_index],
|
| 84 |
+
'neighbor_depth': self.depth[neighbor_index],
|
| 85 |
+
'neighbor_frame': torch.tensor(neighbor_index, device=self.device)}
|
| 86 |
+
|
| 87 |
+
def __len__(self):
|
| 88 |
+
return (len(self.image_latents))
|
| 89 |
+
|
| 90 |
+
def toval(self, epoch):
|
| 91 |
+
pass
|
| 92 |
+
|
| 93 |
+
def totrain(self, epoch):
|
| 94 |
+
pass
|
| 95 |
+
|
| 96 |
+
class VideoModel(torch.nn.Module):
|
| 97 |
+
|
| 98 |
+
def __init__( self, model, NUM_DDIM_STEPS, GUIDANCE_SCALE, output_path, org_prompt, edit_prompt, no_frames,
|
| 99 |
+
use_keyframe_only=False,
|
| 100 |
+
classifier_guidance_flag = False, per_frame_classifier_guidance = False,
|
| 101 |
+
use_self_attention_injection=True,
|
| 102 |
+
target_index = -1, device='cuda:0'):
|
| 103 |
+
'''
|
| 104 |
+
use_keyframe_only: if set to True, we will attend only to an anchor frame. if set to False, we will attend to an anchor frame and the previous frame
|
| 105 |
+
classifier_guidance_flag: if set to True, we will perform the latent update. if set to False, we won't perform the latent update
|
| 106 |
+
per_frame_classifier_guidance: if set to True, for each latent update, we will use the previous frame's latent at the corresponding diffusion step
|
| 107 |
+
target_index: if it is not -1, for each latent update, we will use the previous frame's latent at the target_index diffusion step
|
| 108 |
+
'''
|
| 109 |
+
super().__init__()
|
| 110 |
+
|
| 111 |
+
self.NUM_DDIM_STEPS = NUM_DDIM_STEPS
|
| 112 |
+
self.GUIDANCE_SCALE = GUIDANCE_SCALE
|
| 113 |
+
self.model = model
|
| 114 |
+
self.tokenizer = self.model.tokenizer
|
| 115 |
+
self.model.scheduler.set_timesteps(NUM_DDIM_STEPS)
|
| 116 |
+
self.prompt = None
|
| 117 |
+
self.context = None
|
| 118 |
+
self.device = device
|
| 119 |
+
self.output_path = output_path
|
| 120 |
+
self.org_prompt = org_prompt
|
| 121 |
+
self.edit_prompt = edit_prompt
|
| 122 |
+
self.use_keyframe_only = use_keyframe_only
|
| 123 |
+
self.no_frames = no_frames
|
| 124 |
+
self.classifier_guidance_flag = classifier_guidance_flag
|
| 125 |
+
self.per_frame_classifier_guidance = per_frame_classifier_guidance
|
| 126 |
+
self.use_self_attention_injection = use_self_attention_injection
|
| 127 |
+
self.target_index = target_index
|
| 128 |
+
|
| 129 |
+
# Print model's state_dict
|
| 130 |
+
print("Model's state_dict:")
|
| 131 |
+
for param_tensor in self.state_dict():
|
| 132 |
+
print(param_tensor, "\t", self.state_dict()[param_tensor].size())
|
| 133 |
+
|
| 134 |
+
self.finetune_layers = []
|
| 135 |
+
|
| 136 |
+
self.unet = create_custom_diffusion(self.model.unet, self.finetune_layers)
|
| 137 |
+
|
| 138 |
+
self.init_prompt(self.org_prompt)
|
| 139 |
+
|
| 140 |
+
def auto_corr_loss(self, x, random_shift=True):
|
| 141 |
+
B,C,H,W = x.shape
|
| 142 |
+
assert B==1
|
| 143 |
+
x = x.squeeze(0)
|
| 144 |
+
# x must be shape [C,H,W] now
|
| 145 |
+
reg_loss = 0.0
|
| 146 |
+
for ch_idx in range(x.shape[0]):
|
| 147 |
+
noise = x[ch_idx][None, None,:,:]
|
| 148 |
+
while True:
|
| 149 |
+
if random_shift: roll_amount = randrange(noise.shape[2]//2)
|
| 150 |
+
else: roll_amount = 1
|
| 151 |
+
reg_loss += (noise*torch.roll(noise, shifts=roll_amount, dims=2)).mean()**2
|
| 152 |
+
reg_loss += (noise*torch.roll(noise, shifts=roll_amount, dims=3)).mean()**2
|
| 153 |
+
if noise.shape[2] <= 8:
|
| 154 |
+
break
|
| 155 |
+
noise = F.avg_pool2d(noise, kernel_size=2)
|
| 156 |
+
return reg_loss
|
| 157 |
+
|
| 158 |
+
def kl_divergence(self, x):
|
| 159 |
+
_mu = x.mean()
|
| 160 |
+
_var = x.var()
|
| 161 |
+
return _var + _mu**2 - 1 - torch.log(_var+1e-7)
|
| 162 |
+
|
| 163 |
+
def ddim_loop(self, latent, depth, self_attn_query_features_uncond_list_prev = [], self_attn_query_features_cond_list_prev = [], latents_x0_list_prev = []):
|
| 164 |
+
latents_x0_list = []
|
| 165 |
+
latent_list = []
|
| 166 |
+
|
| 167 |
+
latent = latent.clone().detach()
|
| 168 |
+
self_attn_query_features_uncond_list = []
|
| 169 |
+
self_attn_query_features_cond_list = []
|
| 170 |
+
|
| 171 |
+
latent_list.append(latent)
|
| 172 |
+
|
| 173 |
+
for i in range(self.NUM_DDIM_STEPS):
|
| 174 |
+
t = self.model.scheduler.timesteps[len(self.model.scheduler.timesteps) - i - 1]
|
| 175 |
+
|
| 176 |
+
self_attn_query_feat_uncond = None
|
| 177 |
+
self_attn_query_feat_cond = None
|
| 178 |
+
|
| 179 |
+
if len(self_attn_query_features_uncond_list_prev) > 0:
|
| 180 |
+
self_attn_query_feat_uncond = self_attn_query_features_uncond_list_prev[i]
|
| 181 |
+
if len(self_attn_query_features_cond_list_prev) > 0:
|
| 182 |
+
self_attn_query_feat_cond = self_attn_query_features_cond_list_prev[i]
|
| 183 |
+
|
| 184 |
+
latent, latent_x0, self_attn_query_features_uncond, self_attn_query_features_cond = self.get_noise_pred( latent, t, depth=depth,
|
| 185 |
+
self_attn_query_feat_uncond =self_attn_query_feat_uncond,
|
| 186 |
+
self_attn_query_feat_cond = self_attn_query_feat_cond,
|
| 187 |
+
is_forward=True)
|
| 188 |
+
|
| 189 |
+
self_attn_query_features_uncond_list.append(self_attn_query_features_uncond)
|
| 190 |
+
self_attn_query_features_cond_list.append(self_attn_query_features_cond)
|
| 191 |
+
latents_x0_list.append(latent_x0)
|
| 192 |
+
latent_list.append(latent)
|
| 193 |
+
|
| 194 |
+
return latent_list, latents_x0_list, self_attn_query_features_uncond_list, self_attn_query_features_cond_list
|
| 195 |
+
|
| 196 |
+
@torch.no_grad()
|
| 197 |
+
def init_prompt(self, prompt: str):
|
| 198 |
+
batch_size = len(prompt)
|
| 199 |
+
|
| 200 |
+
uncond_input = self.model.tokenizer(
|
| 201 |
+
[""]* batch_size, padding="max_length", max_length=self.model.tokenizer.model_max_length,
|
| 202 |
+
return_tensors="pt"
|
| 203 |
+
)
|
| 204 |
+
uncond_embeddings = self.model.text_encoder(uncond_input.input_ids.to(self.model.device))[0]
|
| 205 |
+
|
| 206 |
+
text_input = self.model.tokenizer(
|
| 207 |
+
prompt,
|
| 208 |
+
padding="max_length",
|
| 209 |
+
max_length=self.model.tokenizer.model_max_length,
|
| 210 |
+
truncation=True,
|
| 211 |
+
return_tensors="pt",
|
| 212 |
+
)
|
| 213 |
+
text_embeddings = self.model.text_encoder(text_input.input_ids.to(self.model.device))[0]
|
| 214 |
+
#self.context = torch.cat([uncond_embeddings, text_embeddings])
|
| 215 |
+
self.context = [uncond_embeddings, text_embeddings]
|
| 216 |
+
self.prompt = prompt
|
| 217 |
+
|
| 218 |
+
@torch.no_grad()
|
| 219 |
+
def latent2image(self, latents, return_type='np'):
|
| 220 |
+
latents = 1 / 0.18215 * latents.detach()
|
| 221 |
+
image = self.model.vae.decode(latents)['sample']
|
| 222 |
+
image = (image).clamp(-1, 1)
|
| 223 |
+
if return_type == 'np':
|
| 224 |
+
image = (image / 2 + 0.5).clamp(0, 1)
|
| 225 |
+
image = image.cpu().permute(0, 2, 3, 1).numpy()
|
| 226 |
+
image = (image * 255).astype(np.uint8)
|
| 227 |
+
return image
|
| 228 |
+
|
| 229 |
+
def prev_step(self, model_output, timestep: int, sample):
|
| 230 |
+
prev_timestep = timestep - self.model.scheduler.config.num_train_timesteps // self.model.scheduler.num_inference_steps
|
| 231 |
+
alpha_prod_t = self.model.scheduler.alphas_cumprod[timestep]
|
| 232 |
+
alpha_prod_t_prev = self.model.scheduler.alphas_cumprod[prev_timestep] if prev_timestep >= 0 else self.model.scheduler.final_alpha_cumprod
|
| 233 |
+
beta_prod_t = 1 - alpha_prod_t
|
| 234 |
+
pred_original_sample = (sample - beta_prod_t ** 0.5 * model_output) / alpha_prod_t ** 0.5
|
| 235 |
+
pred_sample_direction = (1 - alpha_prod_t_prev) ** 0.5 * model_output
|
| 236 |
+
prev_sample = alpha_prod_t_prev ** 0.5 * pred_original_sample + pred_sample_direction
|
| 237 |
+
return prev_sample, pred_original_sample
|
| 238 |
+
|
| 239 |
+
def next_step(self, model_output, timestep: int, sample):
|
| 240 |
+
timestep, next_timestep = min(timestep - self.model.scheduler.config.num_train_timesteps // self.model.scheduler.num_inference_steps, 999), timestep
|
| 241 |
+
alpha_prod_t = self.model.scheduler.alphas_cumprod[timestep] if timestep >= 0 else self.model.scheduler.final_alpha_cumprod
|
| 242 |
+
alpha_prod_t_next = self.model.scheduler.alphas_cumprod[next_timestep]
|
| 243 |
+
beta_prod_t = 1 - alpha_prod_t
|
| 244 |
+
next_original_sample = (sample - beta_prod_t ** 0.5 * model_output) / alpha_prod_t ** 0.5
|
| 245 |
+
next_sample_direction = (1 - alpha_prod_t_next) ** 0.5 * model_output
|
| 246 |
+
next_sample = alpha_prod_t_next ** 0.5 * next_original_sample + next_sample_direction
|
| 247 |
+
|
| 248 |
+
return next_sample, next_original_sample
|
| 249 |
+
|
| 250 |
+
#duygu: ignore latents_x0_list_prev and warp_grid
|
| 251 |
+
def img2img(self, latent, depth, init_latents = None, prompt=[],
|
| 252 |
+
self_attn_query_features_uncond_list_prev = [],
|
| 253 |
+
self_attn_query_features_cond_list_prev = [],
|
| 254 |
+
latents_x0_list_prev = [],
|
| 255 |
+
start_step = 0):
|
| 256 |
+
if len(prompt) > 0:
|
| 257 |
+
self.init_prompt(prompt)
|
| 258 |
+
|
| 259 |
+
noise = torch.randn_like(latent).to(self.device)
|
| 260 |
+
|
| 261 |
+
# get latents
|
| 262 |
+
if init_latents is None:
|
| 263 |
+
t = self.model.scheduler.timesteps[start_step]
|
| 264 |
+
init_latents = self.model.scheduler.add_noise(latent, noise, t)
|
| 265 |
+
|
| 266 |
+
# self_attn_query_features_uncond_list and self_attn_query_features_cond_list will contain the features of the current frame
|
| 267 |
+
result, self_attn_query_features_uncond_list, self_attn_query_features_cond_list, latents_x0_list = self.decode(init_latents, depth=depth,
|
| 268 |
+
self_attn_query_features_uncond_list_prev = self_attn_query_features_uncond_list_prev,
|
| 269 |
+
self_attn_query_features_cond_list_prev = self_attn_query_features_cond_list_prev,
|
| 270 |
+
latents_x0_list_prev = latents_x0_list_prev,
|
| 271 |
+
start_step=start_step,
|
| 272 |
+
return_type = 'np')
|
| 273 |
+
return result, self_attn_query_features_uncond_list, self_attn_query_features_cond_list, latents_x0_list
|
| 274 |
+
|
| 275 |
+
def get_noise_pred_single(self, latents, t, context, depth=None):
|
| 276 |
+
if depth is not None:
|
| 277 |
+
noise_pred = self.forward(torch.cat((latents, depth), dim=1), t, encoder_hidden_states=context)["sample"]
|
| 278 |
+
else:
|
| 279 |
+
noise_pred = self.forward(latents, t, encoder_hidden_states=context)["sample"]
|
| 280 |
+
return noise_pred
|
| 281 |
+
|
| 282 |
+
def get_noise_pred(self, latents, t, context=None, depth=None, self_attn_query_feat_uncond = None, self_attn_query_feat_cond = None,
|
| 283 |
+
pred_x0=None, is_forward=False):
|
| 284 |
+
latents_org = None
|
| 285 |
+
|
| 286 |
+
if context is None:
|
| 287 |
+
context = torch.cat(self.context)
|
| 288 |
+
|
| 289 |
+
uncond_embeddings, cond_embeddings = torch.chunk(context, 2)
|
| 290 |
+
|
| 291 |
+
guidance_scale = self.GUIDANCE_SCALE
|
| 292 |
+
if is_forward:
|
| 293 |
+
guidance_scale = 1.0
|
| 294 |
+
|
| 295 |
+
if depth is not None:
|
| 296 |
+
latents_input = torch.cat((latents, depth), dim=1)
|
| 297 |
+
else:
|
| 298 |
+
latents_input = latents
|
| 299 |
+
|
| 300 |
+
#duygu: ignore warp_grid
|
| 301 |
+
output = self.forward(latents_input, t, encoder_hidden_states=uncond_embeddings, self_attn_query_features_cond=self_attn_query_feat_uncond)
|
| 302 |
+
|
| 303 |
+
noise_pred_uncond = output["sample"]
|
| 304 |
+
self_attn_features_uncond = output["self_attn_query_features"]
|
| 305 |
+
|
| 306 |
+
output = self.forward(latents_input, t, encoder_hidden_states=cond_embeddings, self_attn_query_features_cond=self_attn_query_feat_cond)
|
| 307 |
+
|
| 308 |
+
noise_pred_cond = output["sample"]
|
| 309 |
+
self_attn_features_cond = output["self_attn_query_features"]
|
| 310 |
+
|
| 311 |
+
noise_pred = noise_pred_uncond + guidance_scale * (noise_pred_cond - noise_pred_uncond)
|
| 312 |
+
|
| 313 |
+
if is_forward:
|
| 314 |
+
latents, latents_org = self.next_step(noise_pred, t, latents)
|
| 315 |
+
else:
|
| 316 |
+
latents, latents_org = self.prev_step(noise_pred, t, latents)
|
| 317 |
+
|
| 318 |
+
|
| 319 |
+
return latents, latents_org, self_attn_features_uncond, self_attn_features_cond
|
| 320 |
+
|
| 321 |
+
def decode( self, latents, depth=None,
|
| 322 |
+
self_attn_query_features_uncond_list_prev = [],
|
| 323 |
+
self_attn_query_features_cond_list_prev = [],
|
| 324 |
+
latents_x0_list_prev = [],
|
| 325 |
+
start_step = 0,
|
| 326 |
+
return_type = 'np'):
|
| 327 |
+
|
| 328 |
+
latent_cur = latents
|
| 329 |
+
self_attn_query_features_uncond_list = []
|
| 330 |
+
self_attn_query_features_cond_list = []
|
| 331 |
+
latents_x0_list = []
|
| 332 |
+
|
| 333 |
+
per_step_weight = 100.0
|
| 334 |
+
for i in range(start_step, self.NUM_DDIM_STEPS):
|
| 335 |
+
|
| 336 |
+
if i>25:
|
| 337 |
+
per_step_weight = 0
|
| 338 |
+
|
| 339 |
+
self_attn_query_feat_uncond = None
|
| 340 |
+
self_attn_query_feat_cond = None
|
| 341 |
+
latent_x0_prev = None
|
| 342 |
+
|
| 343 |
+
if len(self_attn_query_features_uncond_list_prev) > 0:
|
| 344 |
+
self_attn_query_feat_uncond = self_attn_query_features_uncond_list_prev[i-start_step]
|
| 345 |
+
if len(self_attn_query_features_cond_list_prev) > 0:
|
| 346 |
+
self_attn_query_feat_cond = self_attn_query_features_cond_list_prev[i-start_step]
|
| 347 |
+
|
| 348 |
+
if len(latents_x0_list_prev) > 0:
|
| 349 |
+
if self.per_frame_classifier_guidance:
|
| 350 |
+
latent_x0_prev = latents_x0_list_prev[i-start_step]
|
| 351 |
+
else:
|
| 352 |
+
latent_x0_prev = latents_x0_list_prev[self.target_index]
|
| 353 |
+
|
| 354 |
+
t = self.model.scheduler.timesteps[i]
|
| 355 |
+
|
| 356 |
+
uncond_emb = self.context[0]
|
| 357 |
+
|
| 358 |
+
cond_embeddings = self.context[1]
|
| 359 |
+
|
| 360 |
+
uncond_emb = uncond_emb.repeat(latents.shape[0], 1, 1)
|
| 361 |
+
cond_embeddings = cond_embeddings.repeat(latents.shape[0], 1, 1)
|
| 362 |
+
|
| 363 |
+
context = torch.cat((uncond_emb,cond_embeddings ))
|
| 364 |
+
latent_cur, latent_x0, self_attn_query_features_uncond, self_attn_query_features_cond = self.get_noise_pred(latent_cur, t,
|
| 365 |
+
context=context,
|
| 366 |
+
depth=depth,
|
| 367 |
+
self_attn_query_feat_uncond =self_attn_query_feat_uncond,
|
| 368 |
+
self_attn_query_feat_cond = self_attn_query_feat_cond,
|
| 369 |
+
pred_x0 = latent_x0_prev)
|
| 370 |
+
|
| 371 |
+
#self_attn_query_features_uncond and self_attn_query_features_cond are features from the current diffusion step
|
| 372 |
+
#self_attn_query_features_uncond_list and self_attn_query_features_cond_list hold features from all diffusion steps
|
| 373 |
+
self_attn_query_features_uncond_list.append(self_attn_query_features_uncond)
|
| 374 |
+
self_attn_query_features_cond_list.append(self_attn_query_features_cond)
|
| 375 |
+
|
| 376 |
+
## classifier-based guidance
|
| 377 |
+
target_index = i-start_step if self.classifier_guidance_flag and self.per_frame_classifier_guidance else self.target_index
|
| 378 |
+
if self.classifier_guidance_flag and len(latents_x0_list_prev) > 0:
|
| 379 |
+
target = latents_x0_list_prev[target_index]
|
| 380 |
+
|
| 381 |
+
with torch.enable_grad():
|
| 382 |
+
dummy_pred = latent_x0.clone().detach()
|
| 383 |
+
|
| 384 |
+
dummy_pred = dummy_pred.requires_grad_(requires_grad=True)
|
| 385 |
+
loss = per_step_weight * torch.nn.functional.mse_loss(target, dummy_pred)
|
| 386 |
+
loss.backward()
|
| 387 |
+
latent_cur = latent_cur + dummy_pred.grad.clone() * -1.
|
| 388 |
+
|
| 389 |
+
latents_x0_list.append(latent_x0)
|
| 390 |
+
|
| 391 |
+
image = self.latent2image(latent_cur, return_type=return_type)
|
| 392 |
+
|
| 393 |
+
return image, self_attn_query_features_uncond_list, self_attn_query_features_cond_list, latents_x0_list
|
| 394 |
+
|
| 395 |
+
def forward(
|
| 396 |
+
self,
|
| 397 |
+
sample: torch.FloatTensor,
|
| 398 |
+
timestep,
|
| 399 |
+
encoder_hidden_states: torch.Tensor,
|
| 400 |
+
self_attn_query_features_cond=None,
|
| 401 |
+
return_dict: bool = True,
|
| 402 |
+
):
|
| 403 |
+
r"""
|
| 404 |
+
Args:
|
| 405 |
+
sample (`torch.FloatTensor`): (batch, channel, height, width) noisy inputs tensor
|
| 406 |
+
timestep (`torch.FloatTensor` or `float` or `int`): (batch) timesteps
|
| 407 |
+
encoder_hidden_states (`torch.FloatTensor`): (batch, sequence_length, feature_dim) encoder hidden states
|
| 408 |
+
return_dict (`bool`, *optional*, defaults to `True`):
|
| 409 |
+
Whether or not to return a [`models.unet_2d_condition.UNet2DConditionOutput`] instead of a plain tuple.
|
| 410 |
+
|
| 411 |
+
Returns:
|
| 412 |
+
[`~models.unet_2d_condition.UNet2DConditionOutput`] or `tuple`:
|
| 413 |
+
[`~models.unet_2d_condition.UNet2DConditionOutput`] if `return_dict` is True, otherwise a `tuple`. When
|
| 414 |
+
returning a tuple, the first element is the sample tensor.
|
| 415 |
+
"""
|
| 416 |
+
|
| 417 |
+
#unet now refers to the unet_2d_condition.py class under mydiffusers/models
|
| 418 |
+
return self.unet(sample, timestep, encoder_hidden_states, self_attn_query_features_cond=self_attn_query_features_cond)
|
| 419 |
+
|
| 420 |
+
def perform_inversion(self, dataset):
|
| 421 |
+
|
| 422 |
+
if len(dataset.inversions) > 0:
|
| 423 |
+
print('Inversion already loaded!')
|
| 424 |
+
return
|
| 425 |
+
|
| 426 |
+
os.makedirs(dataset.inversion_path, exist_ok=True)
|
| 427 |
+
|
| 428 |
+
self.init_prompt(self.org_prompt)
|
| 429 |
+
|
| 430 |
+
with torch.no_grad():
|
| 431 |
+
for i in range(self.no_frames):
|
| 432 |
+
b = i
|
| 433 |
+
if dataset.is_reverse:
|
| 434 |
+
b = len(dataset.image_latents) - i -1
|
| 435 |
+
|
| 436 |
+
latent = dataset.image_latents[b]
|
| 437 |
+
depth = dataset.depth[b]
|
| 438 |
+
|
| 439 |
+
#do inversion
|
| 440 |
+
latent_noisy_list, _, _, _ = self.ddim_loop( latent, depth)
|
| 441 |
+
|
| 442 |
+
latent_noisy = latent_noisy_list[-1]
|
| 443 |
+
|
| 444 |
+
dataset.inversions.append(latent_noisy)
|
| 445 |
+
|
| 446 |
+
torch.save(latent_noisy_list, os.path.join(dataset.inversion_path, '%06d.pt' % b))
|
| 447 |
+
|
| 448 |
+
if dataset.is_reverse:
|
| 449 |
+
dataset.inversions = dataset.inversions[::-1]
|
| 450 |
+
|
| 451 |
+
def test(self, dataset, output_path, prompt):
|
| 452 |
+
if not os.path.exists(output_path):
|
| 453 |
+
os.makedirs(output_path)
|
| 454 |
+
|
| 455 |
+
test_count = 0
|
| 456 |
+
|
| 457 |
+
#self_attn_query_features_uncond_list and self_attn_query_features_cond_list will hold the features obtained from the current frame
|
| 458 |
+
#self_attn_query_features_uncond_list_prev and self_attn_query_features_cond_list_prev hold the features obtained from the previous frame
|
| 459 |
+
#self_attn_query_features_uncond_list_first and self_attn_query_features_cond_list_first hold the features obtained from frame 0
|
| 460 |
+
self_attn_query_features_uncond_list = []
|
| 461 |
+
self_attn_query_features_cond_list = []
|
| 462 |
+
|
| 463 |
+
self_attn_query_features_uncond_list_first = []
|
| 464 |
+
self_attn_query_features_cond_list_first = []
|
| 465 |
+
|
| 466 |
+
self_attn_query_features_uncond_list_prev = []
|
| 467 |
+
self_attn_query_features_cond_list_prev = []
|
| 468 |
+
|
| 469 |
+
prev_latents_x0_list = []
|
| 470 |
+
|
| 471 |
+
start_step = 0
|
| 472 |
+
|
| 473 |
+
self.init_prompt(prompt)
|
| 474 |
+
|
| 475 |
+
with torch.no_grad():
|
| 476 |
+
for i in range(self.no_frames):
|
| 477 |
+
t = time.process_time()
|
| 478 |
+
|
| 479 |
+
b = i
|
| 480 |
+
if dataset.is_reverse:
|
| 481 |
+
b = len(dataset.image_latents) - i -1
|
| 482 |
+
|
| 483 |
+
latent = dataset.image_latents[b]
|
| 484 |
+
depth = dataset.depth[b]
|
| 485 |
+
|
| 486 |
+
if i==0:
|
| 487 |
+
latent_noisy = torch.randn_like(latent).to(latent.device)
|
| 488 |
+
|
| 489 |
+
if len(dataset.inversions) > 0 and start_step == 0:
|
| 490 |
+
latent_noisy = dataset.inversions[b]
|
| 491 |
+
else:
|
| 492 |
+
latent_noisy = None
|
| 493 |
+
|
| 494 |
+
uncond_emb = None
|
| 495 |
+
|
| 496 |
+
#duygu:
|
| 497 |
+
#self_attn_query_features_uncond_list_cur and self_attn_query_features_cond_list_cur will contain the features of the current frame
|
| 498 |
+
#you can ignore latents_x0_list_prev and warp_grid
|
| 499 |
+
img, self_attn_query_features_uncond_list_cur, self_attn_query_features_cond_list_cur, latents_x0_list = self.img2img( latent, depth,
|
| 500 |
+
init_latents = latent_noisy,
|
| 501 |
+
self_attn_query_features_uncond_list_prev = self_attn_query_features_uncond_list,
|
| 502 |
+
self_attn_query_features_cond_list_prev = self_attn_query_features_cond_list,
|
| 503 |
+
latents_x0_list_prev = prev_latents_x0_list,
|
| 504 |
+
start_step=start_step)
|
| 505 |
+
#duygu: in the below code, we append the features of frame 0 with previous
|
| 506 |
+
#for now you can just update the previous features to be equal to current features
|
| 507 |
+
elapsed_time = time.process_time() - t
|
| 508 |
+
print('elapsed time: ', elapsed_time)
|
| 509 |
+
prev_latents_x0_list = latents_x0_list
|
| 510 |
+
if i == 0 and self.use_self_attention_injection:
|
| 511 |
+
self_attn_query_features_uncond_list_first = []
|
| 512 |
+
self_attn_query_features_cond_list_first = []
|
| 513 |
+
|
| 514 |
+
for s in range(len(self_attn_query_features_uncond_list_cur)):
|
| 515 |
+
self_attn_query_features_uncond_list_first.append([])
|
| 516 |
+
self_attn_query_features_cond_list_first.append([])
|
| 517 |
+
|
| 518 |
+
for j in range(len(self_attn_query_features_uncond_list_cur[s])):
|
| 519 |
+
self_attn_query_features_uncond_list_first[s].append(self_attn_query_features_uncond_list_cur[s][j])
|
| 520 |
+
self_attn_query_features_cond_list_first[s].append(self_attn_query_features_cond_list_cur[s][j])
|
| 521 |
+
|
| 522 |
+
if self.use_self_attention_injection:
|
| 523 |
+
if self.use_keyframe_only:
|
| 524 |
+
self_attn_query_features_uncond_list = self_attn_query_features_uncond_list_first
|
| 525 |
+
self_attn_query_features_cond_list = self_attn_query_features_cond_list_first
|
| 526 |
+
else:
|
| 527 |
+
self_attn_query_features_uncond_list = []
|
| 528 |
+
self_attn_query_features_cond_list = []
|
| 529 |
+
for s in range(len(self_attn_query_features_uncond_list_cur)):
|
| 530 |
+
self_attn_query_features_uncond_list.append([])
|
| 531 |
+
self_attn_query_features_cond_list.append([])
|
| 532 |
+
for j in range(len(self_attn_query_features_uncond_list_cur[s])):
|
| 533 |
+
self_attn_query_features_uncond_list[s].append(torch.cat([self_attn_query_features_uncond_list_first[s][j], self_attn_query_features_uncond_list_cur[s][j]], dim=1))
|
| 534 |
+
self_attn_query_features_cond_list[s].append(torch.cat([self_attn_query_features_cond_list_first[s][j], self_attn_query_features_cond_list_cur[s][j]], dim=1))
|
| 535 |
+
|
| 536 |
+
image = Image.fromarray(img[0])
|
| 537 |
+
image = np.array(image.convert("RGB"))
|
| 538 |
+
imageio.imwrite(os.path.join(output_path, '%06d.png' % (b)), image)
|
pix2video-main/ffmpeg-7.0.2-i686-static/GPLv3.txt
ADDED
|
@@ -0,0 +1,674 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
GNU GENERAL PUBLIC LICENSE
|
| 2 |
+
Version 3, 29 June 2007
|
| 3 |
+
|
| 4 |
+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
| 5 |
+
Everyone is permitted to copy and distribute verbatim copies
|
| 6 |
+
of this license document, but changing it is not allowed.
|
| 7 |
+
|
| 8 |
+
Preamble
|
| 9 |
+
|
| 10 |
+
The GNU General Public License is a free, copyleft license for
|
| 11 |
+
software and other kinds of works.
|
| 12 |
+
|
| 13 |
+
The licenses for most software and other practical works are designed
|
| 14 |
+
to take away your freedom to share and change the works. By contrast,
|
| 15 |
+
the GNU General Public License is intended to guarantee your freedom to
|
| 16 |
+
share and change all versions of a program--to make sure it remains free
|
| 17 |
+
software for all its users. We, the Free Software Foundation, use the
|
| 18 |
+
GNU General Public License for most of our software; it applies also to
|
| 19 |
+
any other work released this way by its authors. You can apply it to
|
| 20 |
+
your programs, too.
|
| 21 |
+
|
| 22 |
+
When we speak of free software, we are referring to freedom, not
|
| 23 |
+
price. Our General Public Licenses are designed to make sure that you
|
| 24 |
+
have the freedom to distribute copies of free software (and charge for
|
| 25 |
+
them if you wish), that you receive source code or can get it if you
|
| 26 |
+
want it, that you can change the software or use pieces of it in new
|
| 27 |
+
free programs, and that you know you can do these things.
|
| 28 |
+
|
| 29 |
+
To protect your rights, we need to prevent others from denying you
|
| 30 |
+
these rights or asking you to surrender the rights. Therefore, you have
|
| 31 |
+
certain responsibilities if you distribute copies of the software, or if
|
| 32 |
+
you modify it: responsibilities to respect the freedom of others.
|
| 33 |
+
|
| 34 |
+
For example, if you distribute copies of such a program, whether
|
| 35 |
+
gratis or for a fee, you must pass on to the recipients the same
|
| 36 |
+
freedoms that you received. You must make sure that they, too, receive
|
| 37 |
+
or can get the source code. And you must show them these terms so they
|
| 38 |
+
know their rights.
|
| 39 |
+
|
| 40 |
+
Developers that use the GNU GPL protect your rights with two steps:
|
| 41 |
+
(1) assert copyright on the software, and (2) offer you this License
|
| 42 |
+
giving you legal permission to copy, distribute and/or modify it.
|
| 43 |
+
|
| 44 |
+
For the developers' and authors' protection, the GPL clearly explains
|
| 45 |
+
that there is no warranty for this free software. For both users' and
|
| 46 |
+
authors' sake, the GPL requires that modified versions be marked as
|
| 47 |
+
changed, so that their problems will not be attributed erroneously to
|
| 48 |
+
authors of previous versions.
|
| 49 |
+
|
| 50 |
+
Some devices are designed to deny users access to install or run
|
| 51 |
+
modified versions of the software inside them, although the manufacturer
|
| 52 |
+
can do so. This is fundamentally incompatible with the aim of
|
| 53 |
+
protecting users' freedom to change the software. The systematic
|
| 54 |
+
pattern of such abuse occurs in the area of products for individuals to
|
| 55 |
+
use, which is precisely where it is most unacceptable. Therefore, we
|
| 56 |
+
have designed this version of the GPL to prohibit the practice for those
|
| 57 |
+
products. If such problems arise substantially in other domains, we
|
| 58 |
+
stand ready to extend this provision to those domains in future versions
|
| 59 |
+
of the GPL, as needed to protect the freedom of users.
|
| 60 |
+
|
| 61 |
+
Finally, every program is threatened constantly by software patents.
|
| 62 |
+
States should not allow patents to restrict development and use of
|
| 63 |
+
software on general-purpose computers, but in those that do, we wish to
|
| 64 |
+
avoid the special danger that patents applied to a free program could
|
| 65 |
+
make it effectively proprietary. To prevent this, the GPL assures that
|
| 66 |
+
patents cannot be used to render the program non-free.
|
| 67 |
+
|
| 68 |
+
The precise terms and conditions for copying, distribution and
|
| 69 |
+
modification follow.
|
| 70 |
+
|
| 71 |
+
TERMS AND CONDITIONS
|
| 72 |
+
|
| 73 |
+
0. Definitions.
|
| 74 |
+
|
| 75 |
+
"This License" refers to version 3 of the GNU General Public License.
|
| 76 |
+
|
| 77 |
+
"Copyright" also means copyright-like laws that apply to other kinds of
|
| 78 |
+
works, such as semiconductor masks.
|
| 79 |
+
|
| 80 |
+
"The Program" refers to any copyrightable work licensed under this
|
| 81 |
+
License. Each licensee is addressed as "you". "Licensees" and
|
| 82 |
+
"recipients" may be individuals or organizations.
|
| 83 |
+
|
| 84 |
+
To "modify" a work means to copy from or adapt all or part of the work
|
| 85 |
+
in a fashion requiring copyright permission, other than the making of an
|
| 86 |
+
exact copy. The resulting work is called a "modified version" of the
|
| 87 |
+
earlier work or a work "based on" the earlier work.
|
| 88 |
+
|
| 89 |
+
A "covered work" means either the unmodified Program or a work based
|
| 90 |
+
on the Program.
|
| 91 |
+
|
| 92 |
+
To "propagate" a work means to do anything with it that, without
|
| 93 |
+
permission, would make you directly or secondarily liable for
|
| 94 |
+
infringement under applicable copyright law, except executing it on a
|
| 95 |
+
computer or modifying a private copy. Propagation includes copying,
|
| 96 |
+
distribution (with or without modification), making available to the
|
| 97 |
+
public, and in some countries other activities as well.
|
| 98 |
+
|
| 99 |
+
To "convey" a work means any kind of propagation that enables other
|
| 100 |
+
parties to make or receive copies. Mere interaction with a user through
|
| 101 |
+
a computer network, with no transfer of a copy, is not conveying.
|
| 102 |
+
|
| 103 |
+
An interactive user interface displays "Appropriate Legal Notices"
|
| 104 |
+
to the extent that it includes a convenient and prominently visible
|
| 105 |
+
feature that (1) displays an appropriate copyright notice, and (2)
|
| 106 |
+
tells the user that there is no warranty for the work (except to the
|
| 107 |
+
extent that warranties are provided), that licensees may convey the
|
| 108 |
+
work under this License, and how to view a copy of this License. If
|
| 109 |
+
the interface presents a list of user commands or options, such as a
|
| 110 |
+
menu, a prominent item in the list meets this criterion.
|
| 111 |
+
|
| 112 |
+
1. Source Code.
|
| 113 |
+
|
| 114 |
+
The "source code" for a work means the preferred form of the work
|
| 115 |
+
for making modifications to it. "Object code" means any non-source
|
| 116 |
+
form of a work.
|
| 117 |
+
|
| 118 |
+
A "Standard Interface" means an interface that either is an official
|
| 119 |
+
standard defined by a recognized standards body, or, in the case of
|
| 120 |
+
interfaces specified for a particular programming language, one that
|
| 121 |
+
is widely used among developers working in that language.
|
| 122 |
+
|
| 123 |
+
The "System Libraries" of an executable work include anything, other
|
| 124 |
+
than the work as a whole, that (a) is included in the normal form of
|
| 125 |
+
packaging a Major Component, but which is not part of that Major
|
| 126 |
+
Component, and (b) serves only to enable use of the work with that
|
| 127 |
+
Major Component, or to implement a Standard Interface for which an
|
| 128 |
+
implementation is available to the public in source code form. A
|
| 129 |
+
"Major Component", in this context, means a major essential component
|
| 130 |
+
(kernel, window system, and so on) of the specific operating system
|
| 131 |
+
(if any) on which the executable work runs, or a compiler used to
|
| 132 |
+
produce the work, or an object code interpreter used to run it.
|
| 133 |
+
|
| 134 |
+
The "Corresponding Source" for a work in object code form means all
|
| 135 |
+
the source code needed to generate, install, and (for an executable
|
| 136 |
+
work) run the object code and to modify the work, including scripts to
|
| 137 |
+
control those activities. However, it does not include the work's
|
| 138 |
+
System Libraries, or general-purpose tools or generally available free
|
| 139 |
+
programs which are used unmodified in performing those activities but
|
| 140 |
+
which are not part of the work. For example, Corresponding Source
|
| 141 |
+
includes interface definition files associated with source files for
|
| 142 |
+
the work, and the source code for shared libraries and dynamically
|
| 143 |
+
linked subprograms that the work is specifically designed to require,
|
| 144 |
+
such as by intimate data communication or control flow between those
|
| 145 |
+
subprograms and other parts of the work.
|
| 146 |
+
|
| 147 |
+
The Corresponding Source need not include anything that users
|
| 148 |
+
can regenerate automatically from other parts of the Corresponding
|
| 149 |
+
Source.
|
| 150 |
+
|
| 151 |
+
The Corresponding Source for a work in source code form is that
|
| 152 |
+
same work.
|
| 153 |
+
|
| 154 |
+
2. Basic Permissions.
|
| 155 |
+
|
| 156 |
+
All rights granted under this License are granted for the term of
|
| 157 |
+
copyright on the Program, and are irrevocable provided the stated
|
| 158 |
+
conditions are met. This License explicitly affirms your unlimited
|
| 159 |
+
permission to run the unmodified Program. The output from running a
|
| 160 |
+
covered work is covered by this License only if the output, given its
|
| 161 |
+
content, constitutes a covered work. This License acknowledges your
|
| 162 |
+
rights of fair use or other equivalent, as provided by copyright law.
|
| 163 |
+
|
| 164 |
+
You may make, run and propagate covered works that you do not
|
| 165 |
+
convey, without conditions so long as your license otherwise remains
|
| 166 |
+
in force. You may convey covered works to others for the sole purpose
|
| 167 |
+
of having them make modifications exclusively for you, or provide you
|
| 168 |
+
with facilities for running those works, provided that you comply with
|
| 169 |
+
the terms of this License in conveying all material for which you do
|
| 170 |
+
not control copyright. Those thus making or running the covered works
|
| 171 |
+
for you must do so exclusively on your behalf, under your direction
|
| 172 |
+
and control, on terms that prohibit them from making any copies of
|
| 173 |
+
your copyrighted material outside their relationship with you.
|
| 174 |
+
|
| 175 |
+
Conveying under any other circumstances is permitted solely under
|
| 176 |
+
the conditions stated below. Sublicensing is not allowed; section 10
|
| 177 |
+
makes it unnecessary.
|
| 178 |
+
|
| 179 |
+
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
| 180 |
+
|
| 181 |
+
No covered work shall be deemed part of an effective technological
|
| 182 |
+
measure under any applicable law fulfilling obligations under article
|
| 183 |
+
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
| 184 |
+
similar laws prohibiting or restricting circumvention of such
|
| 185 |
+
measures.
|
| 186 |
+
|
| 187 |
+
When you convey a covered work, you waive any legal power to forbid
|
| 188 |
+
circumvention of technological measures to the extent such circumvention
|
| 189 |
+
is effected by exercising rights under this License with respect to
|
| 190 |
+
the covered work, and you disclaim any intention to limit operation or
|
| 191 |
+
modification of the work as a means of enforcing, against the work's
|
| 192 |
+
users, your or third parties' legal rights to forbid circumvention of
|
| 193 |
+
technological measures.
|
| 194 |
+
|
| 195 |
+
4. Conveying Verbatim Copies.
|
| 196 |
+
|
| 197 |
+
You may convey verbatim copies of the Program's source code as you
|
| 198 |
+
receive it, in any medium, provided that you conspicuously and
|
| 199 |
+
appropriately publish on each copy an appropriate copyright notice;
|
| 200 |
+
keep intact all notices stating that this License and any
|
| 201 |
+
non-permissive terms added in accord with section 7 apply to the code;
|
| 202 |
+
keep intact all notices of the absence of any warranty; and give all
|
| 203 |
+
recipients a copy of this License along with the Program.
|
| 204 |
+
|
| 205 |
+
You may charge any price or no price for each copy that you convey,
|
| 206 |
+
and you may offer support or warranty protection for a fee.
|
| 207 |
+
|
| 208 |
+
5. Conveying Modified Source Versions.
|
| 209 |
+
|
| 210 |
+
You may convey a work based on the Program, or the modifications to
|
| 211 |
+
produce it from the Program, in the form of source code under the
|
| 212 |
+
terms of section 4, provided that you also meet all of these conditions:
|
| 213 |
+
|
| 214 |
+
a) The work must carry prominent notices stating that you modified
|
| 215 |
+
it, and giving a relevant date.
|
| 216 |
+
|
| 217 |
+
b) The work must carry prominent notices stating that it is
|
| 218 |
+
released under this License and any conditions added under section
|
| 219 |
+
7. This requirement modifies the requirement in section 4 to
|
| 220 |
+
"keep intact all notices".
|
| 221 |
+
|
| 222 |
+
c) You must license the entire work, as a whole, under this
|
| 223 |
+
License to anyone who comes into possession of a copy. This
|
| 224 |
+
License will therefore apply, along with any applicable section 7
|
| 225 |
+
additional terms, to the whole of the work, and all its parts,
|
| 226 |
+
regardless of how they are packaged. This License gives no
|
| 227 |
+
permission to license the work in any other way, but it does not
|
| 228 |
+
invalidate such permission if you have separately received it.
|
| 229 |
+
|
| 230 |
+
d) If the work has interactive user interfaces, each must display
|
| 231 |
+
Appropriate Legal Notices; however, if the Program has interactive
|
| 232 |
+
interfaces that do not display Appropriate Legal Notices, your
|
| 233 |
+
work need not make them do so.
|
| 234 |
+
|
| 235 |
+
A compilation of a covered work with other separate and independent
|
| 236 |
+
works, which are not by their nature extensions of the covered work,
|
| 237 |
+
and which are not combined with it such as to form a larger program,
|
| 238 |
+
in or on a volume of a storage or distribution medium, is called an
|
| 239 |
+
"aggregate" if the compilation and its resulting copyright are not
|
| 240 |
+
used to limit the access or legal rights of the compilation's users
|
| 241 |
+
beyond what the individual works permit. Inclusion of a covered work
|
| 242 |
+
in an aggregate does not cause this License to apply to the other
|
| 243 |
+
parts of the aggregate.
|
| 244 |
+
|
| 245 |
+
6. Conveying Non-Source Forms.
|
| 246 |
+
|
| 247 |
+
You may convey a covered work in object code form under the terms
|
| 248 |
+
of sections 4 and 5, provided that you also convey the
|
| 249 |
+
machine-readable Corresponding Source under the terms of this License,
|
| 250 |
+
in one of these ways:
|
| 251 |
+
|
| 252 |
+
a) Convey the object code in, or embodied in, a physical product
|
| 253 |
+
(including a physical distribution medium), accompanied by the
|
| 254 |
+
Corresponding Source fixed on a durable physical medium
|
| 255 |
+
customarily used for software interchange.
|
| 256 |
+
|
| 257 |
+
b) Convey the object code in, or embodied in, a physical product
|
| 258 |
+
(including a physical distribution medium), accompanied by a
|
| 259 |
+
written offer, valid for at least three years and valid for as
|
| 260 |
+
long as you offer spare parts or customer support for that product
|
| 261 |
+
model, to give anyone who possesses the object code either (1) a
|
| 262 |
+
copy of the Corresponding Source for all the software in the
|
| 263 |
+
product that is covered by this License, on a durable physical
|
| 264 |
+
medium customarily used for software interchange, for a price no
|
| 265 |
+
more than your reasonable cost of physically performing this
|
| 266 |
+
conveying of source, or (2) access to copy the
|
| 267 |
+
Corresponding Source from a network server at no charge.
|
| 268 |
+
|
| 269 |
+
c) Convey individual copies of the object code with a copy of the
|
| 270 |
+
written offer to provide the Corresponding Source. This
|
| 271 |
+
alternative is allowed only occasionally and noncommercially, and
|
| 272 |
+
only if you received the object code with such an offer, in accord
|
| 273 |
+
with subsection 6b.
|
| 274 |
+
|
| 275 |
+
d) Convey the object code by offering access from a designated
|
| 276 |
+
place (gratis or for a charge), and offer equivalent access to the
|
| 277 |
+
Corresponding Source in the same way through the same place at no
|
| 278 |
+
further charge. You need not require recipients to copy the
|
| 279 |
+
Corresponding Source along with the object code. If the place to
|
| 280 |
+
copy the object code is a network server, the Corresponding Source
|
| 281 |
+
may be on a different server (operated by you or a third party)
|
| 282 |
+
that supports equivalent copying facilities, provided you maintain
|
| 283 |
+
clear directions next to the object code saying where to find the
|
| 284 |
+
Corresponding Source. Regardless of what server hosts the
|
| 285 |
+
Corresponding Source, you remain obligated to ensure that it is
|
| 286 |
+
available for as long as needed to satisfy these requirements.
|
| 287 |
+
|
| 288 |
+
e) Convey the object code using peer-to-peer transmission, provided
|
| 289 |
+
you inform other peers where the object code and Corresponding
|
| 290 |
+
Source of the work are being offered to the general public at no
|
| 291 |
+
charge under subsection 6d.
|
| 292 |
+
|
| 293 |
+
A separable portion of the object code, whose source code is excluded
|
| 294 |
+
from the Corresponding Source as a System Library, need not be
|
| 295 |
+
included in conveying the object code work.
|
| 296 |
+
|
| 297 |
+
A "User Product" is either (1) a "consumer product", which means any
|
| 298 |
+
tangible personal property which is normally used for personal, family,
|
| 299 |
+
or household purposes, or (2) anything designed or sold for incorporation
|
| 300 |
+
into a dwelling. In determining whether a product is a consumer product,
|
| 301 |
+
doubtful cases shall be resolved in favor of coverage. For a particular
|
| 302 |
+
product received by a particular user, "normally used" refers to a
|
| 303 |
+
typical or common use of that class of product, regardless of the status
|
| 304 |
+
of the particular user or of the way in which the particular user
|
| 305 |
+
actually uses, or expects or is expected to use, the product. A product
|
| 306 |
+
is a consumer product regardless of whether the product has substantial
|
| 307 |
+
commercial, industrial or non-consumer uses, unless such uses represent
|
| 308 |
+
the only significant mode of use of the product.
|
| 309 |
+
|
| 310 |
+
"Installation Information" for a User Product means any methods,
|
| 311 |
+
procedures, authorization keys, or other information required to install
|
| 312 |
+
and execute modified versions of a covered work in that User Product from
|
| 313 |
+
a modified version of its Corresponding Source. The information must
|
| 314 |
+
suffice to ensure that the continued functioning of the modified object
|
| 315 |
+
code is in no case prevented or interfered with solely because
|
| 316 |
+
modification has been made.
|
| 317 |
+
|
| 318 |
+
If you convey an object code work under this section in, or with, or
|
| 319 |
+
specifically for use in, a User Product, and the conveying occurs as
|
| 320 |
+
part of a transaction in which the right of possession and use of the
|
| 321 |
+
User Product is transferred to the recipient in perpetuity or for a
|
| 322 |
+
fixed term (regardless of how the transaction is characterized), the
|
| 323 |
+
Corresponding Source conveyed under this section must be accompanied
|
| 324 |
+
by the Installation Information. But this requirement does not apply
|
| 325 |
+
if neither you nor any third party retains the ability to install
|
| 326 |
+
modified object code on the User Product (for example, the work has
|
| 327 |
+
been installed in ROM).
|
| 328 |
+
|
| 329 |
+
The requirement to provide Installation Information does not include a
|
| 330 |
+
requirement to continue to provide support service, warranty, or updates
|
| 331 |
+
for a work that has been modified or installed by the recipient, or for
|
| 332 |
+
the User Product in which it has been modified or installed. Access to a
|
| 333 |
+
network may be denied when the modification itself materially and
|
| 334 |
+
adversely affects the operation of the network or violates the rules and
|
| 335 |
+
protocols for communication across the network.
|
| 336 |
+
|
| 337 |
+
Corresponding Source conveyed, and Installation Information provided,
|
| 338 |
+
in accord with this section must be in a format that is publicly
|
| 339 |
+
documented (and with an implementation available to the public in
|
| 340 |
+
source code form), and must require no special password or key for
|
| 341 |
+
unpacking, reading or copying.
|
| 342 |
+
|
| 343 |
+
7. Additional Terms.
|
| 344 |
+
|
| 345 |
+
"Additional permissions" are terms that supplement the terms of this
|
| 346 |
+
License by making exceptions from one or more of its conditions.
|
| 347 |
+
Additional permissions that are applicable to the entire Program shall
|
| 348 |
+
be treated as though they were included in this License, to the extent
|
| 349 |
+
that they are valid under applicable law. If additional permissions
|
| 350 |
+
apply only to part of the Program, that part may be used separately
|
| 351 |
+
under those permissions, but the entire Program remains governed by
|
| 352 |
+
this License without regard to the additional permissions.
|
| 353 |
+
|
| 354 |
+
When you convey a copy of a covered work, you may at your option
|
| 355 |
+
remove any additional permissions from that copy, or from any part of
|
| 356 |
+
it. (Additional permissions may be written to require their own
|
| 357 |
+
removal in certain cases when you modify the work.) You may place
|
| 358 |
+
additional permissions on material, added by you to a covered work,
|
| 359 |
+
for which you have or can give appropriate copyright permission.
|
| 360 |
+
|
| 361 |
+
Notwithstanding any other provision of this License, for material you
|
| 362 |
+
add to a covered work, you may (if authorized by the copyright holders of
|
| 363 |
+
that material) supplement the terms of this License with terms:
|
| 364 |
+
|
| 365 |
+
a) Disclaiming warranty or limiting liability differently from the
|
| 366 |
+
terms of sections 15 and 16 of this License; or
|
| 367 |
+
|
| 368 |
+
b) Requiring preservation of specified reasonable legal notices or
|
| 369 |
+
author attributions in that material or in the Appropriate Legal
|
| 370 |
+
Notices displayed by works containing it; or
|
| 371 |
+
|
| 372 |
+
c) Prohibiting misrepresentation of the origin of that material, or
|
| 373 |
+
requiring that modified versions of such material be marked in
|
| 374 |
+
reasonable ways as different from the original version; or
|
| 375 |
+
|
| 376 |
+
d) Limiting the use for publicity purposes of names of licensors or
|
| 377 |
+
authors of the material; or
|
| 378 |
+
|
| 379 |
+
e) Declining to grant rights under trademark law for use of some
|
| 380 |
+
trade names, trademarks, or service marks; or
|
| 381 |
+
|
| 382 |
+
f) Requiring indemnification of licensors and authors of that
|
| 383 |
+
material by anyone who conveys the material (or modified versions of
|
| 384 |
+
it) with contractual assumptions of liability to the recipient, for
|
| 385 |
+
any liability that these contractual assumptions directly impose on
|
| 386 |
+
those licensors and authors.
|
| 387 |
+
|
| 388 |
+
All other non-permissive additional terms are considered "further
|
| 389 |
+
restrictions" within the meaning of section 10. If the Program as you
|
| 390 |
+
received it, or any part of it, contains a notice stating that it is
|
| 391 |
+
governed by this License along with a term that is a further
|
| 392 |
+
restriction, you may remove that term. If a license document contains
|
| 393 |
+
a further restriction but permits relicensing or conveying under this
|
| 394 |
+
License, you may add to a covered work material governed by the terms
|
| 395 |
+
of that license document, provided that the further restriction does
|
| 396 |
+
not survive such relicensing or conveying.
|
| 397 |
+
|
| 398 |
+
If you add terms to a covered work in accord with this section, you
|
| 399 |
+
must place, in the relevant source files, a statement of the
|
| 400 |
+
additional terms that apply to those files, or a notice indicating
|
| 401 |
+
where to find the applicable terms.
|
| 402 |
+
|
| 403 |
+
Additional terms, permissive or non-permissive, may be stated in the
|
| 404 |
+
form of a separately written license, or stated as exceptions;
|
| 405 |
+
the above requirements apply either way.
|
| 406 |
+
|
| 407 |
+
8. Termination.
|
| 408 |
+
|
| 409 |
+
You may not propagate or modify a covered work except as expressly
|
| 410 |
+
provided under this License. Any attempt otherwise to propagate or
|
| 411 |
+
modify it is void, and will automatically terminate your rights under
|
| 412 |
+
this License (including any patent licenses granted under the third
|
| 413 |
+
paragraph of section 11).
|
| 414 |
+
|
| 415 |
+
However, if you cease all violation of this License, then your
|
| 416 |
+
license from a particular copyright holder is reinstated (a)
|
| 417 |
+
provisionally, unless and until the copyright holder explicitly and
|
| 418 |
+
finally terminates your license, and (b) permanently, if the copyright
|
| 419 |
+
holder fails to notify you of the violation by some reasonable means
|
| 420 |
+
prior to 60 days after the cessation.
|
| 421 |
+
|
| 422 |
+
Moreover, your license from a particular copyright holder is
|
| 423 |
+
reinstated permanently if the copyright holder notifies you of the
|
| 424 |
+
violation by some reasonable means, this is the first time you have
|
| 425 |
+
received notice of violation of this License (for any work) from that
|
| 426 |
+
copyright holder, and you cure the violation prior to 30 days after
|
| 427 |
+
your receipt of the notice.
|
| 428 |
+
|
| 429 |
+
Termination of your rights under this section does not terminate the
|
| 430 |
+
licenses of parties who have received copies or rights from you under
|
| 431 |
+
this License. If your rights have been terminated and not permanently
|
| 432 |
+
reinstated, you do not qualify to receive new licenses for the same
|
| 433 |
+
material under section 10.
|
| 434 |
+
|
| 435 |
+
9. Acceptance Not Required for Having Copies.
|
| 436 |
+
|
| 437 |
+
You are not required to accept this License in order to receive or
|
| 438 |
+
run a copy of the Program. Ancillary propagation of a covered work
|
| 439 |
+
occurring solely as a consequence of using peer-to-peer transmission
|
| 440 |
+
to receive a copy likewise does not require acceptance. However,
|
| 441 |
+
nothing other than this License grants you permission to propagate or
|
| 442 |
+
modify any covered work. These actions infringe copyright if you do
|
| 443 |
+
not accept this License. Therefore, by modifying or propagating a
|
| 444 |
+
covered work, you indicate your acceptance of this License to do so.
|
| 445 |
+
|
| 446 |
+
10. Automatic Licensing of Downstream Recipients.
|
| 447 |
+
|
| 448 |
+
Each time you convey a covered work, the recipient automatically
|
| 449 |
+
receives a license from the original licensors, to run, modify and
|
| 450 |
+
propagate that work, subject to this License. You are not responsible
|
| 451 |
+
for enforcing compliance by third parties with this License.
|
| 452 |
+
|
| 453 |
+
An "entity transaction" is a transaction transferring control of an
|
| 454 |
+
organization, or substantially all assets of one, or subdividing an
|
| 455 |
+
organization, or merging organizations. If propagation of a covered
|
| 456 |
+
work results from an entity transaction, each party to that
|
| 457 |
+
transaction who receives a copy of the work also receives whatever
|
| 458 |
+
licenses to the work the party's predecessor in interest had or could
|
| 459 |
+
give under the previous paragraph, plus a right to possession of the
|
| 460 |
+
Corresponding Source of the work from the predecessor in interest, if
|
| 461 |
+
the predecessor has it or can get it with reasonable efforts.
|
| 462 |
+
|
| 463 |
+
You may not impose any further restrictions on the exercise of the
|
| 464 |
+
rights granted or affirmed under this License. For example, you may
|
| 465 |
+
not impose a license fee, royalty, or other charge for exercise of
|
| 466 |
+
rights granted under this License, and you may not initiate litigation
|
| 467 |
+
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
| 468 |
+
any patent claim is infringed by making, using, selling, offering for
|
| 469 |
+
sale, or importing the Program or any portion of it.
|
| 470 |
+
|
| 471 |
+
11. Patents.
|
| 472 |
+
|
| 473 |
+
A "contributor" is a copyright holder who authorizes use under this
|
| 474 |
+
License of the Program or a work on which the Program is based. The
|
| 475 |
+
work thus licensed is called the contributor's "contributor version".
|
| 476 |
+
|
| 477 |
+
A contributor's "essential patent claims" are all patent claims
|
| 478 |
+
owned or controlled by the contributor, whether already acquired or
|
| 479 |
+
hereafter acquired, that would be infringed by some manner, permitted
|
| 480 |
+
by this License, of making, using, or selling its contributor version,
|
| 481 |
+
but do not include claims that would be infringed only as a
|
| 482 |
+
consequence of further modification of the contributor version. For
|
| 483 |
+
purposes of this definition, "control" includes the right to grant
|
| 484 |
+
patent sublicenses in a manner consistent with the requirements of
|
| 485 |
+
this License.
|
| 486 |
+
|
| 487 |
+
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
| 488 |
+
patent license under the contributor's essential patent claims, to
|
| 489 |
+
make, use, sell, offer for sale, import and otherwise run, modify and
|
| 490 |
+
propagate the contents of its contributor version.
|
| 491 |
+
|
| 492 |
+
In the following three paragraphs, a "patent license" is any express
|
| 493 |
+
agreement or commitment, however denominated, not to enforce a patent
|
| 494 |
+
(such as an express permission to practice a patent or covenant not to
|
| 495 |
+
sue for patent infringement). To "grant" such a patent license to a
|
| 496 |
+
party means to make such an agreement or commitment not to enforce a
|
| 497 |
+
patent against the party.
|
| 498 |
+
|
| 499 |
+
If you convey a covered work, knowingly relying on a patent license,
|
| 500 |
+
and the Corresponding Source of the work is not available for anyone
|
| 501 |
+
to copy, free of charge and under the terms of this License, through a
|
| 502 |
+
publicly available network server or other readily accessible means,
|
| 503 |
+
then you must either (1) cause the Corresponding Source to be so
|
| 504 |
+
available, or (2) arrange to deprive yourself of the benefit of the
|
| 505 |
+
patent license for this particular work, or (3) arrange, in a manner
|
| 506 |
+
consistent with the requirements of this License, to extend the patent
|
| 507 |
+
license to downstream recipients. "Knowingly relying" means you have
|
| 508 |
+
actual knowledge that, but for the patent license, your conveying the
|
| 509 |
+
covered work in a country, or your recipient's use of the covered work
|
| 510 |
+
in a country, would infringe one or more identifiable patents in that
|
| 511 |
+
country that you have reason to believe are valid.
|
| 512 |
+
|
| 513 |
+
If, pursuant to or in connection with a single transaction or
|
| 514 |
+
arrangement, you convey, or propagate by procuring conveyance of, a
|
| 515 |
+
covered work, and grant a patent license to some of the parties
|
| 516 |
+
receiving the covered work authorizing them to use, propagate, modify
|
| 517 |
+
or convey a specific copy of the covered work, then the patent license
|
| 518 |
+
you grant is automatically extended to all recipients of the covered
|
| 519 |
+
work and works based on it.
|
| 520 |
+
|
| 521 |
+
A patent license is "discriminatory" if it does not include within
|
| 522 |
+
the scope of its coverage, prohibits the exercise of, or is
|
| 523 |
+
conditioned on the non-exercise of one or more of the rights that are
|
| 524 |
+
specifically granted under this License. You may not convey a covered
|
| 525 |
+
work if you are a party to an arrangement with a third party that is
|
| 526 |
+
in the business of distributing software, under which you make payment
|
| 527 |
+
to the third party based on the extent of your activity of conveying
|
| 528 |
+
the work, and under which the third party grants, to any of the
|
| 529 |
+
parties who would receive the covered work from you, a discriminatory
|
| 530 |
+
patent license (a) in connection with copies of the covered work
|
| 531 |
+
conveyed by you (or copies made from those copies), or (b) primarily
|
| 532 |
+
for and in connection with specific products or compilations that
|
| 533 |
+
contain the covered work, unless you entered into that arrangement,
|
| 534 |
+
or that patent license was granted, prior to 28 March 2007.
|
| 535 |
+
|
| 536 |
+
Nothing in this License shall be construed as excluding or limiting
|
| 537 |
+
any implied license or other defenses to infringement that may
|
| 538 |
+
otherwise be available to you under applicable patent law.
|
| 539 |
+
|
| 540 |
+
12. No Surrender of Others' Freedom.
|
| 541 |
+
|
| 542 |
+
If conditions are imposed on you (whether by court order, agreement or
|
| 543 |
+
otherwise) that contradict the conditions of this License, they do not
|
| 544 |
+
excuse you from the conditions of this License. If you cannot convey a
|
| 545 |
+
covered work so as to satisfy simultaneously your obligations under this
|
| 546 |
+
License and any other pertinent obligations, then as a consequence you may
|
| 547 |
+
not convey it at all. For example, if you agree to terms that obligate you
|
| 548 |
+
to collect a royalty for further conveying from those to whom you convey
|
| 549 |
+
the Program, the only way you could satisfy both those terms and this
|
| 550 |
+
License would be to refrain entirely from conveying the Program.
|
| 551 |
+
|
| 552 |
+
13. Use with the GNU Affero General Public License.
|
| 553 |
+
|
| 554 |
+
Notwithstanding any other provision of this License, you have
|
| 555 |
+
permission to link or combine any covered work with a work licensed
|
| 556 |
+
under version 3 of the GNU Affero General Public License into a single
|
| 557 |
+
combined work, and to convey the resulting work. The terms of this
|
| 558 |
+
License will continue to apply to the part which is the covered work,
|
| 559 |
+
but the special requirements of the GNU Affero General Public License,
|
| 560 |
+
section 13, concerning interaction through a network will apply to the
|
| 561 |
+
combination as such.
|
| 562 |
+
|
| 563 |
+
14. Revised Versions of this License.
|
| 564 |
+
|
| 565 |
+
The Free Software Foundation may publish revised and/or new versions of
|
| 566 |
+
the GNU General Public License from time to time. Such new versions will
|
| 567 |
+
be similar in spirit to the present version, but may differ in detail to
|
| 568 |
+
address new problems or concerns.
|
| 569 |
+
|
| 570 |
+
Each version is given a distinguishing version number. If the
|
| 571 |
+
Program specifies that a certain numbered version of the GNU General
|
| 572 |
+
Public License "or any later version" applies to it, you have the
|
| 573 |
+
option of following the terms and conditions either of that numbered
|
| 574 |
+
version or of any later version published by the Free Software
|
| 575 |
+
Foundation. If the Program does not specify a version number of the
|
| 576 |
+
GNU General Public License, you may choose any version ever published
|
| 577 |
+
by the Free Software Foundation.
|
| 578 |
+
|
| 579 |
+
If the Program specifies that a proxy can decide which future
|
| 580 |
+
versions of the GNU General Public License can be used, that proxy's
|
| 581 |
+
public statement of acceptance of a version permanently authorizes you
|
| 582 |
+
to choose that version for the Program.
|
| 583 |
+
|
| 584 |
+
Later license versions may give you additional or different
|
| 585 |
+
permissions. However, no additional obligations are imposed on any
|
| 586 |
+
author or copyright holder as a result of your choosing to follow a
|
| 587 |
+
later version.
|
| 588 |
+
|
| 589 |
+
15. Disclaimer of Warranty.
|
| 590 |
+
|
| 591 |
+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
| 592 |
+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
| 593 |
+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
| 594 |
+
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
| 595 |
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
| 596 |
+
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
| 597 |
+
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
| 598 |
+
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
| 599 |
+
|
| 600 |
+
16. Limitation of Liability.
|
| 601 |
+
|
| 602 |
+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
| 603 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
| 604 |
+
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
| 605 |
+
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
| 606 |
+
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
| 607 |
+
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
| 608 |
+
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
| 609 |
+
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
| 610 |
+
SUCH DAMAGES.
|
| 611 |
+
|
| 612 |
+
17. Interpretation of Sections 15 and 16.
|
| 613 |
+
|
| 614 |
+
If the disclaimer of warranty and limitation of liability provided
|
| 615 |
+
above cannot be given local legal effect according to their terms,
|
| 616 |
+
reviewing courts shall apply local law that most closely approximates
|
| 617 |
+
an absolute waiver of all civil liability in connection with the
|
| 618 |
+
Program, unless a warranty or assumption of liability accompanies a
|
| 619 |
+
copy of the Program in return for a fee.
|
| 620 |
+
|
| 621 |
+
END OF TERMS AND CONDITIONS
|
| 622 |
+
|
| 623 |
+
How to Apply These Terms to Your New Programs
|
| 624 |
+
|
| 625 |
+
If you develop a new program, and you want it to be of the greatest
|
| 626 |
+
possible use to the public, the best way to achieve this is to make it
|
| 627 |
+
free software which everyone can redistribute and change under these terms.
|
| 628 |
+
|
| 629 |
+
To do so, attach the following notices to the program. It is safest
|
| 630 |
+
to attach them to the start of each source file to most effectively
|
| 631 |
+
state the exclusion of warranty; and each file should have at least
|
| 632 |
+
the "copyright" line and a pointer to where the full notice is found.
|
| 633 |
+
|
| 634 |
+
<one line to give the program's name and a brief idea of what it does.>
|
| 635 |
+
Copyright (C) <year> <name of author>
|
| 636 |
+
|
| 637 |
+
This program is free software: you can redistribute it and/or modify
|
| 638 |
+
it under the terms of the GNU General Public License as published by
|
| 639 |
+
the Free Software Foundation, either version 3 of the License, or
|
| 640 |
+
(at your option) any later version.
|
| 641 |
+
|
| 642 |
+
This program is distributed in the hope that it will be useful,
|
| 643 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 644 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 645 |
+
GNU General Public License for more details.
|
| 646 |
+
|
| 647 |
+
You should have received a copy of the GNU General Public License
|
| 648 |
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
| 649 |
+
|
| 650 |
+
Also add information on how to contact you by electronic and paper mail.
|
| 651 |
+
|
| 652 |
+
If the program does terminal interaction, make it output a short
|
| 653 |
+
notice like this when it starts in an interactive mode:
|
| 654 |
+
|
| 655 |
+
<program> Copyright (C) <year> <name of author>
|
| 656 |
+
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
| 657 |
+
This is free software, and you are welcome to redistribute it
|
| 658 |
+
under certain conditions; type `show c' for details.
|
| 659 |
+
|
| 660 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
| 661 |
+
parts of the General Public License. Of course, your program's commands
|
| 662 |
+
might be different; for a GUI interface, you would use an "about box".
|
| 663 |
+
|
| 664 |
+
You should also get your employer (if you work as a programmer) or school,
|
| 665 |
+
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
| 666 |
+
For more information on this, and how to apply and follow the GNU GPL, see
|
| 667 |
+
<http://www.gnu.org/licenses/>.
|
| 668 |
+
|
| 669 |
+
The GNU General Public License does not permit incorporating your program
|
| 670 |
+
into proprietary programs. If your program is a subroutine library, you
|
| 671 |
+
may consider it more useful to permit linking proprietary applications with
|
| 672 |
+
the library. If this is what you want to do, use the GNU Lesser General
|
| 673 |
+
Public License instead of this License. But first, please read
|
| 674 |
+
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffmpeg-all.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffmpeg-bitstream-filters.txt
ADDED
|
@@ -0,0 +1,890 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FFMPEG-BITSTREAM-FILTERS(1) FFMPEG-BITSTREAM-FILTERS(1)
|
| 2 |
+
|
| 3 |
+
NAME
|
| 4 |
+
ffmpeg-bitstream-filters - FFmpeg bitstream filters
|
| 5 |
+
|
| 6 |
+
DESCRIPTION
|
| 7 |
+
This document describes the bitstream filters provided by the
|
| 8 |
+
libavcodec library.
|
| 9 |
+
|
| 10 |
+
A bitstream filter operates on the encoded stream data, and performs
|
| 11 |
+
bitstream level modifications without performing decoding.
|
| 12 |
+
|
| 13 |
+
BITSTREAM FILTERS
|
| 14 |
+
When you configure your FFmpeg build, all the supported bitstream
|
| 15 |
+
filters are enabled by default. You can list all available ones using
|
| 16 |
+
the configure option "--list-bsfs".
|
| 17 |
+
|
| 18 |
+
You can disable all the bitstream filters using the configure option
|
| 19 |
+
"--disable-bsfs", and selectively enable any bitstream filter using the
|
| 20 |
+
option "--enable-bsf=BSF", or you can disable a particular bitstream
|
| 21 |
+
filter using the option "--disable-bsf=BSF".
|
| 22 |
+
|
| 23 |
+
The option "-bsfs" of the ff* tools will display the list of all the
|
| 24 |
+
supported bitstream filters included in your build.
|
| 25 |
+
|
| 26 |
+
The ff* tools have a -bsf option applied per stream, taking a comma-
|
| 27 |
+
separated list of filters, whose parameters follow the filter name
|
| 28 |
+
after a '='.
|
| 29 |
+
|
| 30 |
+
ffmpeg -i INPUT -c:v copy -bsf:v filter1[=opt1=str1:opt2=str2][,filter2] OUTPUT
|
| 31 |
+
|
| 32 |
+
Below is a description of the currently available bitstream filters,
|
| 33 |
+
with their parameters, if any.
|
| 34 |
+
|
| 35 |
+
aac_adtstoasc
|
| 36 |
+
Convert MPEG-2/4 AAC ADTS to an MPEG-4 Audio Specific Configuration
|
| 37 |
+
bitstream.
|
| 38 |
+
|
| 39 |
+
This filter creates an MPEG-4 AudioSpecificConfig from an MPEG-2/4 ADTS
|
| 40 |
+
header and removes the ADTS header.
|
| 41 |
+
|
| 42 |
+
This filter is required for example when copying an AAC stream from a
|
| 43 |
+
raw ADTS AAC or an MPEG-TS container to MP4A-LATM, to an FLV file, or
|
| 44 |
+
to MOV/MP4 files and related formats such as 3GP or M4A. Please note
|
| 45 |
+
that it is auto-inserted for MP4A-LATM and MOV/MP4 and related formats.
|
| 46 |
+
|
| 47 |
+
av1_metadata
|
| 48 |
+
Modify metadata embedded in an AV1 stream.
|
| 49 |
+
|
| 50 |
+
td Insert or remove temporal delimiter OBUs in all temporal units of
|
| 51 |
+
the stream.
|
| 52 |
+
|
| 53 |
+
insert
|
| 54 |
+
Insert a TD at the beginning of every TU which does not already
|
| 55 |
+
have one.
|
| 56 |
+
|
| 57 |
+
remove
|
| 58 |
+
Remove the TD from the beginning of every TU which has one.
|
| 59 |
+
|
| 60 |
+
color_primaries
|
| 61 |
+
transfer_characteristics
|
| 62 |
+
matrix_coefficients
|
| 63 |
+
Set the color description fields in the stream (see AV1 section
|
| 64 |
+
6.4.2).
|
| 65 |
+
|
| 66 |
+
color_range
|
| 67 |
+
Set the color range in the stream (see AV1 section 6.4.2; note that
|
| 68 |
+
this cannot be set for streams using BT.709 primaries, sRGB
|
| 69 |
+
transfer characteristic and identity (RGB) matrix coefficients).
|
| 70 |
+
|
| 71 |
+
tv Limited range.
|
| 72 |
+
|
| 73 |
+
pc Full range.
|
| 74 |
+
|
| 75 |
+
chroma_sample_position
|
| 76 |
+
Set the chroma sample location in the stream (see AV1 section
|
| 77 |
+
6.4.2). This can only be set for 4:2:0 streams.
|
| 78 |
+
|
| 79 |
+
vertical
|
| 80 |
+
Left position (matching the default in MPEG-2 and H.264).
|
| 81 |
+
|
| 82 |
+
colocated
|
| 83 |
+
Top-left position.
|
| 84 |
+
|
| 85 |
+
tick_rate
|
| 86 |
+
Set the tick rate (time_scale / num_units_in_display_tick) in the
|
| 87 |
+
timing info in the sequence header.
|
| 88 |
+
|
| 89 |
+
num_ticks_per_picture
|
| 90 |
+
Set the number of ticks in each picture, to indicate that the
|
| 91 |
+
stream has a fixed framerate. Ignored if tick_rate is not also
|
| 92 |
+
set.
|
| 93 |
+
|
| 94 |
+
delete_padding
|
| 95 |
+
Deletes Padding OBUs.
|
| 96 |
+
|
| 97 |
+
chomp
|
| 98 |
+
Remove zero padding at the end of a packet.
|
| 99 |
+
|
| 100 |
+
dca_core
|
| 101 |
+
Extract the core from a DCA/DTS stream, dropping extensions such as
|
| 102 |
+
DTS-HD.
|
| 103 |
+
|
| 104 |
+
dump_extra
|
| 105 |
+
Add extradata to the beginning of the filtered packets except when said
|
| 106 |
+
packets already exactly begin with the extradata that is intended to be
|
| 107 |
+
added.
|
| 108 |
+
|
| 109 |
+
freq
|
| 110 |
+
The additional argument specifies which packets should be filtered.
|
| 111 |
+
It accepts the values:
|
| 112 |
+
|
| 113 |
+
k
|
| 114 |
+
keyframe
|
| 115 |
+
add extradata to all key packets
|
| 116 |
+
|
| 117 |
+
e
|
| 118 |
+
all add extradata to all packets
|
| 119 |
+
|
| 120 |
+
If not specified it is assumed k.
|
| 121 |
+
|
| 122 |
+
For example the following ffmpeg command forces a global header (thus
|
| 123 |
+
disabling individual packet headers) in the H.264 packets generated by
|
| 124 |
+
the "libx264" encoder, but corrects them by adding the header stored in
|
| 125 |
+
extradata to the key packets:
|
| 126 |
+
|
| 127 |
+
ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
|
| 128 |
+
|
| 129 |
+
dv_error_marker
|
| 130 |
+
Blocks in DV which are marked as damaged are replaced by blocks of the
|
| 131 |
+
specified color.
|
| 132 |
+
|
| 133 |
+
color
|
| 134 |
+
The color to replace damaged blocks by
|
| 135 |
+
|
| 136 |
+
sta A 16 bit mask which specifies which of the 16 possible error status
|
| 137 |
+
values are to be replaced by colored blocks. 0xFFFE is the default
|
| 138 |
+
which replaces all non 0 error status values.
|
| 139 |
+
|
| 140 |
+
ok No error, no concealment
|
| 141 |
+
|
| 142 |
+
err Error, No concealment
|
| 143 |
+
|
| 144 |
+
res Reserved
|
| 145 |
+
|
| 146 |
+
notok
|
| 147 |
+
Error or concealment
|
| 148 |
+
|
| 149 |
+
notres
|
| 150 |
+
Not reserved
|
| 151 |
+
|
| 152 |
+
Aa, Ba, Ca, Ab, Bb, Cb, A, B, C, a, b, erri, erru
|
| 153 |
+
The specific error status code
|
| 154 |
+
|
| 155 |
+
see page 44-46 or section 5.5 of
|
| 156 |
+
<http://web.archive.org/web/20060927044735/http://www.smpte.org/smpte_store/standards/pdf/s314m.pdf>
|
| 157 |
+
|
| 158 |
+
eac3_core
|
| 159 |
+
Extract the core from a E-AC-3 stream, dropping extra channels.
|
| 160 |
+
|
| 161 |
+
extract_extradata
|
| 162 |
+
Extract the in-band extradata.
|
| 163 |
+
|
| 164 |
+
Certain codecs allow the long-term headers (e.g. MPEG-2 sequence
|
| 165 |
+
headers, or H.264/HEVC (VPS/)SPS/PPS) to be transmitted either "in-
|
| 166 |
+
band" (i.e. as a part of the bitstream containing the coded frames) or
|
| 167 |
+
"out of band" (e.g. on the container level). This latter form is called
|
| 168 |
+
"extradata" in FFmpeg terminology.
|
| 169 |
+
|
| 170 |
+
This bitstream filter detects the in-band headers and makes them
|
| 171 |
+
available as extradata.
|
| 172 |
+
|
| 173 |
+
remove
|
| 174 |
+
When this option is enabled, the long-term headers are removed from
|
| 175 |
+
the bitstream after extraction.
|
| 176 |
+
|
| 177 |
+
filter_units
|
| 178 |
+
Remove units with types in or not in a given set from the stream.
|
| 179 |
+
|
| 180 |
+
pass_types
|
| 181 |
+
List of unit types or ranges of unit types to pass through while
|
| 182 |
+
removing all others. This is specified as a '|'-separated list of
|
| 183 |
+
unit type values or ranges of values with '-'.
|
| 184 |
+
|
| 185 |
+
remove_types
|
| 186 |
+
Identical to pass_types, except the units in the given set removed
|
| 187 |
+
and all others passed through.
|
| 188 |
+
|
| 189 |
+
The types used by pass_types and remove_types correspond to NAL unit
|
| 190 |
+
types (nal_unit_type) in H.264, HEVC and H.266 (see Table 7-1 in the
|
| 191 |
+
H.264 and HEVC specifications or Table 5 in the H.266 specification),
|
| 192 |
+
to marker values for JPEG (without 0xFF prefix) and to start codes
|
| 193 |
+
without start code prefix (i.e. the byte following the 0x000001) for
|
| 194 |
+
MPEG-2. For VP8 and VP9, every unit has type zero.
|
| 195 |
+
|
| 196 |
+
Extradata is unchanged by this transformation, but note that if the
|
| 197 |
+
stream contains inline parameter sets then the output may be unusable
|
| 198 |
+
if they are removed.
|
| 199 |
+
|
| 200 |
+
For example, to remove all non-VCL NAL units from an H.264 stream:
|
| 201 |
+
|
| 202 |
+
ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=pass_types=1-5' OUTPUT
|
| 203 |
+
|
| 204 |
+
To remove all AUDs, SEI and filler from an H.265 stream:
|
| 205 |
+
|
| 206 |
+
ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=35|38-40' OUTPUT
|
| 207 |
+
|
| 208 |
+
To remove all user data from a MPEG-2 stream, including Closed
|
| 209 |
+
Captions:
|
| 210 |
+
|
| 211 |
+
ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=178' OUTPUT
|
| 212 |
+
|
| 213 |
+
To remove all SEI from a H264 stream, including Closed Captions:
|
| 214 |
+
|
| 215 |
+
ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=6' OUTPUT
|
| 216 |
+
|
| 217 |
+
To remove all prefix and suffix SEI from a HEVC stream, including
|
| 218 |
+
Closed Captions and dynamic HDR:
|
| 219 |
+
|
| 220 |
+
ffmpeg -i INPUT -c:v copy -bsf:v 'filter_units=remove_types=39|40' OUTPUT
|
| 221 |
+
|
| 222 |
+
hapqa_extract
|
| 223 |
+
Extract Rgb or Alpha part of an HAPQA file, without recompression, in
|
| 224 |
+
order to create an HAPQ or an HAPAlphaOnly file.
|
| 225 |
+
|
| 226 |
+
texture
|
| 227 |
+
Specifies the texture to keep.
|
| 228 |
+
|
| 229 |
+
color
|
| 230 |
+
alpha
|
| 231 |
+
|
| 232 |
+
Convert HAPQA to HAPQ
|
| 233 |
+
|
| 234 |
+
ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=color -tag:v HapY -metadata:s:v:0 encoder="HAPQ" hapq_file.mov
|
| 235 |
+
|
| 236 |
+
Convert HAPQA to HAPAlphaOnly
|
| 237 |
+
|
| 238 |
+
ffmpeg -i hapqa_inputfile.mov -c copy -bsf:v hapqa_extract=texture=alpha -tag:v HapA -metadata:s:v:0 encoder="HAPAlpha Only" hapalphaonly_file.mov
|
| 239 |
+
|
| 240 |
+
h264_metadata
|
| 241 |
+
Modify metadata embedded in an H.264 stream.
|
| 242 |
+
|
| 243 |
+
aud Insert or remove AUD NAL units in all access units of the stream.
|
| 244 |
+
|
| 245 |
+
pass
|
| 246 |
+
insert
|
| 247 |
+
remove
|
| 248 |
+
|
| 249 |
+
Default is pass.
|
| 250 |
+
|
| 251 |
+
sample_aspect_ratio
|
| 252 |
+
Set the sample aspect ratio of the stream in the VUI parameters.
|
| 253 |
+
See H.264 table E-1.
|
| 254 |
+
|
| 255 |
+
overscan_appropriate_flag
|
| 256 |
+
Set whether the stream is suitable for display using overscan or
|
| 257 |
+
not (see H.264 section E.2.1).
|
| 258 |
+
|
| 259 |
+
video_format
|
| 260 |
+
video_full_range_flag
|
| 261 |
+
Set the video format in the stream (see H.264 section E.2.1 and
|
| 262 |
+
table E-2).
|
| 263 |
+
|
| 264 |
+
colour_primaries
|
| 265 |
+
transfer_characteristics
|
| 266 |
+
matrix_coefficients
|
| 267 |
+
Set the colour description in the stream (see H.264 section E.2.1
|
| 268 |
+
and tables E-3, E-4 and E-5).
|
| 269 |
+
|
| 270 |
+
chroma_sample_loc_type
|
| 271 |
+
Set the chroma sample location in the stream (see H.264 section
|
| 272 |
+
E.2.1 and figure E-1).
|
| 273 |
+
|
| 274 |
+
tick_rate
|
| 275 |
+
Set the tick rate (time_scale / num_units_in_tick) in the VUI
|
| 276 |
+
parameters. This is the smallest time unit representable in the
|
| 277 |
+
stream, and in many cases represents the field rate of the stream
|
| 278 |
+
(double the frame rate).
|
| 279 |
+
|
| 280 |
+
fixed_frame_rate_flag
|
| 281 |
+
Set whether the stream has fixed framerate - typically this
|
| 282 |
+
indicates that the framerate is exactly half the tick rate, but the
|
| 283 |
+
exact meaning is dependent on interlacing and the picture structure
|
| 284 |
+
(see H.264 section E.2.1 and table E-6).
|
| 285 |
+
|
| 286 |
+
zero_new_constraint_set_flags
|
| 287 |
+
Zero constraint_set4_flag and constraint_set5_flag in the SPS.
|
| 288 |
+
These bits were reserved in a previous version of the H.264 spec,
|
| 289 |
+
and thus some hardware decoders require these to be zero. The
|
| 290 |
+
result of zeroing this is still a valid bitstream.
|
| 291 |
+
|
| 292 |
+
crop_left
|
| 293 |
+
crop_right
|
| 294 |
+
crop_top
|
| 295 |
+
crop_bottom
|
| 296 |
+
Set the frame cropping offsets in the SPS. These values will
|
| 297 |
+
replace the current ones if the stream is already cropped.
|
| 298 |
+
|
| 299 |
+
These fields are set in pixels. Note that some sizes may not be
|
| 300 |
+
representable if the chroma is subsampled or the stream is
|
| 301 |
+
interlaced (see H.264 section 7.4.2.1.1).
|
| 302 |
+
|
| 303 |
+
sei_user_data
|
| 304 |
+
Insert a string as SEI unregistered user data. The argument must
|
| 305 |
+
be of the form UUID+string, where the UUID is as hex digits
|
| 306 |
+
possibly separated by hyphens, and the string can be anything.
|
| 307 |
+
|
| 308 |
+
For example, 086f3693-b7b3-4f2c-9653-21492feee5b8+hello will insert
|
| 309 |
+
the string ``hello'' associated with the given UUID.
|
| 310 |
+
|
| 311 |
+
delete_filler
|
| 312 |
+
Deletes both filler NAL units and filler SEI messages.
|
| 313 |
+
|
| 314 |
+
display_orientation
|
| 315 |
+
Insert, extract or remove Display orientation SEI messages. See
|
| 316 |
+
H.264 section D.1.27 and D.2.27 for syntax and semantics.
|
| 317 |
+
|
| 318 |
+
pass
|
| 319 |
+
insert
|
| 320 |
+
remove
|
| 321 |
+
extract
|
| 322 |
+
|
| 323 |
+
Default is pass.
|
| 324 |
+
|
| 325 |
+
Insert mode works in conjunction with "rotate" and "flip" options.
|
| 326 |
+
Any pre-existing Display orientation messages will be removed in
|
| 327 |
+
insert or remove mode. Extract mode attaches the display matrix to
|
| 328 |
+
the packet as side data.
|
| 329 |
+
|
| 330 |
+
rotate
|
| 331 |
+
Set rotation in display orientation SEI (anticlockwise angle in
|
| 332 |
+
degrees). Range is -360 to +360. Default is NaN.
|
| 333 |
+
|
| 334 |
+
flip
|
| 335 |
+
Set flip in display orientation SEI.
|
| 336 |
+
|
| 337 |
+
horizontal
|
| 338 |
+
vertical
|
| 339 |
+
|
| 340 |
+
Default is unset.
|
| 341 |
+
|
| 342 |
+
level
|
| 343 |
+
Set the level in the SPS. Refer to H.264 section A.3 and tables
|
| 344 |
+
A-1 to A-5.
|
| 345 |
+
|
| 346 |
+
The argument must be the name of a level (for example, 4.2), a
|
| 347 |
+
level_idc value (for example, 42), or the special name auto
|
| 348 |
+
indicating that the filter should attempt to guess the level from
|
| 349 |
+
the input stream properties.
|
| 350 |
+
|
| 351 |
+
h264_mp4toannexb
|
| 352 |
+
Convert an H.264 bitstream from length prefixed mode to start code
|
| 353 |
+
prefixed mode (as defined in the Annex B of the ITU-T H.264
|
| 354 |
+
specification).
|
| 355 |
+
|
| 356 |
+
This is required by some streaming formats, typically the MPEG-2
|
| 357 |
+
transport stream format (muxer "mpegts").
|
| 358 |
+
|
| 359 |
+
For example to remux an MP4 file containing an H.264 stream to mpegts
|
| 360 |
+
format with ffmpeg, you can use the command:
|
| 361 |
+
|
| 362 |
+
ffmpeg -i INPUT.mp4 -codec copy -bsf:v h264_mp4toannexb OUTPUT.ts
|
| 363 |
+
|
| 364 |
+
Please note that this filter is auto-inserted for MPEG-TS (muxer
|
| 365 |
+
"mpegts") and raw H.264 (muxer "h264") output formats.
|
| 366 |
+
|
| 367 |
+
h264_redundant_pps
|
| 368 |
+
This applies a specific fixup to some Blu-ray streams which contain
|
| 369 |
+
redundant PPSs modifying irrelevant parameters of the stream which
|
| 370 |
+
confuse other transformations which require correct extradata.
|
| 371 |
+
|
| 372 |
+
hevc_metadata
|
| 373 |
+
Modify metadata embedded in an HEVC stream.
|
| 374 |
+
|
| 375 |
+
aud Insert or remove AUD NAL units in all access units of the stream.
|
| 376 |
+
|
| 377 |
+
insert
|
| 378 |
+
remove
|
| 379 |
+
sample_aspect_ratio
|
| 380 |
+
Set the sample aspect ratio in the stream in the VUI parameters.
|
| 381 |
+
|
| 382 |
+
video_format
|
| 383 |
+
video_full_range_flag
|
| 384 |
+
Set the video format in the stream (see H.265 section E.3.1 and
|
| 385 |
+
table E.2).
|
| 386 |
+
|
| 387 |
+
colour_primaries
|
| 388 |
+
transfer_characteristics
|
| 389 |
+
matrix_coefficients
|
| 390 |
+
Set the colour description in the stream (see H.265 section E.3.1
|
| 391 |
+
and tables E.3, E.4 and E.5).
|
| 392 |
+
|
| 393 |
+
chroma_sample_loc_type
|
| 394 |
+
Set the chroma sample location in the stream (see H.265 section
|
| 395 |
+
E.3.1 and figure E.1).
|
| 396 |
+
|
| 397 |
+
tick_rate
|
| 398 |
+
Set the tick rate in the VPS and VUI parameters (time_scale /
|
| 399 |
+
num_units_in_tick). Combined with num_ticks_poc_diff_one, this can
|
| 400 |
+
set a constant framerate in the stream. Note that it is likely to
|
| 401 |
+
be overridden by container parameters when the stream is in a
|
| 402 |
+
container.
|
| 403 |
+
|
| 404 |
+
num_ticks_poc_diff_one
|
| 405 |
+
Set poc_proportional_to_timing_flag in VPS and VUI and use this
|
| 406 |
+
value to set num_ticks_poc_diff_one_minus1 (see H.265 sections
|
| 407 |
+
7.4.3.1 and E.3.1). Ignored if tick_rate is not also set.
|
| 408 |
+
|
| 409 |
+
crop_left
|
| 410 |
+
crop_right
|
| 411 |
+
crop_top
|
| 412 |
+
crop_bottom
|
| 413 |
+
Set the conformance window cropping offsets in the SPS. These
|
| 414 |
+
values will replace the current ones if the stream is already
|
| 415 |
+
cropped.
|
| 416 |
+
|
| 417 |
+
These fields are set in pixels. Note that some sizes may not be
|
| 418 |
+
representable if the chroma is subsampled (H.265 section
|
| 419 |
+
7.4.3.2.1).
|
| 420 |
+
|
| 421 |
+
level
|
| 422 |
+
Set the level in the VPS and SPS. See H.265 section A.4 and tables
|
| 423 |
+
A.6 and A.7.
|
| 424 |
+
|
| 425 |
+
The argument must be the name of a level (for example, 5.1), a
|
| 426 |
+
general_level_idc value (for example, 153 for level 5.1), or the
|
| 427 |
+
special name auto indicating that the filter should attempt to
|
| 428 |
+
guess the level from the input stream properties.
|
| 429 |
+
|
| 430 |
+
hevc_mp4toannexb
|
| 431 |
+
Convert an HEVC/H.265 bitstream from length prefixed mode to start code
|
| 432 |
+
prefixed mode (as defined in the Annex B of the ITU-T H.265
|
| 433 |
+
specification).
|
| 434 |
+
|
| 435 |
+
This is required by some streaming formats, typically the MPEG-2
|
| 436 |
+
transport stream format (muxer "mpegts").
|
| 437 |
+
|
| 438 |
+
For example to remux an MP4 file containing an HEVC stream to mpegts
|
| 439 |
+
format with ffmpeg, you can use the command:
|
| 440 |
+
|
| 441 |
+
ffmpeg -i INPUT.mp4 -codec copy -bsf:v hevc_mp4toannexb OUTPUT.ts
|
| 442 |
+
|
| 443 |
+
Please note that this filter is auto-inserted for MPEG-TS (muxer
|
| 444 |
+
"mpegts") and raw HEVC/H.265 (muxer "h265" or "hevc") output formats.
|
| 445 |
+
|
| 446 |
+
imxdump
|
| 447 |
+
Modifies the bitstream to fit in MOV and to be usable by the Final Cut
|
| 448 |
+
Pro decoder. This filter only applies to the mpeg2video codec, and is
|
| 449 |
+
likely not needed for Final Cut Pro 7 and newer with the appropriate
|
| 450 |
+
-tag:v.
|
| 451 |
+
|
| 452 |
+
For example, to remux 30 MB/sec NTSC IMX to MOV:
|
| 453 |
+
|
| 454 |
+
ffmpeg -i input.mxf -c copy -bsf:v imxdump -tag:v mx3n output.mov
|
| 455 |
+
|
| 456 |
+
mjpeg2jpeg
|
| 457 |
+
Convert MJPEG/AVI1 packets to full JPEG/JFIF packets.
|
| 458 |
+
|
| 459 |
+
MJPEG is a video codec wherein each video frame is essentially a JPEG
|
| 460 |
+
image. The individual frames can be extracted without loss, e.g. by
|
| 461 |
+
|
| 462 |
+
ffmpeg -i ../some_mjpeg.avi -c:v copy frames_%d.jpg
|
| 463 |
+
|
| 464 |
+
Unfortunately, these chunks are incomplete JPEG images, because they
|
| 465 |
+
lack the DHT segment required for decoding. Quoting from
|
| 466 |
+
<http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml>:
|
| 467 |
+
|
| 468 |
+
Avery Lee, writing in the rec.video.desktop newsgroup in 2001,
|
| 469 |
+
commented that "MJPEG, or at least the MJPEG in AVIs having the MJPG
|
| 470 |
+
fourcc, is restricted JPEG with a fixed -- and *omitted* -- Huffman
|
| 471 |
+
table. The JPEG must be YCbCr colorspace, it must be 4:2:2, and it must
|
| 472 |
+
use basic Huffman encoding, not arithmetic or progressive. . . . You
|
| 473 |
+
can indeed extract the MJPEG frames and decode them with a regular JPEG
|
| 474 |
+
decoder, but you have to prepend the DHT segment to them, or else the
|
| 475 |
+
decoder won't have any idea how to decompress the data. The exact table
|
| 476 |
+
necessary is given in the OpenDML spec."
|
| 477 |
+
|
| 478 |
+
This bitstream filter patches the header of frames extracted from an
|
| 479 |
+
MJPEG stream (carrying the AVI1 header ID and lacking a DHT segment) to
|
| 480 |
+
produce fully qualified JPEG images.
|
| 481 |
+
|
| 482 |
+
ffmpeg -i mjpeg-movie.avi -c:v copy -bsf:v mjpeg2jpeg frame_%d.jpg
|
| 483 |
+
exiftran -i -9 frame*.jpg
|
| 484 |
+
ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
|
| 485 |
+
|
| 486 |
+
mjpegadump
|
| 487 |
+
Add an MJPEG A header to the bitstream, to enable decoding by
|
| 488 |
+
Quicktime.
|
| 489 |
+
|
| 490 |
+
mov2textsub
|
| 491 |
+
Extract a representable text file from MOV subtitles, stripping the
|
| 492 |
+
metadata header from each subtitle packet.
|
| 493 |
+
|
| 494 |
+
See also the text2movsub filter.
|
| 495 |
+
|
| 496 |
+
mpeg2_metadata
|
| 497 |
+
Modify metadata embedded in an MPEG-2 stream.
|
| 498 |
+
|
| 499 |
+
display_aspect_ratio
|
| 500 |
+
Set the display aspect ratio in the stream.
|
| 501 |
+
|
| 502 |
+
The following fixed values are supported:
|
| 503 |
+
|
| 504 |
+
4/3
|
| 505 |
+
16/9
|
| 506 |
+
221/100
|
| 507 |
+
|
| 508 |
+
Any other value will result in square pixels being signalled
|
| 509 |
+
instead (see H.262 section 6.3.3 and table 6-3).
|
| 510 |
+
|
| 511 |
+
frame_rate
|
| 512 |
+
Set the frame rate in the stream. This is constructed from a table
|
| 513 |
+
of known values combined with a small multiplier and divisor - if
|
| 514 |
+
the supplied value is not exactly representable, the nearest
|
| 515 |
+
representable value will be used instead (see H.262 section 6.3.3
|
| 516 |
+
and table 6-4).
|
| 517 |
+
|
| 518 |
+
video_format
|
| 519 |
+
Set the video format in the stream (see H.262 section 6.3.6 and
|
| 520 |
+
table 6-6).
|
| 521 |
+
|
| 522 |
+
colour_primaries
|
| 523 |
+
transfer_characteristics
|
| 524 |
+
matrix_coefficients
|
| 525 |
+
Set the colour description in the stream (see H.262 section 6.3.6
|
| 526 |
+
and tables 6-7, 6-8 and 6-9).
|
| 527 |
+
|
| 528 |
+
mpeg4_unpack_bframes
|
| 529 |
+
Unpack DivX-style packed B-frames.
|
| 530 |
+
|
| 531 |
+
DivX-style packed B-frames are not valid MPEG-4 and were only a
|
| 532 |
+
workaround for the broken Video for Windows subsystem. They use more
|
| 533 |
+
space, can cause minor AV sync issues, require more CPU power to decode
|
| 534 |
+
(unless the player has some decoded picture queue to compensate the
|
| 535 |
+
2,0,2,0 frame per packet style) and cause trouble if copied into a
|
| 536 |
+
standard container like mp4 or mpeg-ps/ts, because MPEG-4 decoders may
|
| 537 |
+
not be able to decode them, since they are not valid MPEG-4.
|
| 538 |
+
|
| 539 |
+
For example to fix an AVI file containing an MPEG-4 stream with DivX-
|
| 540 |
+
style packed B-frames using ffmpeg, you can use the command:
|
| 541 |
+
|
| 542 |
+
ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi
|
| 543 |
+
|
| 544 |
+
noise
|
| 545 |
+
Damages the contents of packets or simply drops them without damaging
|
| 546 |
+
the container. Can be used for fuzzing or testing error
|
| 547 |
+
resilience/concealment.
|
| 548 |
+
|
| 549 |
+
Parameters:
|
| 550 |
+
|
| 551 |
+
amount
|
| 552 |
+
Accepts an expression whose evaluation per-packet determines how
|
| 553 |
+
often bytes in that packet will be modified. A value below 0 will
|
| 554 |
+
result in a variable frequency. Default is 0 which results in no
|
| 555 |
+
modification. However, if neither amount nor drop is specified,
|
| 556 |
+
amount will be set to -1. See below for accepted variables.
|
| 557 |
+
|
| 558 |
+
drop
|
| 559 |
+
Accepts an expression evaluated per-packet whose value determines
|
| 560 |
+
whether that packet is dropped. Evaluation to a positive value
|
| 561 |
+
results in the packet being dropped. Evaluation to a negative value
|
| 562 |
+
results in a variable chance of it being dropped, roughly inverse
|
| 563 |
+
in proportion to the magnitude of the value. Default is 0 which
|
| 564 |
+
results in no drops. See below for accepted variables.
|
| 565 |
+
|
| 566 |
+
dropamount
|
| 567 |
+
Accepts a non-negative integer, which assigns a variable chance of
|
| 568 |
+
it being dropped, roughly inverse in proportion to the value.
|
| 569 |
+
Default is 0 which results in no drops. This option is kept for
|
| 570 |
+
backwards compatibility and is equivalent to setting drop to a
|
| 571 |
+
negative value with the same magnitude i.e. "dropamount=4" is the
|
| 572 |
+
same as "drop=-4". Ignored if drop is also specified.
|
| 573 |
+
|
| 574 |
+
Both "amount" and "drop" accept expressions containing the following
|
| 575 |
+
variables:
|
| 576 |
+
|
| 577 |
+
n The index of the packet, starting from zero.
|
| 578 |
+
|
| 579 |
+
tb The timebase for packet timestamps.
|
| 580 |
+
|
| 581 |
+
pts Packet presentation timestamp.
|
| 582 |
+
|
| 583 |
+
dts Packet decoding timestamp.
|
| 584 |
+
|
| 585 |
+
nopts
|
| 586 |
+
Constant representing AV_NOPTS_VALUE.
|
| 587 |
+
|
| 588 |
+
startpts
|
| 589 |
+
First non-AV_NOPTS_VALUE PTS seen in the stream.
|
| 590 |
+
|
| 591 |
+
startdts
|
| 592 |
+
First non-AV_NOPTS_VALUE DTS seen in the stream.
|
| 593 |
+
|
| 594 |
+
duration
|
| 595 |
+
d Packet duration, in timebase units.
|
| 596 |
+
|
| 597 |
+
pos Packet position in input; may be -1 when unknown or not set.
|
| 598 |
+
|
| 599 |
+
size
|
| 600 |
+
Packet size, in bytes.
|
| 601 |
+
|
| 602 |
+
key Whether packet is marked as a keyframe.
|
| 603 |
+
|
| 604 |
+
state
|
| 605 |
+
A pseudo random integer, primarily derived from the content of
|
| 606 |
+
packet payload.
|
| 607 |
+
|
| 608 |
+
Examples
|
| 609 |
+
|
| 610 |
+
Apply modification to every byte but don't drop any packets.
|
| 611 |
+
|
| 612 |
+
ffmpeg -i INPUT -c copy -bsf noise=1 output.mkv
|
| 613 |
+
|
| 614 |
+
Drop every video packet not marked as a keyframe after timestamp 30s
|
| 615 |
+
but do not modify any of the remaining packets.
|
| 616 |
+
|
| 617 |
+
ffmpeg -i INPUT -c copy -bsf:v noise=drop='gt(t\,30)*not(key)' output.mkv
|
| 618 |
+
|
| 619 |
+
Drop one second of audio every 10 seconds and add some random noise to
|
| 620 |
+
the rest.
|
| 621 |
+
|
| 622 |
+
ffmpeg -i INPUT -c copy -bsf:a noise=amount=-1:drop='between(mod(t\,10)\,9\,10)' output.mkv
|
| 623 |
+
|
| 624 |
+
null
|
| 625 |
+
This bitstream filter passes the packets through unchanged.
|
| 626 |
+
|
| 627 |
+
pcm_rechunk
|
| 628 |
+
Repacketize PCM audio to a fixed number of samples per packet or a
|
| 629 |
+
fixed packet rate per second. This is similar to the asetnsamples audio
|
| 630 |
+
filter but works on audio packets instead of audio frames.
|
| 631 |
+
|
| 632 |
+
nb_out_samples, n
|
| 633 |
+
Set the number of samples per each output audio packet. The number
|
| 634 |
+
is intended as the number of samples per each channel. Default
|
| 635 |
+
value is 1024.
|
| 636 |
+
|
| 637 |
+
pad, p
|
| 638 |
+
If set to 1, the filter will pad the last audio packet with
|
| 639 |
+
silence, so that it will contain the same number of samples (or
|
| 640 |
+
roughly the same number of samples, see frame_rate) as the previous
|
| 641 |
+
ones. Default value is 1.
|
| 642 |
+
|
| 643 |
+
frame_rate, r
|
| 644 |
+
This option makes the filter output a fixed number of packets per
|
| 645 |
+
second instead of a fixed number of samples per packet. If the
|
| 646 |
+
audio sample rate is not divisible by the frame rate then the
|
| 647 |
+
number of samples will not be constant but will vary slightly so
|
| 648 |
+
that each packet will start as close to the frame boundary as
|
| 649 |
+
possible. Using this option has precedence over nb_out_samples.
|
| 650 |
+
|
| 651 |
+
You can generate the well known 1602-1601-1602-1601-1602 pattern of
|
| 652 |
+
48kHz audio for NTSC frame rate using the frame_rate option.
|
| 653 |
+
|
| 654 |
+
ffmpeg -f lavfi -i sine=r=48000:d=1 -c pcm_s16le -bsf pcm_rechunk=r=30000/1001 -f framecrc -
|
| 655 |
+
|
| 656 |
+
pgs_frame_merge
|
| 657 |
+
Merge a sequence of PGS Subtitle segments ending with an "end of
|
| 658 |
+
display set" segment into a single packet.
|
| 659 |
+
|
| 660 |
+
This is required by some containers that support PGS subtitles (muxer
|
| 661 |
+
"matroska").
|
| 662 |
+
|
| 663 |
+
prores_metadata
|
| 664 |
+
Modify color property metadata embedded in prores stream.
|
| 665 |
+
|
| 666 |
+
color_primaries
|
| 667 |
+
Set the color primaries. Available values are:
|
| 668 |
+
|
| 669 |
+
auto
|
| 670 |
+
Keep the same color primaries property (default).
|
| 671 |
+
|
| 672 |
+
unknown
|
| 673 |
+
bt709
|
| 674 |
+
bt470bg
|
| 675 |
+
BT601 625
|
| 676 |
+
|
| 677 |
+
smpte170m
|
| 678 |
+
BT601 525
|
| 679 |
+
|
| 680 |
+
bt2020
|
| 681 |
+
smpte431
|
| 682 |
+
DCI P3
|
| 683 |
+
|
| 684 |
+
smpte432
|
| 685 |
+
P3 D65
|
| 686 |
+
|
| 687 |
+
transfer_characteristics
|
| 688 |
+
Set the color transfer. Available values are:
|
| 689 |
+
|
| 690 |
+
auto
|
| 691 |
+
Keep the same transfer characteristics property (default).
|
| 692 |
+
|
| 693 |
+
unknown
|
| 694 |
+
bt709
|
| 695 |
+
BT 601, BT 709, BT 2020
|
| 696 |
+
|
| 697 |
+
smpte2084
|
| 698 |
+
SMPTE ST 2084
|
| 699 |
+
|
| 700 |
+
arib-std-b67
|
| 701 |
+
ARIB STD-B67
|
| 702 |
+
|
| 703 |
+
matrix_coefficients
|
| 704 |
+
Set the matrix coefficient. Available values are:
|
| 705 |
+
|
| 706 |
+
auto
|
| 707 |
+
Keep the same colorspace property (default).
|
| 708 |
+
|
| 709 |
+
unknown
|
| 710 |
+
bt709
|
| 711 |
+
smpte170m
|
| 712 |
+
BT 601
|
| 713 |
+
|
| 714 |
+
bt2020nc
|
| 715 |
+
|
| 716 |
+
Set Rec709 colorspace for each frame of the file
|
| 717 |
+
|
| 718 |
+
ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov
|
| 719 |
+
|
| 720 |
+
Set Hybrid Log-Gamma parameters for each frame of the file
|
| 721 |
+
|
| 722 |
+
ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt2020:color_trc=arib-std-b67:colorspace=bt2020nc output.mov
|
| 723 |
+
|
| 724 |
+
remove_extra
|
| 725 |
+
Remove extradata from packets.
|
| 726 |
+
|
| 727 |
+
It accepts the following parameter:
|
| 728 |
+
|
| 729 |
+
freq
|
| 730 |
+
Set which frame types to remove extradata from.
|
| 731 |
+
|
| 732 |
+
k Remove extradata from non-keyframes only.
|
| 733 |
+
|
| 734 |
+
keyframe
|
| 735 |
+
Remove extradata from keyframes only.
|
| 736 |
+
|
| 737 |
+
e, all
|
| 738 |
+
Remove extradata from all frames.
|
| 739 |
+
|
| 740 |
+
setts
|
| 741 |
+
Set PTS and DTS in packets.
|
| 742 |
+
|
| 743 |
+
It accepts the following parameters:
|
| 744 |
+
|
| 745 |
+
ts
|
| 746 |
+
pts
|
| 747 |
+
dts Set expressions for PTS, DTS or both.
|
| 748 |
+
|
| 749 |
+
duration
|
| 750 |
+
Set expression for duration.
|
| 751 |
+
|
| 752 |
+
time_base
|
| 753 |
+
Set output time base.
|
| 754 |
+
|
| 755 |
+
The expressions are evaluated through the eval API and can contain the
|
| 756 |
+
following constants:
|
| 757 |
+
|
| 758 |
+
N The count of the input packet. Starting from 0.
|
| 759 |
+
|
| 760 |
+
TS The demux timestamp in input in case of "ts" or "dts" option or
|
| 761 |
+
presentation timestamp in case of "pts" option.
|
| 762 |
+
|
| 763 |
+
POS The original position in the file of the packet, or undefined if
|
| 764 |
+
undefined for the current packet
|
| 765 |
+
|
| 766 |
+
DTS The demux timestamp in input.
|
| 767 |
+
|
| 768 |
+
PTS The presentation timestamp in input.
|
| 769 |
+
|
| 770 |
+
DURATION
|
| 771 |
+
The duration in input.
|
| 772 |
+
|
| 773 |
+
STARTDTS
|
| 774 |
+
The DTS of the first packet.
|
| 775 |
+
|
| 776 |
+
STARTPTS
|
| 777 |
+
The PTS of the first packet.
|
| 778 |
+
|
| 779 |
+
PREV_INDTS
|
| 780 |
+
The previous input DTS.
|
| 781 |
+
|
| 782 |
+
PREV_INPTS
|
| 783 |
+
The previous input PTS.
|
| 784 |
+
|
| 785 |
+
PREV_INDURATION
|
| 786 |
+
The previous input duration.
|
| 787 |
+
|
| 788 |
+
PREV_OUTDTS
|
| 789 |
+
The previous output DTS.
|
| 790 |
+
|
| 791 |
+
PREV_OUTPTS
|
| 792 |
+
The previous output PTS.
|
| 793 |
+
|
| 794 |
+
PREV_OUTDURATION
|
| 795 |
+
The previous output duration.
|
| 796 |
+
|
| 797 |
+
NEXT_DTS
|
| 798 |
+
The next input DTS.
|
| 799 |
+
|
| 800 |
+
NEXT_PTS
|
| 801 |
+
The next input PTS.
|
| 802 |
+
|
| 803 |
+
NEXT_DURATION
|
| 804 |
+
The next input duration.
|
| 805 |
+
|
| 806 |
+
TB The timebase of stream packet belongs.
|
| 807 |
+
|
| 808 |
+
TB_OUT
|
| 809 |
+
The output timebase.
|
| 810 |
+
|
| 811 |
+
SR The sample rate of stream packet belongs.
|
| 812 |
+
|
| 813 |
+
NOPTS
|
| 814 |
+
The AV_NOPTS_VALUE constant.
|
| 815 |
+
|
| 816 |
+
For example, to set PTS equal to DTS (not recommended if B-frames are
|
| 817 |
+
involved):
|
| 818 |
+
|
| 819 |
+
ffmpeg -i INPUT -c:a copy -bsf:a setts=pts=DTS out.mkv
|
| 820 |
+
|
| 821 |
+
showinfo
|
| 822 |
+
Log basic packet information. Mainly useful for testing, debugging, and
|
| 823 |
+
development.
|
| 824 |
+
|
| 825 |
+
text2movsub
|
| 826 |
+
Convert text subtitles to MOV subtitles (as used by the "mov_text"
|
| 827 |
+
codec) with metadata headers.
|
| 828 |
+
|
| 829 |
+
See also the mov2textsub filter.
|
| 830 |
+
|
| 831 |
+
trace_headers
|
| 832 |
+
Log trace output containing all syntax elements in the coded stream
|
| 833 |
+
headers (everything above the level of individual coded blocks). This
|
| 834 |
+
can be useful for debugging low-level stream issues.
|
| 835 |
+
|
| 836 |
+
Supports AV1, H.264, H.265, (M)JPEG, MPEG-2 and VP9, but depending on
|
| 837 |
+
the build only a subset of these may be available.
|
| 838 |
+
|
| 839 |
+
truehd_core
|
| 840 |
+
Extract the core from a TrueHD stream, dropping ATMOS data.
|
| 841 |
+
|
| 842 |
+
vp9_metadata
|
| 843 |
+
Modify metadata embedded in a VP9 stream.
|
| 844 |
+
|
| 845 |
+
color_space
|
| 846 |
+
Set the color space value in the frame header. Note that any frame
|
| 847 |
+
set to RGB will be implicitly set to PC range and that RGB is
|
| 848 |
+
incompatible with profiles 0 and 2.
|
| 849 |
+
|
| 850 |
+
unknown
|
| 851 |
+
bt601
|
| 852 |
+
bt709
|
| 853 |
+
smpte170
|
| 854 |
+
smpte240
|
| 855 |
+
bt2020
|
| 856 |
+
rgb
|
| 857 |
+
color_range
|
| 858 |
+
Set the color range value in the frame header. Note that any value
|
| 859 |
+
imposed by the color space will take precedence over this value.
|
| 860 |
+
|
| 861 |
+
tv
|
| 862 |
+
pc
|
| 863 |
+
|
| 864 |
+
vp9_superframe
|
| 865 |
+
Merge VP9 invisible (alt-ref) frames back into VP9 superframes. This
|
| 866 |
+
fixes merging of split/segmented VP9 streams where the alt-ref frame
|
| 867 |
+
was split from its visible counterpart.
|
| 868 |
+
|
| 869 |
+
vp9_superframe_split
|
| 870 |
+
Split VP9 superframes into single frames.
|
| 871 |
+
|
| 872 |
+
vp9_raw_reorder
|
| 873 |
+
Given a VP9 stream with correct timestamps but possibly out of order,
|
| 874 |
+
insert additional show-existing-frame packets to correct the ordering.
|
| 875 |
+
|
| 876 |
+
SEE ALSO
|
| 877 |
+
ffmpeg(1), ffplay(1), ffprobe(1), libavcodec(3)
|
| 878 |
+
|
| 879 |
+
AUTHORS
|
| 880 |
+
The FFmpeg developers.
|
| 881 |
+
|
| 882 |
+
For details about the authorship, see the Git history of the project
|
| 883 |
+
(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command git log in
|
| 884 |
+
the FFmpeg source directory, or browsing the online repository at
|
| 885 |
+
<https://git.ffmpeg.org/ffmpeg>.
|
| 886 |
+
|
| 887 |
+
Maintainers for the specific components are listed in the file
|
| 888 |
+
MAINTAINERS in the source code tree.
|
| 889 |
+
|
| 890 |
+
FFMPEG-BITSTREAM-FILTERS(1)
|
pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffmpeg-codecs.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffmpeg-devices.txt
ADDED
|
@@ -0,0 +1,1915 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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CRIPTION
|
| 7 |
+
This document describes the input and output devices provided by the
|
| 8 |
+
libavdevice library.
|
| 9 |
+
|
| 10 |
+
DEVICE OPTIONS
|
| 11 |
+
The libavdevice library provides the same interface as libavformat.
|
| 12 |
+
Namely, an input device is considered like a demuxer, and an output
|
| 13 |
+
device like a muxer, and the interface and generic device options are
|
| 14 |
+
the same provided by libavformat (see the ffmpeg-formats manual).
|
| 15 |
+
|
| 16 |
+
In addition each input or output device may support so-called private
|
| 17 |
+
options, which are specific for that component.
|
| 18 |
+
|
| 19 |
+
Options may be set by specifying -option value in the FFmpeg tools, or
|
| 20 |
+
by setting the value explicitly in the device "AVFormatContext" options
|
| 21 |
+
or using the libavutil/opt.h API for programmatic use.
|
| 22 |
+
|
| 23 |
+
INPUT DEVICES
|
| 24 |
+
Input devices are configured elements in FFmpeg which enable accessing
|
| 25 |
+
the data coming from a multimedia device attached to your system.
|
| 26 |
+
|
| 27 |
+
When you configure your FFmpeg build, all the supported input devices
|
| 28 |
+
are enabled by default. You can list all available ones using the
|
| 29 |
+
configure option "--list-indevs".
|
| 30 |
+
|
| 31 |
+
You can disable all the input devices using the configure option
|
| 32 |
+
"--disable-indevs", and selectively enable an input device using the
|
| 33 |
+
option "--enable-indev=INDEV", or you can disable a particular input
|
| 34 |
+
device using the option "--disable-indev=INDEV".
|
| 35 |
+
|
| 36 |
+
The option "-devices" of the ff* tools will display the list of
|
| 37 |
+
supported input devices.
|
| 38 |
+
|
| 39 |
+
A description of the currently available input devices follows.
|
| 40 |
+
|
| 41 |
+
alsa
|
| 42 |
+
ALSA (Advanced Linux Sound Architecture) input device.
|
| 43 |
+
|
| 44 |
+
To enable this input device during configuration you need libasound
|
| 45 |
+
installed on your system.
|
| 46 |
+
|
| 47 |
+
This device allows capturing from an ALSA device. The name of the
|
| 48 |
+
device to capture has to be an ALSA card identifier.
|
| 49 |
+
|
| 50 |
+
An ALSA identifier has the syntax:
|
| 51 |
+
|
| 52 |
+
hw:<CARD>[,<DEV>[,<SUBDEV>]]
|
| 53 |
+
|
| 54 |
+
where the DEV and SUBDEV components are optional.
|
| 55 |
+
|
| 56 |
+
The three arguments (in order: CARD,DEV,SUBDEV) specify card number or
|
| 57 |
+
identifier, device number and subdevice number (-1 means any).
|
| 58 |
+
|
| 59 |
+
To see the list of cards currently recognized by your system check the
|
| 60 |
+
files /proc/asound/cards and /proc/asound/devices.
|
| 61 |
+
|
| 62 |
+
For example to capture with ffmpeg from an ALSA device with card id 0,
|
| 63 |
+
you may run the command:
|
| 64 |
+
|
| 65 |
+
ffmpeg -f alsa -i hw:0 alsaout.wav
|
| 66 |
+
|
| 67 |
+
For more information see:
|
| 68 |
+
<http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html>
|
| 69 |
+
|
| 70 |
+
Options
|
| 71 |
+
|
| 72 |
+
sample_rate
|
| 73 |
+
Set the sample rate in Hz. Default is 48000.
|
| 74 |
+
|
| 75 |
+
channels
|
| 76 |
+
Set the number of channels. Default is 2.
|
| 77 |
+
|
| 78 |
+
android_camera
|
| 79 |
+
Android camera input device.
|
| 80 |
+
|
| 81 |
+
This input devices uses the Android Camera2 NDK API which is available
|
| 82 |
+
on devices with API level 24+. The availability of android_camera is
|
| 83 |
+
autodetected during configuration.
|
| 84 |
+
|
| 85 |
+
This device allows capturing from all cameras on an Android device,
|
| 86 |
+
which are integrated into the Camera2 NDK API.
|
| 87 |
+
|
| 88 |
+
The available cameras are enumerated internally and can be selected
|
| 89 |
+
with the camera_index parameter. The input file string is discarded.
|
| 90 |
+
|
| 91 |
+
Generally the back facing camera has index 0 while the front facing
|
| 92 |
+
camera has index 1.
|
| 93 |
+
|
| 94 |
+
Options
|
| 95 |
+
|
| 96 |
+
video_size
|
| 97 |
+
Set the video size given as a string such as 640x480 or hd720.
|
| 98 |
+
Falls back to the first available configuration reported by Android
|
| 99 |
+
if requested video size is not available or by default.
|
| 100 |
+
|
| 101 |
+
framerate
|
| 102 |
+
Set the video framerate. Falls back to the first available
|
| 103 |
+
configuration reported by Android if requested framerate is not
|
| 104 |
+
available or by default (-1).
|
| 105 |
+
|
| 106 |
+
camera_index
|
| 107 |
+
Set the index of the camera to use. Default is 0.
|
| 108 |
+
|
| 109 |
+
input_queue_size
|
| 110 |
+
Set the maximum number of frames to buffer. Default is 5.
|
| 111 |
+
|
| 112 |
+
avfoundation
|
| 113 |
+
AVFoundation input device.
|
| 114 |
+
|
| 115 |
+
AVFoundation is the currently recommended framework by Apple for
|
| 116 |
+
streamgrabbing on OSX >= 10.7 as well as on iOS.
|
| 117 |
+
|
| 118 |
+
The input filename has to be given in the following syntax:
|
| 119 |
+
|
| 120 |
+
-i "[[VIDEO]:[AUDIO]]"
|
| 121 |
+
|
| 122 |
+
The first entry selects the video input while the latter selects the
|
| 123 |
+
audio input. The stream has to be specified by the device name or the
|
| 124 |
+
device index as shown by the device list. Alternatively, the video
|
| 125 |
+
and/or audio input device can be chosen by index using the
|
| 126 |
+
|
| 127 |
+
B<-video_device_index E<lt>INDEXE<gt>>
|
| 128 |
+
|
| 129 |
+
and/or
|
| 130 |
+
|
| 131 |
+
B<-audio_device_index E<lt>INDEXE<gt>>
|
| 132 |
+
|
| 133 |
+
, overriding any device name or index given in the input filename.
|
| 134 |
+
|
| 135 |
+
All available devices can be enumerated by using -list_devices true,
|
| 136 |
+
listing all device names and corresponding indices.
|
| 137 |
+
|
| 138 |
+
There are two device name aliases:
|
| 139 |
+
|
| 140 |
+
"default"
|
| 141 |
+
Select the AVFoundation default device of the corresponding type.
|
| 142 |
+
|
| 143 |
+
"none"
|
| 144 |
+
Do not record the corresponding media type. This is equivalent to
|
| 145 |
+
specifying an empty device name or index.
|
| 146 |
+
|
| 147 |
+
Options
|
| 148 |
+
|
| 149 |
+
AVFoundation supports the following options:
|
| 150 |
+
|
| 151 |
+
-list_devices <TRUE|FALSE>
|
| 152 |
+
If set to true, a list of all available input devices is given
|
| 153 |
+
showing all device names and indices.
|
| 154 |
+
|
| 155 |
+
-video_device_index <INDEX>
|
| 156 |
+
Specify the video device by its index. Overrides anything given in
|
| 157 |
+
the input filename.
|
| 158 |
+
|
| 159 |
+
-audio_device_index <INDEX>
|
| 160 |
+
Specify the audio device by its index. Overrides anything given in
|
| 161 |
+
the input filename.
|
| 162 |
+
|
| 163 |
+
-pixel_format <FORMAT>
|
| 164 |
+
Request the video device to use a specific pixel format. If the
|
| 165 |
+
specified format is not supported, a list of available formats is
|
| 166 |
+
given and the first one in this list is used instead. Available
|
| 167 |
+
pixel formats are: "monob, rgb555be, rgb555le, rgb565be, rgb565le,
|
| 168 |
+
rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0,
|
| 169 |
+
bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16,
|
| 170 |
+
yuv422p10, yuv444p10,
|
| 171 |
+
yuv420p, nv12, yuyv422, gray"
|
| 172 |
+
|
| 173 |
+
-framerate
|
| 174 |
+
Set the grabbing frame rate. Default is "ntsc", corresponding to a
|
| 175 |
+
frame rate of "30000/1001".
|
| 176 |
+
|
| 177 |
+
-video_size
|
| 178 |
+
Set the video frame size.
|
| 179 |
+
|
| 180 |
+
-capture_cursor
|
| 181 |
+
Capture the mouse pointer. Default is 0.
|
| 182 |
+
|
| 183 |
+
-capture_mouse_clicks
|
| 184 |
+
Capture the screen mouse clicks. Default is 0.
|
| 185 |
+
|
| 186 |
+
-capture_raw_data
|
| 187 |
+
Capture the raw device data. Default is 0. Using this option may
|
| 188 |
+
result in receiving the underlying data delivered to the
|
| 189 |
+
AVFoundation framework. E.g. for muxed devices that sends raw DV
|
| 190 |
+
data to the framework (like tape-based camcorders), setting this
|
| 191 |
+
option to false results in extracted video frames captured in the
|
| 192 |
+
designated pixel format only. Setting this option to true results
|
| 193 |
+
in receiving the raw DV stream untouched.
|
| 194 |
+
|
| 195 |
+
Examples
|
| 196 |
+
|
| 197 |
+
o Print the list of AVFoundation supported devices and exit:
|
| 198 |
+
|
| 199 |
+
$ ffmpeg -f avfoundation -list_devices true -i ""
|
| 200 |
+
|
| 201 |
+
o Record video from video device 0 and audio from audio device 0 into
|
| 202 |
+
out.avi:
|
| 203 |
+
|
| 204 |
+
$ ffmpeg -f avfoundation -i "0:0" out.avi
|
| 205 |
+
|
| 206 |
+
o Record video from video device 2 and audio from audio device 1 into
|
| 207 |
+
out.avi:
|
| 208 |
+
|
| 209 |
+
$ ffmpeg -f avfoundation -video_device_index 2 -i ":1" out.avi
|
| 210 |
+
|
| 211 |
+
o Record video from the system default video device using the pixel
|
| 212 |
+
format bgr0 and do not record any audio into out.avi:
|
| 213 |
+
|
| 214 |
+
$ ffmpeg -f avfoundation -pixel_format bgr0 -i "default:none" out.avi
|
| 215 |
+
|
| 216 |
+
o Record raw DV data from a suitable input device and write the
|
| 217 |
+
output into out.dv:
|
| 218 |
+
|
| 219 |
+
$ ffmpeg -f avfoundation -capture_raw_data true -i "zr100:none" out.dv
|
| 220 |
+
|
| 221 |
+
bktr
|
| 222 |
+
BSD video input device. Deprecated and will be removed - please contact
|
| 223 |
+
the developers if you are interested in maintaining it.
|
| 224 |
+
|
| 225 |
+
Options
|
| 226 |
+
|
| 227 |
+
framerate
|
| 228 |
+
Set the frame rate.
|
| 229 |
+
|
| 230 |
+
video_size
|
| 231 |
+
Set the video frame size. Default is "vga".
|
| 232 |
+
|
| 233 |
+
standard
|
| 234 |
+
Available values are:
|
| 235 |
+
|
| 236 |
+
pal
|
| 237 |
+
ntsc
|
| 238 |
+
secam
|
| 239 |
+
paln
|
| 240 |
+
palm
|
| 241 |
+
ntscj
|
| 242 |
+
|
| 243 |
+
decklink
|
| 244 |
+
The decklink input device provides capture capabilities for Blackmagic
|
| 245 |
+
DeckLink devices.
|
| 246 |
+
|
| 247 |
+
To enable this input device, you need the Blackmagic DeckLink SDK and
|
| 248 |
+
you need to configure with the appropriate "--extra-cflags" and
|
| 249 |
+
"--extra-ldflags". On Windows, you need to run the IDL files through
|
| 250 |
+
widl.
|
| 251 |
+
|
| 252 |
+
DeckLink is very picky about the formats it supports. Pixel format of
|
| 253 |
+
the input can be set with raw_format. Framerate and video size must be
|
| 254 |
+
determined for your device with -list_formats 1. Audio sample rate is
|
| 255 |
+
always 48 kHz and the number of channels can be 2, 8 or 16. Note that
|
| 256 |
+
all audio channels are bundled in one single audio track.
|
| 257 |
+
|
| 258 |
+
Options
|
| 259 |
+
|
| 260 |
+
list_devices
|
| 261 |
+
If set to true, print a list of devices and exit. Defaults to
|
| 262 |
+
false. This option is deprecated, please use the "-sources" option
|
| 263 |
+
of ffmpeg to list the available input devices.
|
| 264 |
+
|
| 265 |
+
list_formats
|
| 266 |
+
If set to true, print a list of supported formats and exit.
|
| 267 |
+
Defaults to false.
|
| 268 |
+
|
| 269 |
+
format_code <FourCC>
|
| 270 |
+
This sets the input video format to the format given by the FourCC.
|
| 271 |
+
To see the supported values of your device(s) use list_formats.
|
| 272 |
+
Note that there is a FourCC 'pal ' that can also be used as pal (3
|
| 273 |
+
letters). Default behavior is autodetection of the input video
|
| 274 |
+
format, if the hardware supports it.
|
| 275 |
+
|
| 276 |
+
raw_format
|
| 277 |
+
Set the pixel format of the captured video. Available values are:
|
| 278 |
+
|
| 279 |
+
auto
|
| 280 |
+
This is the default which means 8-bit YUV 422 or 8-bit ARGB if
|
| 281 |
+
format autodetection is used, 8-bit YUV 422 otherwise.
|
| 282 |
+
|
| 283 |
+
uyvy422
|
| 284 |
+
8-bit YUV 422.
|
| 285 |
+
|
| 286 |
+
yuv422p10
|
| 287 |
+
10-bit YUV 422.
|
| 288 |
+
|
| 289 |
+
argb
|
| 290 |
+
8-bit RGB.
|
| 291 |
+
|
| 292 |
+
bgra
|
| 293 |
+
8-bit RGB.
|
| 294 |
+
|
| 295 |
+
rgb10
|
| 296 |
+
10-bit RGB.
|
| 297 |
+
|
| 298 |
+
teletext_lines
|
| 299 |
+
If set to nonzero, an additional teletext stream will be captured
|
| 300 |
+
from the vertical ancillary data. Both SD PAL (576i) and HD (1080i
|
| 301 |
+
or 1080p) sources are supported. In case of HD sources, OP47
|
| 302 |
+
packets are decoded.
|
| 303 |
+
|
| 304 |
+
This option is a bitmask of the SD PAL VBI lines captured,
|
| 305 |
+
specifically lines 6 to 22, and lines 318 to 335. Line 6 is the LSB
|
| 306 |
+
in the mask. Selected lines which do not contain teletext
|
| 307 |
+
information will be ignored. You can use the special all constant
|
| 308 |
+
to select all possible lines, or standard to skip lines 6, 318 and
|
| 309 |
+
319, which are not compatible with all receivers.
|
| 310 |
+
|
| 311 |
+
For SD sources, ffmpeg needs to be compiled with
|
| 312 |
+
"--enable-libzvbi". For HD sources, on older (pre-4K) DeckLink card
|
| 313 |
+
models you have to capture in 10 bit mode.
|
| 314 |
+
|
| 315 |
+
channels
|
| 316 |
+
Defines number of audio channels to capture. Must be 2, 8 or 16.
|
| 317 |
+
Defaults to 2.
|
| 318 |
+
|
| 319 |
+
duplex_mode
|
| 320 |
+
Sets the decklink device duplex/profile mode. Must be unset, half,
|
| 321 |
+
full, one_sub_device_full, one_sub_device_half,
|
| 322 |
+
two_sub_device_full, four_sub_device_half Defaults to unset.
|
| 323 |
+
|
| 324 |
+
Note: DeckLink SDK 11.0 have replaced the duplex property by a
|
| 325 |
+
profile property. For the DeckLink Duo 2 and DeckLink Quad 2, a
|
| 326 |
+
profile is shared between any 2 sub-devices that utilize the same
|
| 327 |
+
connectors. For the DeckLink 8K Pro, a profile is shared between
|
| 328 |
+
all 4 sub-devices. So DeckLink 8K Pro support four profiles.
|
| 329 |
+
|
| 330 |
+
Valid profile modes for DeckLink 8K Pro(with DeckLink SDK >= 11.0):
|
| 331 |
+
one_sub_device_full, one_sub_device_half, two_sub_device_full,
|
| 332 |
+
four_sub_device_half
|
| 333 |
+
|
| 334 |
+
Valid profile modes for DeckLink Quad 2 and DeckLink Duo 2: half,
|
| 335 |
+
full
|
| 336 |
+
|
| 337 |
+
timecode_format
|
| 338 |
+
Timecode type to include in the frame and video stream metadata.
|
| 339 |
+
Must be none, rp188vitc, rp188vitc2, rp188ltc, rp188hfr, rp188any,
|
| 340 |
+
vitc, vitc2, or serial. Defaults to none (not included).
|
| 341 |
+
|
| 342 |
+
In order to properly support 50/60 fps timecodes, the ordering of
|
| 343 |
+
the queried timecode types for rp188any is HFR, VITC1, VITC2 and
|
| 344 |
+
LTC for >30 fps content. Note that this is slightly different to
|
| 345 |
+
the ordering used by the DeckLink API, which is HFR, VITC1, LTC,
|
| 346 |
+
VITC2.
|
| 347 |
+
|
| 348 |
+
video_input
|
| 349 |
+
Sets the video input source. Must be unset, sdi, hdmi, optical_sdi,
|
| 350 |
+
component, composite or s_video. Defaults to unset.
|
| 351 |
+
|
| 352 |
+
audio_input
|
| 353 |
+
Sets the audio input source. Must be unset, embedded, aes_ebu,
|
| 354 |
+
analog, analog_xlr, analog_rca or microphone. Defaults to unset.
|
| 355 |
+
|
| 356 |
+
video_pts
|
| 357 |
+
Sets the video packet timestamp source. Must be video, audio,
|
| 358 |
+
reference, wallclock or abs_wallclock. Defaults to video.
|
| 359 |
+
|
| 360 |
+
audio_pts
|
| 361 |
+
Sets the audio packet timestamp source. Must be video, audio,
|
| 362 |
+
reference, wallclock or abs_wallclock. Defaults to audio.
|
| 363 |
+
|
| 364 |
+
draw_bars
|
| 365 |
+
If set to true, color bars are drawn in the event of a signal loss.
|
| 366 |
+
Defaults to true.
|
| 367 |
+
|
| 368 |
+
queue_size
|
| 369 |
+
Sets maximum input buffer size in bytes. If the buffering reaches
|
| 370 |
+
this value, incoming frames will be dropped. Defaults to
|
| 371 |
+
1073741824.
|
| 372 |
+
|
| 373 |
+
audio_depth
|
| 374 |
+
Sets the audio sample bit depth. Must be 16 or 32. Defaults to 16.
|
| 375 |
+
|
| 376 |
+
decklink_copyts
|
| 377 |
+
If set to true, timestamps are forwarded as they are without
|
| 378 |
+
removing the initial offset. Defaults to false.
|
| 379 |
+
|
| 380 |
+
timestamp_align
|
| 381 |
+
Capture start time alignment in seconds. If set to nonzero, input
|
| 382 |
+
frames are dropped till the system timestamp aligns with configured
|
| 383 |
+
value. Alignment difference of up to one frame duration is
|
| 384 |
+
tolerated. This is useful for maintaining input synchronization
|
| 385 |
+
across N different hardware devices deployed for 'N-way'
|
| 386 |
+
redundancy. The system time of different hardware devices should be
|
| 387 |
+
synchronized with protocols such as NTP or PTP, before using this
|
| 388 |
+
option. Note that this method is not foolproof. In some border
|
| 389 |
+
cases input synchronization may not happen due to thread scheduling
|
| 390 |
+
jitters in the OS. Either sync could go wrong by 1 frame or in a
|
| 391 |
+
rarer case timestamp_align seconds. Defaults to 0.
|
| 392 |
+
|
| 393 |
+
wait_for_tc (bool)
|
| 394 |
+
Drop frames till a frame with timecode is received. Sometimes
|
| 395 |
+
serial timecode isn't received with the first input frame. If that
|
| 396 |
+
happens, the stored stream timecode will be inaccurate. If this
|
| 397 |
+
option is set to true, input frames are dropped till a frame with
|
| 398 |
+
timecode is received. Option timecode_format must be specified.
|
| 399 |
+
Defaults to false.
|
| 400 |
+
|
| 401 |
+
enable_klv(bool)
|
| 402 |
+
If set to true, extracts KLV data from VANC and outputs KLV
|
| 403 |
+
packets. KLV VANC packets are joined based on MID and PSC fields
|
| 404 |
+
and aggregated into one KLV packet. Defaults to false.
|
| 405 |
+
|
| 406 |
+
Examples
|
| 407 |
+
|
| 408 |
+
o List input devices:
|
| 409 |
+
|
| 410 |
+
ffmpeg -sources decklink
|
| 411 |
+
|
| 412 |
+
o List supported formats:
|
| 413 |
+
|
| 414 |
+
ffmpeg -f decklink -list_formats 1 -i 'Intensity Pro'
|
| 415 |
+
|
| 416 |
+
o Capture video clip at 1080i50:
|
| 417 |
+
|
| 418 |
+
ffmpeg -format_code Hi50 -f decklink -i 'Intensity Pro' -c:a copy -c:v copy output.avi
|
| 419 |
+
|
| 420 |
+
o Capture video clip at 1080i50 10 bit:
|
| 421 |
+
|
| 422 |
+
ffmpeg -raw_format yuv422p10 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' -c:a copy -c:v copy output.avi
|
| 423 |
+
|
| 424 |
+
o Capture video clip at 1080i50 with 16 audio channels:
|
| 425 |
+
|
| 426 |
+
ffmpeg -channels 16 -format_code Hi50 -f decklink -i 'UltraStudio Mini Recorder' -c:a copy -c:v copy output.avi
|
| 427 |
+
|
| 428 |
+
dshow
|
| 429 |
+
Windows DirectShow input device.
|
| 430 |
+
|
| 431 |
+
DirectShow support is enabled when FFmpeg is built with the mingw-w64
|
| 432 |
+
project. Currently only audio and video devices are supported.
|
| 433 |
+
|
| 434 |
+
Multiple devices may be opened as separate inputs, but they may also be
|
| 435 |
+
opened on the same input, which should improve synchronism between
|
| 436 |
+
them.
|
| 437 |
+
|
| 438 |
+
The input name should be in the format:
|
| 439 |
+
|
| 440 |
+
<TYPE>=<NAME>[:<TYPE>=<NAME>]
|
| 441 |
+
|
| 442 |
+
where TYPE can be either audio or video, and NAME is the device's name
|
| 443 |
+
or alternative name..
|
| 444 |
+
|
| 445 |
+
Options
|
| 446 |
+
|
| 447 |
+
If no options are specified, the device's defaults are used. If the
|
| 448 |
+
device does not support the requested options, it will fail to open.
|
| 449 |
+
|
| 450 |
+
video_size
|
| 451 |
+
Set the video size in the captured video.
|
| 452 |
+
|
| 453 |
+
framerate
|
| 454 |
+
Set the frame rate in the captured video.
|
| 455 |
+
|
| 456 |
+
sample_rate
|
| 457 |
+
Set the sample rate (in Hz) of the captured audio.
|
| 458 |
+
|
| 459 |
+
sample_size
|
| 460 |
+
Set the sample size (in bits) of the captured audio.
|
| 461 |
+
|
| 462 |
+
channels
|
| 463 |
+
Set the number of channels in the captured audio.
|
| 464 |
+
|
| 465 |
+
list_devices
|
| 466 |
+
If set to true, print a list of devices and exit.
|
| 467 |
+
|
| 468 |
+
list_options
|
| 469 |
+
If set to true, print a list of selected device's options and exit.
|
| 470 |
+
|
| 471 |
+
video_device_number
|
| 472 |
+
Set video device number for devices with the same name (starts at
|
| 473 |
+
0, defaults to 0).
|
| 474 |
+
|
| 475 |
+
audio_device_number
|
| 476 |
+
Set audio device number for devices with the same name (starts at
|
| 477 |
+
0, defaults to 0).
|
| 478 |
+
|
| 479 |
+
pixel_format
|
| 480 |
+
Select pixel format to be used by DirectShow. This may only be set
|
| 481 |
+
when the video codec is not set or set to rawvideo.
|
| 482 |
+
|
| 483 |
+
audio_buffer_size
|
| 484 |
+
Set audio device buffer size in milliseconds (which can directly
|
| 485 |
+
impact latency, depending on the device). Defaults to using the
|
| 486 |
+
audio device's default buffer size (typically some multiple of
|
| 487 |
+
500ms). Setting this value too low can degrade performance. See
|
| 488 |
+
also
|
| 489 |
+
<http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx>
|
| 490 |
+
|
| 491 |
+
video_pin_name
|
| 492 |
+
Select video capture pin to use by name or alternative name.
|
| 493 |
+
|
| 494 |
+
audio_pin_name
|
| 495 |
+
Select audio capture pin to use by name or alternative name.
|
| 496 |
+
|
| 497 |
+
crossbar_video_input_pin_number
|
| 498 |
+
Select video input pin number for crossbar device. This will be
|
| 499 |
+
routed to the crossbar device's Video Decoder output pin. Note
|
| 500 |
+
that changing this value can affect future invocations (sets a new
|
| 501 |
+
default) until system reboot occurs.
|
| 502 |
+
|
| 503 |
+
crossbar_audio_input_pin_number
|
| 504 |
+
Select audio input pin number for crossbar device. This will be
|
| 505 |
+
routed to the crossbar device's Audio Decoder output pin. Note
|
| 506 |
+
that changing this value can affect future invocations (sets a new
|
| 507 |
+
default) until system reboot occurs.
|
| 508 |
+
|
| 509 |
+
show_video_device_dialog
|
| 510 |
+
If set to true, before capture starts, popup a display dialog to
|
| 511 |
+
the end user, allowing them to change video filter properties and
|
| 512 |
+
configurations manually. Note that for crossbar devices, adjusting
|
| 513 |
+
values in this dialog may be needed at times to toggle between PAL
|
| 514 |
+
(25 fps) and NTSC (29.97) input frame rates, sizes, interlacing,
|
| 515 |
+
etc. Changing these values can enable different scan rates/frame
|
| 516 |
+
rates and avoiding green bars at the bottom, flickering scan lines,
|
| 517 |
+
etc. Note that with some devices, changing these properties can
|
| 518 |
+
also affect future invocations (sets new defaults) until system
|
| 519 |
+
reboot occurs.
|
| 520 |
+
|
| 521 |
+
show_audio_device_dialog
|
| 522 |
+
If set to true, before capture starts, popup a display dialog to
|
| 523 |
+
the end user, allowing them to change audio filter properties and
|
| 524 |
+
configurations manually.
|
| 525 |
+
|
| 526 |
+
show_video_crossbar_connection_dialog
|
| 527 |
+
If set to true, before capture starts, popup a display dialog to
|
| 528 |
+
the end user, allowing them to manually modify crossbar pin
|
| 529 |
+
routings, when it opens a video device.
|
| 530 |
+
|
| 531 |
+
show_audio_crossbar_connection_dialog
|
| 532 |
+
If set to true, before capture starts, popup a display dialog to
|
| 533 |
+
the end user, allowing them to manually modify crossbar pin
|
| 534 |
+
routings, when it opens an audio device.
|
| 535 |
+
|
| 536 |
+
show_analog_tv_tuner_dialog
|
| 537 |
+
If set to true, before capture starts, popup a display dialog to
|
| 538 |
+
the end user, allowing them to manually modify TV channels and
|
| 539 |
+
frequencies.
|
| 540 |
+
|
| 541 |
+
show_analog_tv_tuner_audio_dialog
|
| 542 |
+
If set to true, before capture starts, popup a display dialog to
|
| 543 |
+
the end user, allowing them to manually modify TV audio (like mono
|
| 544 |
+
vs. stereo, Language A,B or C).
|
| 545 |
+
|
| 546 |
+
audio_device_load
|
| 547 |
+
Load an audio capture filter device from file instead of searching
|
| 548 |
+
it by name. It may load additional parameters too, if the filter
|
| 549 |
+
supports the serialization of its properties to. To use this an
|
| 550 |
+
audio capture source has to be specified, but it can be anything
|
| 551 |
+
even fake one.
|
| 552 |
+
|
| 553 |
+
audio_device_save
|
| 554 |
+
Save the currently used audio capture filter device and its
|
| 555 |
+
parameters (if the filter supports it) to a file. If a file with
|
| 556 |
+
the same name exists it will be overwritten.
|
| 557 |
+
|
| 558 |
+
video_device_load
|
| 559 |
+
Load a video capture filter device from file instead of searching
|
| 560 |
+
it by name. It may load additional parameters too, if the filter
|
| 561 |
+
supports the serialization of its properties to. To use this a
|
| 562 |
+
video capture source has to be specified, but it can be anything
|
| 563 |
+
even fake one.
|
| 564 |
+
|
| 565 |
+
video_device_save
|
| 566 |
+
Save the currently used video capture filter device and its
|
| 567 |
+
parameters (if the filter supports it) to a file. If a file with
|
| 568 |
+
the same name exists it will be overwritten.
|
| 569 |
+
|
| 570 |
+
use_video_device_timestamps
|
| 571 |
+
If set to false, the timestamp for video frames will be derived
|
| 572 |
+
from the wallclock instead of the timestamp provided by the capture
|
| 573 |
+
device. This allows working around devices that provide unreliable
|
| 574 |
+
timestamps.
|
| 575 |
+
|
| 576 |
+
Examples
|
| 577 |
+
|
| 578 |
+
o Print the list of DirectShow supported devices and exit:
|
| 579 |
+
|
| 580 |
+
$ ffmpeg -list_devices true -f dshow -i dummy
|
| 581 |
+
|
| 582 |
+
o Open video device Camera:
|
| 583 |
+
|
| 584 |
+
$ ffmpeg -f dshow -i video="Camera"
|
| 585 |
+
|
| 586 |
+
o Open second video device with name Camera:
|
| 587 |
+
|
| 588 |
+
$ ffmpeg -f dshow -video_device_number 1 -i video="Camera"
|
| 589 |
+
|
| 590 |
+
o Open video device Camera and audio device Microphone:
|
| 591 |
+
|
| 592 |
+
$ ffmpeg -f dshow -i video="Camera":audio="Microphone"
|
| 593 |
+
|
| 594 |
+
o Print the list of supported options in selected device and exit:
|
| 595 |
+
|
| 596 |
+
$ ffmpeg -list_options true -f dshow -i video="Camera"
|
| 597 |
+
|
| 598 |
+
o Specify pin names to capture by name or alternative name, specify
|
| 599 |
+
alternative device name:
|
| 600 |
+
|
| 601 |
+
$ ffmpeg -f dshow -audio_pin_name "Audio Out" -video_pin_name 2 -i video=video="@device_pnp_\\?\pci#ven_1a0a&dev_6200&subsys_62021461&rev_01#4&e2c7dd6&0&00e1#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{ca465100-deb0-4d59-818f-8c477184adf6}":audio="Microphone"
|
| 602 |
+
|
| 603 |
+
o Configure a crossbar device, specifying crossbar pins, allow user
|
| 604 |
+
to adjust video capture properties at startup:
|
| 605 |
+
|
| 606 |
+
$ ffmpeg -f dshow -show_video_device_dialog true -crossbar_video_input_pin_number 0
|
| 607 |
+
-crossbar_audio_input_pin_number 3 -i video="AVerMedia BDA Analog Capture":audio="AVerMedia BDA Analog Capture"
|
| 608 |
+
|
| 609 |
+
fbdev
|
| 610 |
+
Linux framebuffer input device.
|
| 611 |
+
|
| 612 |
+
The Linux framebuffer is a graphic hardware-independent abstraction
|
| 613 |
+
layer to show graphics on a computer monitor, typically on the console.
|
| 614 |
+
It is accessed through a file device node, usually /dev/fb0.
|
| 615 |
+
|
| 616 |
+
For more detailed information read the file
|
| 617 |
+
Documentation/fb/framebuffer.txt included in the Linux source tree.
|
| 618 |
+
|
| 619 |
+
See also <http://linux-fbdev.sourceforge.net/>, and fbset(1).
|
| 620 |
+
|
| 621 |
+
To record from the framebuffer device /dev/fb0 with ffmpeg:
|
| 622 |
+
|
| 623 |
+
ffmpeg -f fbdev -framerate 10 -i /dev/fb0 out.avi
|
| 624 |
+
|
| 625 |
+
You can take a single screenshot image with the command:
|
| 626 |
+
|
| 627 |
+
ffmpeg -f fbdev -framerate 1 -i /dev/fb0 -frames:v 1 screenshot.jpeg
|
| 628 |
+
|
| 629 |
+
Options
|
| 630 |
+
|
| 631 |
+
framerate
|
| 632 |
+
Set the frame rate. Default is 25.
|
| 633 |
+
|
| 634 |
+
gdigrab
|
| 635 |
+
Win32 GDI-based screen capture device.
|
| 636 |
+
|
| 637 |
+
This device allows you to capture a region of the display on Windows.
|
| 638 |
+
|
| 639 |
+
Amongst options for the imput filenames are such elements as:
|
| 640 |
+
|
| 641 |
+
desktop
|
| 642 |
+
|
| 643 |
+
or
|
| 644 |
+
|
| 645 |
+
title=<window_title>
|
| 646 |
+
|
| 647 |
+
or
|
| 648 |
+
|
| 649 |
+
hwnd=<window_hwnd>
|
| 650 |
+
|
| 651 |
+
The first option will capture the entire desktop, or a fixed region of
|
| 652 |
+
the desktop. The second and third options will instead capture the
|
| 653 |
+
contents of a single window, regardless of its position on the screen.
|
| 654 |
+
|
| 655 |
+
For example, to grab the entire desktop using ffmpeg:
|
| 656 |
+
|
| 657 |
+
ffmpeg -f gdigrab -framerate 6 -i desktop out.mpg
|
| 658 |
+
|
| 659 |
+
Grab a 640x480 region at position "10,20":
|
| 660 |
+
|
| 661 |
+
ffmpeg -f gdigrab -framerate 6 -offset_x 10 -offset_y 20 -video_size vga -i desktop out.mpg
|
| 662 |
+
|
| 663 |
+
Grab the contents of the window named "Calculator"
|
| 664 |
+
|
| 665 |
+
ffmpeg -f gdigrab -framerate 6 -i title=Calculator out.mpg
|
| 666 |
+
|
| 667 |
+
Options
|
| 668 |
+
|
| 669 |
+
draw_mouse
|
| 670 |
+
Specify whether to draw the mouse pointer. Use the value 0 to not
|
| 671 |
+
draw the pointer. Default value is 1.
|
| 672 |
+
|
| 673 |
+
framerate
|
| 674 |
+
Set the grabbing frame rate. Default value is "ntsc", corresponding
|
| 675 |
+
to a frame rate of "30000/1001".
|
| 676 |
+
|
| 677 |
+
show_region
|
| 678 |
+
Show grabbed region on screen.
|
| 679 |
+
|
| 680 |
+
If show_region is specified with 1, then the grabbing region will
|
| 681 |
+
be indicated on screen. With this option, it is easy to know what
|
| 682 |
+
is being grabbed if only a portion of the screen is grabbed.
|
| 683 |
+
|
| 684 |
+
Note that show_region is incompatible with grabbing the contents of
|
| 685 |
+
a single window.
|
| 686 |
+
|
| 687 |
+
For example:
|
| 688 |
+
|
| 689 |
+
ffmpeg -f gdigrab -show_region 1 -framerate 6 -video_size cif -offset_x 10 -offset_y 20 -i desktop out.mpg
|
| 690 |
+
|
| 691 |
+
video_size
|
| 692 |
+
Set the video frame size. The default is to capture the full screen
|
| 693 |
+
if desktop is selected, or the full window size if
|
| 694 |
+
title=window_title is selected.
|
| 695 |
+
|
| 696 |
+
offset_x
|
| 697 |
+
When capturing a region with video_size, set the distance from the
|
| 698 |
+
left edge of the screen or desktop.
|
| 699 |
+
|
| 700 |
+
Note that the offset calculation is from the top left corner of the
|
| 701 |
+
primary monitor on Windows. If you have a monitor positioned to the
|
| 702 |
+
left of your primary monitor, you will need to use a negative
|
| 703 |
+
offset_x value to move the region to that monitor.
|
| 704 |
+
|
| 705 |
+
offset_y
|
| 706 |
+
When capturing a region with video_size, set the distance from the
|
| 707 |
+
top edge of the screen or desktop.
|
| 708 |
+
|
| 709 |
+
Note that the offset calculation is from the top left corner of the
|
| 710 |
+
primary monitor on Windows. If you have a monitor positioned above
|
| 711 |
+
your primary monitor, you will need to use a negative offset_y
|
| 712 |
+
value to move the region to that monitor.
|
| 713 |
+
|
| 714 |
+
iec61883
|
| 715 |
+
FireWire DV/HDV input device using libiec61883.
|
| 716 |
+
|
| 717 |
+
To enable this input device, you need libiec61883, libraw1394 and
|
| 718 |
+
libavc1394 installed on your system. Use the configure option
|
| 719 |
+
"--enable-libiec61883" to compile with the device enabled.
|
| 720 |
+
|
| 721 |
+
The iec61883 capture device supports capturing from a video device
|
| 722 |
+
connected via IEEE1394 (FireWire), using libiec61883 and the new Linux
|
| 723 |
+
FireWire stack (juju). This is the default DV/HDV input method in Linux
|
| 724 |
+
Kernel 2.6.37 and later, since the old FireWire stack was removed.
|
| 725 |
+
|
| 726 |
+
Specify the FireWire port to be used as input file, or "auto" to choose
|
| 727 |
+
the first port connected.
|
| 728 |
+
|
| 729 |
+
Options
|
| 730 |
+
|
| 731 |
+
dvtype
|
| 732 |
+
Override autodetection of DV/HDV. This should only be used if auto
|
| 733 |
+
detection does not work, or if usage of a different device type
|
| 734 |
+
should be prohibited. Treating a DV device as HDV (or vice versa)
|
| 735 |
+
will not work and result in undefined behavior. The values auto,
|
| 736 |
+
dv and hdv are supported.
|
| 737 |
+
|
| 738 |
+
dvbuffer
|
| 739 |
+
Set maximum size of buffer for incoming data, in frames. For DV,
|
| 740 |
+
this is an exact value. For HDV, it is not frame exact, since HDV
|
| 741 |
+
does not have a fixed frame size.
|
| 742 |
+
|
| 743 |
+
dvguid
|
| 744 |
+
Select the capture device by specifying its GUID. Capturing will
|
| 745 |
+
only be performed from the specified device and fails if no device
|
| 746 |
+
with the given GUID is found. This is useful to select the input if
|
| 747 |
+
multiple devices are connected at the same time. Look at
|
| 748 |
+
/sys/bus/firewire/devices to find out the GUIDs.
|
| 749 |
+
|
| 750 |
+
Examples
|
| 751 |
+
|
| 752 |
+
o Grab and show the input of a FireWire DV/HDV device.
|
| 753 |
+
|
| 754 |
+
ffplay -f iec61883 -i auto
|
| 755 |
+
|
| 756 |
+
o Grab and record the input of a FireWire DV/HDV device, using a
|
| 757 |
+
packet buffer of 100000 packets if the source is HDV.
|
| 758 |
+
|
| 759 |
+
ffmpeg -f iec61883 -i auto -dvbuffer 100000 out.mpg
|
| 760 |
+
|
| 761 |
+
jack
|
| 762 |
+
JACK input device.
|
| 763 |
+
|
| 764 |
+
To enable this input device during configuration you need libjack
|
| 765 |
+
installed on your system.
|
| 766 |
+
|
| 767 |
+
A JACK input device creates one or more JACK writable clients, one for
|
| 768 |
+
each audio channel, with name client_name:input_N, where client_name is
|
| 769 |
+
the name provided by the application, and N is a number which
|
| 770 |
+
identifies the channel. Each writable client will send the acquired
|
| 771 |
+
data to the FFmpeg input device.
|
| 772 |
+
|
| 773 |
+
Once you have created one or more JACK readable clients, you need to
|
| 774 |
+
connect them to one or more JACK writable clients.
|
| 775 |
+
|
| 776 |
+
To connect or disconnect JACK clients you can use the jack_connect and
|
| 777 |
+
jack_disconnect programs, or do it through a graphical interface, for
|
| 778 |
+
example with qjackctl.
|
| 779 |
+
|
| 780 |
+
To list the JACK clients and their properties you can invoke the
|
| 781 |
+
command jack_lsp.
|
| 782 |
+
|
| 783 |
+
Follows an example which shows how to capture a JACK readable client
|
| 784 |
+
with ffmpeg.
|
| 785 |
+
|
| 786 |
+
# Create a JACK writable client with name "ffmpeg".
|
| 787 |
+
$ ffmpeg -f jack -i ffmpeg -y out.wav
|
| 788 |
+
|
| 789 |
+
# Start the sample jack_metro readable client.
|
| 790 |
+
$ jack_metro -b 120 -d 0.2 -f 4000
|
| 791 |
+
|
| 792 |
+
# List the current JACK clients.
|
| 793 |
+
$ jack_lsp -c
|
| 794 |
+
system:capture_1
|
| 795 |
+
system:capture_2
|
| 796 |
+
system:playback_1
|
| 797 |
+
system:playback_2
|
| 798 |
+
ffmpeg:input_1
|
| 799 |
+
metro:120_bpm
|
| 800 |
+
|
| 801 |
+
# Connect metro to the ffmpeg writable client.
|
| 802 |
+
$ jack_connect metro:120_bpm ffmpeg:input_1
|
| 803 |
+
|
| 804 |
+
For more information read: <http://jackaudio.org/>
|
| 805 |
+
|
| 806 |
+
Options
|
| 807 |
+
|
| 808 |
+
channels
|
| 809 |
+
Set the number of channels. Default is 2.
|
| 810 |
+
|
| 811 |
+
kmsgrab
|
| 812 |
+
KMS video input device.
|
| 813 |
+
|
| 814 |
+
Captures the KMS scanout framebuffer associated with a specified CRTC
|
| 815 |
+
or plane as a DRM object that can be passed to other hardware
|
| 816 |
+
functions.
|
| 817 |
+
|
| 818 |
+
Requires either DRM master or CAP_SYS_ADMIN to run.
|
| 819 |
+
|
| 820 |
+
If you don't understand what all of that means, you probably don't want
|
| 821 |
+
this. Look at x11grab instead.
|
| 822 |
+
|
| 823 |
+
Options
|
| 824 |
+
|
| 825 |
+
device
|
| 826 |
+
DRM device to capture on. Defaults to /dev/dri/card0.
|
| 827 |
+
|
| 828 |
+
format
|
| 829 |
+
Pixel format of the framebuffer. This can be autodetected if you
|
| 830 |
+
are running Linux 5.7 or later, but needs to be provided for
|
| 831 |
+
earlier versions. Defaults to bgr0, which is the most common
|
| 832 |
+
format used by the Linux console and Xorg X server.
|
| 833 |
+
|
| 834 |
+
format_modifier
|
| 835 |
+
Format modifier to signal on output frames. This is necessary to
|
| 836 |
+
import correctly into some APIs. It can be autodetected if you are
|
| 837 |
+
running Linux 5.7 or later, but will need to be provided explicitly
|
| 838 |
+
when needed in earlier versions. See the libdrm documentation for
|
| 839 |
+
possible values.
|
| 840 |
+
|
| 841 |
+
crtc_id
|
| 842 |
+
KMS CRTC ID to define the capture source. The first active plane
|
| 843 |
+
on the given CRTC will be used.
|
| 844 |
+
|
| 845 |
+
plane_id
|
| 846 |
+
KMS plane ID to define the capture source. Defaults to the first
|
| 847 |
+
active plane found if neither crtc_id nor plane_id are specified.
|
| 848 |
+
|
| 849 |
+
framerate
|
| 850 |
+
Framerate to capture at. This is not synchronised to any page
|
| 851 |
+
flipping or framebuffer changes - it just defines the interval at
|
| 852 |
+
which the framebuffer is sampled. Sampling faster than the
|
| 853 |
+
framebuffer update rate will generate independent frames with the
|
| 854 |
+
same content. Defaults to 30.
|
| 855 |
+
|
| 856 |
+
Examples
|
| 857 |
+
|
| 858 |
+
o Capture from the first active plane, download the result to normal
|
| 859 |
+
frames and encode. This will only work if the framebuffer is both
|
| 860 |
+
linear and mappable - if not, the result may be scrambled or fail
|
| 861 |
+
to download.
|
| 862 |
+
|
| 863 |
+
ffmpeg -f kmsgrab -i - -vf 'hwdownload,format=bgr0' output.mp4
|
| 864 |
+
|
| 865 |
+
o Capture from CRTC ID 42 at 60fps, map the result to VAAPI, convert
|
| 866 |
+
to NV12 and encode as H.264.
|
| 867 |
+
|
| 868 |
+
ffmpeg -crtc_id 42 -framerate 60 -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,scale_vaapi=w=1920:h=1080:format=nv12' -c:v h264_vaapi output.mp4
|
| 869 |
+
|
| 870 |
+
o To capture only part of a plane the output can be cropped - this
|
| 871 |
+
can be used to capture a single window, as long as it has a known
|
| 872 |
+
absolute position and size. For example, to capture and encode the
|
| 873 |
+
middle quarter of a 1920x1080 plane:
|
| 874 |
+
|
| 875 |
+
ffmpeg -f kmsgrab -i - -vf 'hwmap=derive_device=vaapi,crop=960:540:480:270,scale_vaapi=960:540:nv12' -c:v h264_vaapi output.mp4
|
| 876 |
+
|
| 877 |
+
lavfi
|
| 878 |
+
Libavfilter input virtual device.
|
| 879 |
+
|
| 880 |
+
This input device reads data from the open output pads of a libavfilter
|
| 881 |
+
filtergraph.
|
| 882 |
+
|
| 883 |
+
For each filtergraph open output, the input device will create a
|
| 884 |
+
corresponding stream which is mapped to the generated output. The
|
| 885 |
+
filtergraph is specified through the option graph.
|
| 886 |
+
|
| 887 |
+
Options
|
| 888 |
+
|
| 889 |
+
graph
|
| 890 |
+
Specify the filtergraph to use as input. Each video open output
|
| 891 |
+
must be labelled by a unique string of the form "outN", where N is
|
| 892 |
+
a number starting from 0 corresponding to the mapped input stream
|
| 893 |
+
generated by the device. The first unlabelled output is
|
| 894 |
+
automatically assigned to the "out0" label, but all the others need
|
| 895 |
+
to be specified explicitly.
|
| 896 |
+
|
| 897 |
+
The suffix "+subcc" can be appended to the output label to create
|
| 898 |
+
an extra stream with the closed captions packets attached to that
|
| 899 |
+
output (experimental; only for EIA-608 / CEA-708 for now). The
|
| 900 |
+
subcc streams are created after all the normal streams, in the
|
| 901 |
+
order of the corresponding stream. For example, if there is
|
| 902 |
+
"out19+subcc", "out7+subcc" and up to "out42", the stream #43 is
|
| 903 |
+
subcc for stream #7 and stream #44 is subcc for stream #19.
|
| 904 |
+
|
| 905 |
+
If not specified defaults to the filename specified for the input
|
| 906 |
+
device.
|
| 907 |
+
|
| 908 |
+
graph_file
|
| 909 |
+
Set the filename of the filtergraph to be read and sent to the
|
| 910 |
+
other filters. Syntax of the filtergraph is the same as the one
|
| 911 |
+
specified by the option graph.
|
| 912 |
+
|
| 913 |
+
dumpgraph
|
| 914 |
+
Dump graph to stderr.
|
| 915 |
+
|
| 916 |
+
Examples
|
| 917 |
+
|
| 918 |
+
o Create a color video stream and play it back with ffplay:
|
| 919 |
+
|
| 920 |
+
ffplay -f lavfi -graph "color=c=pink [out0]" dummy
|
| 921 |
+
|
| 922 |
+
o As the previous example, but use filename for specifying the graph
|
| 923 |
+
description, and omit the "out0" label:
|
| 924 |
+
|
| 925 |
+
ffplay -f lavfi color=c=pink
|
| 926 |
+
|
| 927 |
+
o Create three different video test filtered sources and play them:
|
| 928 |
+
|
| 929 |
+
ffplay -f lavfi -graph "testsrc [out0]; testsrc,hflip [out1]; testsrc,negate [out2]" test3
|
| 930 |
+
|
| 931 |
+
o Read an audio stream from a file using the amovie source and play
|
| 932 |
+
it back with ffplay:
|
| 933 |
+
|
| 934 |
+
ffplay -f lavfi "amovie=test.wav"
|
| 935 |
+
|
| 936 |
+
o Read an audio stream and a video stream and play it back with
|
| 937 |
+
ffplay:
|
| 938 |
+
|
| 939 |
+
ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
|
| 940 |
+
|
| 941 |
+
o Dump decoded frames to images and closed captions to a file
|
| 942 |
+
(experimental):
|
| 943 |
+
|
| 944 |
+
ffmpeg -f lavfi -i "movie=test.ts[out0+subcc]" -map v frame%08d.png -map s -c copy -f rawvideo subcc.bin
|
| 945 |
+
|
| 946 |
+
libcdio
|
| 947 |
+
Audio-CD input device based on libcdio.
|
| 948 |
+
|
| 949 |
+
To enable this input device during configuration you need libcdio
|
| 950 |
+
installed on your system. It requires the configure option
|
| 951 |
+
"--enable-libcdio".
|
| 952 |
+
|
| 953 |
+
This device allows playing and grabbing from an Audio-CD.
|
| 954 |
+
|
| 955 |
+
For example to copy with ffmpeg the entire Audio-CD in /dev/sr0, you
|
| 956 |
+
may run the command:
|
| 957 |
+
|
| 958 |
+
ffmpeg -f libcdio -i /dev/sr0 cd.wav
|
| 959 |
+
|
| 960 |
+
Options
|
| 961 |
+
|
| 962 |
+
speed
|
| 963 |
+
Set drive reading speed. Default value is 0.
|
| 964 |
+
|
| 965 |
+
The speed is specified CD-ROM speed units. The speed is set through
|
| 966 |
+
the libcdio "cdio_cddap_speed_set" function. On many CD-ROM drives,
|
| 967 |
+
specifying a value too large will result in using the fastest
|
| 968 |
+
speed.
|
| 969 |
+
|
| 970 |
+
paranoia_mode
|
| 971 |
+
Set paranoia recovery mode flags. It accepts one of the following
|
| 972 |
+
values:
|
| 973 |
+
|
| 974 |
+
disable
|
| 975 |
+
verify
|
| 976 |
+
overlap
|
| 977 |
+
neverskip
|
| 978 |
+
full
|
| 979 |
+
|
| 980 |
+
Default value is disable.
|
| 981 |
+
|
| 982 |
+
For more information about the available recovery modes, consult
|
| 983 |
+
the paranoia project documentation.
|
| 984 |
+
|
| 985 |
+
libdc1394
|
| 986 |
+
IIDC1394 input device, based on libdc1394 and libraw1394.
|
| 987 |
+
|
| 988 |
+
Requires the configure option "--enable-libdc1394".
|
| 989 |
+
|
| 990 |
+
Options
|
| 991 |
+
|
| 992 |
+
framerate
|
| 993 |
+
Set the frame rate. Default is "ntsc", corresponding to a frame
|
| 994 |
+
rate of "30000/1001".
|
| 995 |
+
|
| 996 |
+
pixel_format
|
| 997 |
+
Select the pixel format. Default is "uyvy422".
|
| 998 |
+
|
| 999 |
+
video_size
|
| 1000 |
+
Set the video size given as a string such as "640x480" or "hd720".
|
| 1001 |
+
Default is "qvga".
|
| 1002 |
+
|
| 1003 |
+
openal
|
| 1004 |
+
The OpenAL input device provides audio capture on all systems with a
|
| 1005 |
+
working OpenAL 1.1 implementation.
|
| 1006 |
+
|
| 1007 |
+
To enable this input device during configuration, you need OpenAL
|
| 1008 |
+
headers and libraries installed on your system, and need to configure
|
| 1009 |
+
FFmpeg with "--enable-openal".
|
| 1010 |
+
|
| 1011 |
+
OpenAL headers and libraries should be provided as part of your OpenAL
|
| 1012 |
+
implementation, or as an additional download (an SDK). Depending on
|
| 1013 |
+
your installation you may need to specify additional flags via the
|
| 1014 |
+
"--extra-cflags" and "--extra-ldflags" for allowing the build system to
|
| 1015 |
+
locate the OpenAL headers and libraries.
|
| 1016 |
+
|
| 1017 |
+
An incomplete list of OpenAL implementations follows:
|
| 1018 |
+
|
| 1019 |
+
Creative
|
| 1020 |
+
The official Windows implementation, providing hardware
|
| 1021 |
+
acceleration with supported devices and software fallback. See
|
| 1022 |
+
<http://openal.org/>.
|
| 1023 |
+
|
| 1024 |
+
OpenAL Soft
|
| 1025 |
+
Portable, open source (LGPL) software implementation. Includes
|
| 1026 |
+
backends for the most common sound APIs on the Windows, Linux,
|
| 1027 |
+
Solaris, and BSD operating systems. See
|
| 1028 |
+
<http://kcat.strangesoft.net/openal.html>.
|
| 1029 |
+
|
| 1030 |
+
Apple
|
| 1031 |
+
OpenAL is part of Core Audio, the official Mac OS X Audio
|
| 1032 |
+
interface. See
|
| 1033 |
+
<http://developer.apple.com/technologies/mac/audio-and-video.html>
|
| 1034 |
+
|
| 1035 |
+
This device allows one to capture from an audio input device handled
|
| 1036 |
+
through OpenAL.
|
| 1037 |
+
|
| 1038 |
+
You need to specify the name of the device to capture in the provided
|
| 1039 |
+
filename. If the empty string is provided, the device will
|
| 1040 |
+
automatically select the default device. You can get the list of the
|
| 1041 |
+
supported devices by using the option list_devices.
|
| 1042 |
+
|
| 1043 |
+
Options
|
| 1044 |
+
|
| 1045 |
+
channels
|
| 1046 |
+
Set the number of channels in the captured audio. Only the values 1
|
| 1047 |
+
(monaural) and 2 (stereo) are currently supported. Defaults to 2.
|
| 1048 |
+
|
| 1049 |
+
sample_size
|
| 1050 |
+
Set the sample size (in bits) of the captured audio. Only the
|
| 1051 |
+
values 8 and 16 are currently supported. Defaults to 16.
|
| 1052 |
+
|
| 1053 |
+
sample_rate
|
| 1054 |
+
Set the sample rate (in Hz) of the captured audio. Defaults to
|
| 1055 |
+
44.1k.
|
| 1056 |
+
|
| 1057 |
+
list_devices
|
| 1058 |
+
If set to true, print a list of devices and exit. Defaults to
|
| 1059 |
+
false.
|
| 1060 |
+
|
| 1061 |
+
Examples
|
| 1062 |
+
|
| 1063 |
+
Print the list of OpenAL supported devices and exit:
|
| 1064 |
+
|
| 1065 |
+
$ ffmpeg -list_devices true -f openal -i dummy out.ogg
|
| 1066 |
+
|
| 1067 |
+
Capture from the OpenAL device DR-BT101 via PulseAudio:
|
| 1068 |
+
|
| 1069 |
+
$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out.ogg
|
| 1070 |
+
|
| 1071 |
+
Capture from the default device (note the empty string '' as filename):
|
| 1072 |
+
|
| 1073 |
+
$ ffmpeg -f openal -i '' out.ogg
|
| 1074 |
+
|
| 1075 |
+
Capture from two devices simultaneously, writing to two different
|
| 1076 |
+
files, within the same ffmpeg command:
|
| 1077 |
+
|
| 1078 |
+
$ ffmpeg -f openal -i 'DR-BT101 via PulseAudio' out1.ogg -f openal -i 'ALSA Default' out2.ogg
|
| 1079 |
+
|
| 1080 |
+
Note: not all OpenAL implementations support multiple simultaneous
|
| 1081 |
+
capture - try the latest OpenAL Soft if the above does not work.
|
| 1082 |
+
|
| 1083 |
+
oss
|
| 1084 |
+
Open Sound System input device.
|
| 1085 |
+
|
| 1086 |
+
The filename to provide to the input device is the device node
|
| 1087 |
+
representing the OSS input device, and is usually set to /dev/dsp.
|
| 1088 |
+
|
| 1089 |
+
For example to grab from /dev/dsp using ffmpeg use the command:
|
| 1090 |
+
|
| 1091 |
+
ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
|
| 1092 |
+
|
| 1093 |
+
For more information about OSS see:
|
| 1094 |
+
<http://manuals.opensound.com/usersguide/dsp.html>
|
| 1095 |
+
|
| 1096 |
+
Options
|
| 1097 |
+
|
| 1098 |
+
sample_rate
|
| 1099 |
+
Set the sample rate in Hz. Default is 48000.
|
| 1100 |
+
|
| 1101 |
+
channels
|
| 1102 |
+
Set the number of channels. Default is 2.
|
| 1103 |
+
|
| 1104 |
+
pulse
|
| 1105 |
+
PulseAudio input device.
|
| 1106 |
+
|
| 1107 |
+
To enable this output device you need to configure FFmpeg with
|
| 1108 |
+
"--enable-libpulse".
|
| 1109 |
+
|
| 1110 |
+
The filename to provide to the input device is a source device or the
|
| 1111 |
+
string "default"
|
| 1112 |
+
|
| 1113 |
+
To list the PulseAudio source devices and their properties you can
|
| 1114 |
+
invoke the command pactl list sources.
|
| 1115 |
+
|
| 1116 |
+
More information about PulseAudio can be found on
|
| 1117 |
+
<http://www.pulseaudio.org>.
|
| 1118 |
+
|
| 1119 |
+
Options
|
| 1120 |
+
|
| 1121 |
+
server
|
| 1122 |
+
Connect to a specific PulseAudio server, specified by an IP
|
| 1123 |
+
address. Default server is used when not provided.
|
| 1124 |
+
|
| 1125 |
+
name
|
| 1126 |
+
Specify the application name PulseAudio will use when showing
|
| 1127 |
+
active clients, by default it is the "LIBAVFORMAT_IDENT" string.
|
| 1128 |
+
|
| 1129 |
+
stream_name
|
| 1130 |
+
Specify the stream name PulseAudio will use when showing active
|
| 1131 |
+
streams, by default it is "record".
|
| 1132 |
+
|
| 1133 |
+
sample_rate
|
| 1134 |
+
Specify the samplerate in Hz, by default 48kHz is used.
|
| 1135 |
+
|
| 1136 |
+
channels
|
| 1137 |
+
Specify the channels in use, by default 2 (stereo) is set.
|
| 1138 |
+
|
| 1139 |
+
frame_size
|
| 1140 |
+
This option does nothing and is deprecated.
|
| 1141 |
+
|
| 1142 |
+
fragment_size
|
| 1143 |
+
Specify the size in bytes of the minimal buffering fragment in
|
| 1144 |
+
PulseAudio, it will affect the audio latency. By default it is set
|
| 1145 |
+
to 50 ms amount of data.
|
| 1146 |
+
|
| 1147 |
+
wallclock
|
| 1148 |
+
Set the initial PTS using the current time. Default is 1.
|
| 1149 |
+
|
| 1150 |
+
Examples
|
| 1151 |
+
|
| 1152 |
+
Record a stream from default device:
|
| 1153 |
+
|
| 1154 |
+
ffmpeg -f pulse -i default /tmp/pulse.wav
|
| 1155 |
+
|
| 1156 |
+
sndio
|
| 1157 |
+
sndio input device.
|
| 1158 |
+
|
| 1159 |
+
To enable this input device during configuration you need libsndio
|
| 1160 |
+
installed on your system.
|
| 1161 |
+
|
| 1162 |
+
The filename to provide to the input device is the device node
|
| 1163 |
+
representing the sndio input device, and is usually set to /dev/audio0.
|
| 1164 |
+
|
| 1165 |
+
For example to grab from /dev/audio0 using ffmpeg use the command:
|
| 1166 |
+
|
| 1167 |
+
ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
|
| 1168 |
+
|
| 1169 |
+
Options
|
| 1170 |
+
|
| 1171 |
+
sample_rate
|
| 1172 |
+
Set the sample rate in Hz. Default is 48000.
|
| 1173 |
+
|
| 1174 |
+
channels
|
| 1175 |
+
Set the number of channels. Default is 2.
|
| 1176 |
+
|
| 1177 |
+
video4linux2, v4l2
|
| 1178 |
+
Video4Linux2 input video device.
|
| 1179 |
+
|
| 1180 |
+
"v4l2" can be used as alias for "video4linux2".
|
| 1181 |
+
|
| 1182 |
+
If FFmpeg is built with v4l-utils support (by using the
|
| 1183 |
+
"--enable-libv4l2" configure option), it is possible to use it with the
|
| 1184 |
+
"-use_libv4l2" input device option.
|
| 1185 |
+
|
| 1186 |
+
The name of the device to grab is a file device node, usually Linux
|
| 1187 |
+
systems tend to automatically create such nodes when the device (e.g.
|
| 1188 |
+
an USB webcam) is plugged into the system, and has a name of the kind
|
| 1189 |
+
/dev/videoN, where N is a number associated to the device.
|
| 1190 |
+
|
| 1191 |
+
Video4Linux2 devices usually support a limited set of widthxheight
|
| 1192 |
+
sizes and frame rates. You can check which are supported using
|
| 1193 |
+
-list_formats all for Video4Linux2 devices. Some devices, like TV
|
| 1194 |
+
cards, support one or more standards. It is possible to list all the
|
| 1195 |
+
supported standards using -list_standards all.
|
| 1196 |
+
|
| 1197 |
+
The time base for the timestamps is 1 microsecond. Depending on the
|
| 1198 |
+
kernel version and configuration, the timestamps may be derived from
|
| 1199 |
+
the real time clock (origin at the Unix Epoch) or the monotonic clock
|
| 1200 |
+
(origin usually at boot time, unaffected by NTP or manual changes to
|
| 1201 |
+
the clock). The -timestamps abs or -ts abs option can be used to force
|
| 1202 |
+
conversion into the real time clock.
|
| 1203 |
+
|
| 1204 |
+
Some usage examples of the video4linux2 device with ffmpeg and ffplay:
|
| 1205 |
+
|
| 1206 |
+
o List supported formats for a video4linux2 device:
|
| 1207 |
+
|
| 1208 |
+
ffplay -f video4linux2 -list_formats all /dev/video0
|
| 1209 |
+
|
| 1210 |
+
o Grab and show the input of a video4linux2 device:
|
| 1211 |
+
|
| 1212 |
+
ffplay -f video4linux2 -framerate 30 -video_size hd720 /dev/video0
|
| 1213 |
+
|
| 1214 |
+
o Grab and record the input of a video4linux2 device, leave the frame
|
| 1215 |
+
rate and size as previously set:
|
| 1216 |
+
|
| 1217 |
+
ffmpeg -f video4linux2 -input_format mjpeg -i /dev/video0 out.mpeg
|
| 1218 |
+
|
| 1219 |
+
For more information about Video4Linux, check <http://linuxtv.org/>.
|
| 1220 |
+
|
| 1221 |
+
Options
|
| 1222 |
+
|
| 1223 |
+
standard
|
| 1224 |
+
Set the standard. Must be the name of a supported standard. To get
|
| 1225 |
+
a list of the supported standards, use the list_standards option.
|
| 1226 |
+
|
| 1227 |
+
channel
|
| 1228 |
+
Set the input channel number. Default to -1, which means using the
|
| 1229 |
+
previously selected channel.
|
| 1230 |
+
|
| 1231 |
+
video_size
|
| 1232 |
+
Set the video frame size. The argument must be a string in the form
|
| 1233 |
+
WIDTHxHEIGHT or a valid size abbreviation.
|
| 1234 |
+
|
| 1235 |
+
pixel_format
|
| 1236 |
+
Select the pixel format (only valid for raw video input).
|
| 1237 |
+
|
| 1238 |
+
input_format
|
| 1239 |
+
Set the preferred pixel format (for raw video) or a codec name.
|
| 1240 |
+
This option allows one to select the input format, when several are
|
| 1241 |
+
available.
|
| 1242 |
+
|
| 1243 |
+
framerate
|
| 1244 |
+
Set the preferred video frame rate.
|
| 1245 |
+
|
| 1246 |
+
list_formats
|
| 1247 |
+
List available formats (supported pixel formats, codecs, and frame
|
| 1248 |
+
sizes) and exit.
|
| 1249 |
+
|
| 1250 |
+
Available values are:
|
| 1251 |
+
|
| 1252 |
+
all Show all available (compressed and non-compressed) formats.
|
| 1253 |
+
|
| 1254 |
+
raw Show only raw video (non-compressed) formats.
|
| 1255 |
+
|
| 1256 |
+
compressed
|
| 1257 |
+
Show only compressed formats.
|
| 1258 |
+
|
| 1259 |
+
list_standards
|
| 1260 |
+
List supported standards and exit.
|
| 1261 |
+
|
| 1262 |
+
Available values are:
|
| 1263 |
+
|
| 1264 |
+
all Show all supported standards.
|
| 1265 |
+
|
| 1266 |
+
timestamps, ts
|
| 1267 |
+
Set type of timestamps for grabbed frames.
|
| 1268 |
+
|
| 1269 |
+
Available values are:
|
| 1270 |
+
|
| 1271 |
+
default
|
| 1272 |
+
Use timestamps from the kernel.
|
| 1273 |
+
|
| 1274 |
+
abs Use absolute timestamps (wall clock).
|
| 1275 |
+
|
| 1276 |
+
mono2abs
|
| 1277 |
+
Force conversion from monotonic to absolute timestamps.
|
| 1278 |
+
|
| 1279 |
+
Default value is "default".
|
| 1280 |
+
|
| 1281 |
+
use_libv4l2
|
| 1282 |
+
Use libv4l2 (v4l-utils) conversion functions. Default is 0.
|
| 1283 |
+
|
| 1284 |
+
vfwcap
|
| 1285 |
+
VfW (Video for Windows) capture input device.
|
| 1286 |
+
|
| 1287 |
+
The filename passed as input is the capture driver number, ranging from
|
| 1288 |
+
0 to 9. You may use "list" as filename to print a list of drivers. Any
|
| 1289 |
+
other filename will be interpreted as device number 0.
|
| 1290 |
+
|
| 1291 |
+
Options
|
| 1292 |
+
|
| 1293 |
+
video_size
|
| 1294 |
+
Set the video frame size.
|
| 1295 |
+
|
| 1296 |
+
framerate
|
| 1297 |
+
Set the grabbing frame rate. Default value is "ntsc", corresponding
|
| 1298 |
+
to a frame rate of "30000/1001".
|
| 1299 |
+
|
| 1300 |
+
x11grab
|
| 1301 |
+
X11 video input device.
|
| 1302 |
+
|
| 1303 |
+
To enable this input device during configuration you need libxcb
|
| 1304 |
+
installed on your system. It will be automatically detected during
|
| 1305 |
+
configuration.
|
| 1306 |
+
|
| 1307 |
+
This device allows one to capture a region of an X11 display.
|
| 1308 |
+
|
| 1309 |
+
The filename passed as input has the syntax:
|
| 1310 |
+
|
| 1311 |
+
[<hostname>]:<display_number>.<screen_number>[+<x_offset>,<y_offset>]
|
| 1312 |
+
|
| 1313 |
+
hostname:display_number.screen_number specifies the X11 display name of
|
| 1314 |
+
the screen to grab from. hostname can be omitted, and defaults to
|
| 1315 |
+
"localhost". The environment variable DISPLAY contains the default
|
| 1316 |
+
display name.
|
| 1317 |
+
|
| 1318 |
+
x_offset and y_offset specify the offsets of the grabbed area with
|
| 1319 |
+
respect to the top-left border of the X11 screen. They default to 0.
|
| 1320 |
+
|
| 1321 |
+
Check the X11 documentation (e.g. man X) for more detailed information.
|
| 1322 |
+
|
| 1323 |
+
Use the xdpyinfo program for getting basic information about the
|
| 1324 |
+
properties of your X11 display (e.g. grep for "name" or "dimensions").
|
| 1325 |
+
|
| 1326 |
+
For example to grab from :0.0 using ffmpeg:
|
| 1327 |
+
|
| 1328 |
+
ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0 out.mpg
|
| 1329 |
+
|
| 1330 |
+
Grab at position "10,20":
|
| 1331 |
+
|
| 1332 |
+
ffmpeg -f x11grab -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
|
| 1333 |
+
|
| 1334 |
+
Options
|
| 1335 |
+
|
| 1336 |
+
select_region
|
| 1337 |
+
Specify whether to select the grabbing area graphically using the
|
| 1338 |
+
pointer. A value of 1 prompts the user to select the grabbing area
|
| 1339 |
+
graphically by clicking and dragging. A single click with no
|
| 1340 |
+
dragging will select the whole screen. A region with zero width or
|
| 1341 |
+
height will also select the whole screen. This option overwrites
|
| 1342 |
+
the video_size, grab_x, and grab_y options. Default value is 0.
|
| 1343 |
+
|
| 1344 |
+
draw_mouse
|
| 1345 |
+
Specify whether to draw the mouse pointer. A value of 0 specifies
|
| 1346 |
+
not to draw the pointer. Default value is 1.
|
| 1347 |
+
|
| 1348 |
+
follow_mouse
|
| 1349 |
+
Make the grabbed area follow the mouse. The argument can be
|
| 1350 |
+
"centered" or a number of pixels PIXELS.
|
| 1351 |
+
|
| 1352 |
+
When it is specified with "centered", the grabbing region follows
|
| 1353 |
+
the mouse pointer and keeps the pointer at the center of region;
|
| 1354 |
+
otherwise, the region follows only when the mouse pointer reaches
|
| 1355 |
+
within PIXELS (greater than zero) to the edge of region.
|
| 1356 |
+
|
| 1357 |
+
For example:
|
| 1358 |
+
|
| 1359 |
+
ffmpeg -f x11grab -follow_mouse centered -framerate 25 -video_size cif -i :0.0 out.mpg
|
| 1360 |
+
|
| 1361 |
+
To follow only when the mouse pointer reaches within 100 pixels to
|
| 1362 |
+
edge:
|
| 1363 |
+
|
| 1364 |
+
ffmpeg -f x11grab -follow_mouse 100 -framerate 25 -video_size cif -i :0.0 out.mpg
|
| 1365 |
+
|
| 1366 |
+
framerate
|
| 1367 |
+
Set the grabbing frame rate. Default value is "ntsc", corresponding
|
| 1368 |
+
to a frame rate of "30000/1001".
|
| 1369 |
+
|
| 1370 |
+
show_region
|
| 1371 |
+
Show grabbed region on screen.
|
| 1372 |
+
|
| 1373 |
+
If show_region is specified with 1, then the grabbing region will
|
| 1374 |
+
be indicated on screen. With this option, it is easy to know what
|
| 1375 |
+
is being grabbed if only a portion of the screen is grabbed.
|
| 1376 |
+
|
| 1377 |
+
region_border
|
| 1378 |
+
Set the region border thickness if -show_region 1 is used. Range
|
| 1379 |
+
is 1 to 128 and default is 3 (XCB-based x11grab only).
|
| 1380 |
+
|
| 1381 |
+
For example:
|
| 1382 |
+
|
| 1383 |
+
ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
|
| 1384 |
+
|
| 1385 |
+
With follow_mouse:
|
| 1386 |
+
|
| 1387 |
+
ffmpeg -f x11grab -follow_mouse centered -show_region 1 -framerate 25 -video_size cif -i :0.0 out.mpg
|
| 1388 |
+
|
| 1389 |
+
window_id
|
| 1390 |
+
Grab this window, instead of the whole screen. Default value is 0,
|
| 1391 |
+
which maps to the whole screen (root window).
|
| 1392 |
+
|
| 1393 |
+
The id of a window can be found using the xwininfo program,
|
| 1394 |
+
possibly with options -tree and -root.
|
| 1395 |
+
|
| 1396 |
+
If the window is later enlarged, the new area is not recorded.
|
| 1397 |
+
Video ends when the window is closed, unmapped (i.e., iconified) or
|
| 1398 |
+
shrunk beyond the video size (which defaults to the initial window
|
| 1399 |
+
size).
|
| 1400 |
+
|
| 1401 |
+
This option disables options follow_mouse and select_region.
|
| 1402 |
+
|
| 1403 |
+
video_size
|
| 1404 |
+
Set the video frame size. Default is the full desktop or window.
|
| 1405 |
+
|
| 1406 |
+
grab_x
|
| 1407 |
+
grab_y
|
| 1408 |
+
Set the grabbing region coordinates. They are expressed as offset
|
| 1409 |
+
from the top left corner of the X11 window and correspond to the
|
| 1410 |
+
x_offset and y_offset parameters in the device name. The default
|
| 1411 |
+
value for both options is 0.
|
| 1412 |
+
|
| 1413 |
+
OUTPUT DEVICES
|
| 1414 |
+
Output devices are configured elements in FFmpeg that can write
|
| 1415 |
+
multimedia data to an output device attached to your system.
|
| 1416 |
+
|
| 1417 |
+
When you configure your FFmpeg build, all the supported output devices
|
| 1418 |
+
are enabled by default. You can list all available ones using the
|
| 1419 |
+
configure option "--list-outdevs".
|
| 1420 |
+
|
| 1421 |
+
You can disable all the output devices using the configure option
|
| 1422 |
+
"--disable-outdevs", and selectively enable an output device using the
|
| 1423 |
+
option "--enable-outdev=OUTDEV", or you can disable a particular input
|
| 1424 |
+
device using the option "--disable-outdev=OUTDEV".
|
| 1425 |
+
|
| 1426 |
+
The option "-devices" of the ff* tools will display the list of enabled
|
| 1427 |
+
output devices.
|
| 1428 |
+
|
| 1429 |
+
A description of the currently available output devices follows.
|
| 1430 |
+
|
| 1431 |
+
alsa
|
| 1432 |
+
ALSA (Advanced Linux Sound Architecture) output device.
|
| 1433 |
+
|
| 1434 |
+
Examples
|
| 1435 |
+
|
| 1436 |
+
o Play a file on default ALSA device:
|
| 1437 |
+
|
| 1438 |
+
ffmpeg -i INPUT -f alsa default
|
| 1439 |
+
|
| 1440 |
+
o Play a file on soundcard 1, audio device 7:
|
| 1441 |
+
|
| 1442 |
+
ffmpeg -i INPUT -f alsa hw:1,7
|
| 1443 |
+
|
| 1444 |
+
AudioToolbox
|
| 1445 |
+
AudioToolbox output device.
|
| 1446 |
+
|
| 1447 |
+
Allows native output to CoreAudio devices on OSX.
|
| 1448 |
+
|
| 1449 |
+
The output filename can be empty (or "-") to refer to the default
|
| 1450 |
+
system output device or a number that refers to the device index as
|
| 1451 |
+
shown using: "-list_devices true".
|
| 1452 |
+
|
| 1453 |
+
Alternatively, the audio input device can be chosen by index using the
|
| 1454 |
+
|
| 1455 |
+
B<-audio_device_index E<lt>INDEXE<gt>>
|
| 1456 |
+
|
| 1457 |
+
, overriding any device name or index given in the input filename.
|
| 1458 |
+
|
| 1459 |
+
All available devices can be enumerated by using -list_devices true,
|
| 1460 |
+
listing all device names, UIDs and corresponding indices.
|
| 1461 |
+
|
| 1462 |
+
Options
|
| 1463 |
+
|
| 1464 |
+
AudioToolbox supports the following options:
|
| 1465 |
+
|
| 1466 |
+
-audio_device_index <INDEX>
|
| 1467 |
+
Specify the audio device by its index. Overrides anything given in
|
| 1468 |
+
the output filename.
|
| 1469 |
+
|
| 1470 |
+
Examples
|
| 1471 |
+
|
| 1472 |
+
o Print the list of supported devices and output a sine wave to the
|
| 1473 |
+
default device:
|
| 1474 |
+
|
| 1475 |
+
$ ffmpeg -f lavfi -i sine=r=44100 -f audiotoolbox -list_devices true -
|
| 1476 |
+
|
| 1477 |
+
o Output a sine wave to the device with the index 2, overriding any
|
| 1478 |
+
output filename:
|
| 1479 |
+
|
| 1480 |
+
$ ffmpeg -f lavfi -i sine=r=44100 -f audiotoolbox -audio_device_index 2 -
|
| 1481 |
+
|
| 1482 |
+
caca
|
| 1483 |
+
CACA output device.
|
| 1484 |
+
|
| 1485 |
+
This output device allows one to show a video stream in CACA window.
|
| 1486 |
+
Only one CACA window is allowed per application, so you can have only
|
| 1487 |
+
one instance of this output device in an application.
|
| 1488 |
+
|
| 1489 |
+
To enable this output device you need to configure FFmpeg with
|
| 1490 |
+
"--enable-libcaca". libcaca is a graphics library that outputs text
|
| 1491 |
+
instead of pixels.
|
| 1492 |
+
|
| 1493 |
+
For more information about libcaca, check:
|
| 1494 |
+
<http://caca.zoy.org/wiki/libcaca>
|
| 1495 |
+
|
| 1496 |
+
Options
|
| 1497 |
+
|
| 1498 |
+
window_title
|
| 1499 |
+
Set the CACA window title, if not specified default to the filename
|
| 1500 |
+
specified for the output device.
|
| 1501 |
+
|
| 1502 |
+
window_size
|
| 1503 |
+
Set the CACA window size, can be a string of the form widthxheight
|
| 1504 |
+
or a video size abbreviation. If not specified it defaults to the
|
| 1505 |
+
size of the input video.
|
| 1506 |
+
|
| 1507 |
+
driver
|
| 1508 |
+
Set display driver.
|
| 1509 |
+
|
| 1510 |
+
algorithm
|
| 1511 |
+
Set dithering algorithm. Dithering is necessary because the picture
|
| 1512 |
+
being rendered has usually far more colours than the available
|
| 1513 |
+
palette. The accepted values are listed with "-list_dither
|
| 1514 |
+
algorithms".
|
| 1515 |
+
|
| 1516 |
+
antialias
|
| 1517 |
+
Set antialias method. Antialiasing smoothens the rendered image and
|
| 1518 |
+
avoids the commonly seen staircase effect. The accepted values are
|
| 1519 |
+
listed with "-list_dither antialiases".
|
| 1520 |
+
|
| 1521 |
+
charset
|
| 1522 |
+
Set which characters are going to be used when rendering text. The
|
| 1523 |
+
accepted values are listed with "-list_dither charsets".
|
| 1524 |
+
|
| 1525 |
+
color
|
| 1526 |
+
Set color to be used when rendering text. The accepted values are
|
| 1527 |
+
listed with "-list_dither colors".
|
| 1528 |
+
|
| 1529 |
+
list_drivers
|
| 1530 |
+
If set to true, print a list of available drivers and exit.
|
| 1531 |
+
|
| 1532 |
+
list_dither
|
| 1533 |
+
List available dither options related to the argument. The
|
| 1534 |
+
argument must be one of "algorithms", "antialiases", "charsets",
|
| 1535 |
+
"colors".
|
| 1536 |
+
|
| 1537 |
+
Examples
|
| 1538 |
+
|
| 1539 |
+
o The following command shows the ffmpeg output is an CACA window,
|
| 1540 |
+
forcing its size to 80x25:
|
| 1541 |
+
|
| 1542 |
+
ffmpeg -i INPUT -c:v rawvideo -pix_fmt rgb24 -window_size 80x25 -f caca -
|
| 1543 |
+
|
| 1544 |
+
o Show the list of available drivers and exit:
|
| 1545 |
+
|
| 1546 |
+
ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_drivers true -
|
| 1547 |
+
|
| 1548 |
+
o Show the list of available dither colors and exit:
|
| 1549 |
+
|
| 1550 |
+
ffmpeg -i INPUT -pix_fmt rgb24 -f caca -list_dither colors -
|
| 1551 |
+
|
| 1552 |
+
decklink
|
| 1553 |
+
The decklink output device provides playback capabilities for
|
| 1554 |
+
Blackmagic DeckLink devices.
|
| 1555 |
+
|
| 1556 |
+
To enable this output device, you need the Blackmagic DeckLink SDK and
|
| 1557 |
+
you need to configure with the appropriate "--extra-cflags" and
|
| 1558 |
+
"--extra-ldflags". On Windows, you need to run the IDL files through
|
| 1559 |
+
widl.
|
| 1560 |
+
|
| 1561 |
+
DeckLink is very picky about the formats it supports. Pixel format is
|
| 1562 |
+
always uyvy422, framerate, field order and video size must be
|
| 1563 |
+
determined for your device with -list_formats 1. Audio sample rate is
|
| 1564 |
+
always 48 kHz.
|
| 1565 |
+
|
| 1566 |
+
Options
|
| 1567 |
+
|
| 1568 |
+
list_devices
|
| 1569 |
+
If set to true, print a list of devices and exit. Defaults to
|
| 1570 |
+
false. This option is deprecated, please use the "-sinks" option of
|
| 1571 |
+
ffmpeg to list the available output devices.
|
| 1572 |
+
|
| 1573 |
+
list_formats
|
| 1574 |
+
If set to true, print a list of supported formats and exit.
|
| 1575 |
+
Defaults to false.
|
| 1576 |
+
|
| 1577 |
+
preroll
|
| 1578 |
+
Amount of time to preroll video in seconds. Defaults to 0.5.
|
| 1579 |
+
|
| 1580 |
+
duplex_mode
|
| 1581 |
+
Sets the decklink device duplex/profile mode. Must be unset, half,
|
| 1582 |
+
full, one_sub_device_full, one_sub_device_half,
|
| 1583 |
+
two_sub_device_full, four_sub_device_half Defaults to unset.
|
| 1584 |
+
|
| 1585 |
+
Note: DeckLink SDK 11.0 have replaced the duplex property by a
|
| 1586 |
+
profile property. For the DeckLink Duo 2 and DeckLink Quad 2, a
|
| 1587 |
+
profile is shared between any 2 sub-devices that utilize the same
|
| 1588 |
+
connectors. For the DeckLink 8K Pro, a profile is shared between
|
| 1589 |
+
all 4 sub-devices. So DeckLink 8K Pro support four profiles.
|
| 1590 |
+
|
| 1591 |
+
Valid profile modes for DeckLink 8K Pro(with DeckLink SDK >= 11.0):
|
| 1592 |
+
one_sub_device_full, one_sub_device_half, two_sub_device_full,
|
| 1593 |
+
four_sub_device_half
|
| 1594 |
+
|
| 1595 |
+
Valid profile modes for DeckLink Quad 2 and DeckLink Duo 2: half,
|
| 1596 |
+
full
|
| 1597 |
+
|
| 1598 |
+
timing_offset
|
| 1599 |
+
Sets the genlock timing pixel offset on the used output. Defaults
|
| 1600 |
+
to unset.
|
| 1601 |
+
|
| 1602 |
+
link
|
| 1603 |
+
Sets the SDI video link configuration on the used output. Must be
|
| 1604 |
+
unset, single link SDI, dual link SDI or quad link SDI. Defaults
|
| 1605 |
+
to unset.
|
| 1606 |
+
|
| 1607 |
+
sqd Enable Square Division Quad Split mode for Quad-link SDI output.
|
| 1608 |
+
Must be unset, true or false. Defaults to unset.
|
| 1609 |
+
|
| 1610 |
+
level_a
|
| 1611 |
+
Enable SMPTE Level A mode on the used output. Must be unset, true
|
| 1612 |
+
or false. Defaults to unset.
|
| 1613 |
+
|
| 1614 |
+
vanc_queue_size
|
| 1615 |
+
Sets maximum output buffer size in bytes for VANC data. If the
|
| 1616 |
+
buffering reaches this value, outgoing VANC data will be dropped.
|
| 1617 |
+
Defaults to 1048576.
|
| 1618 |
+
|
| 1619 |
+
Examples
|
| 1620 |
+
|
| 1621 |
+
o List output devices:
|
| 1622 |
+
|
| 1623 |
+
ffmpeg -sinks decklink
|
| 1624 |
+
|
| 1625 |
+
o List supported formats:
|
| 1626 |
+
|
| 1627 |
+
ffmpeg -i test.avi -f decklink -list_formats 1 'DeckLink Mini Monitor'
|
| 1628 |
+
|
| 1629 |
+
o Play video clip:
|
| 1630 |
+
|
| 1631 |
+
ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 'DeckLink Mini Monitor'
|
| 1632 |
+
|
| 1633 |
+
o Play video clip with non-standard framerate or video size:
|
| 1634 |
+
|
| 1635 |
+
ffmpeg -i test.avi -f decklink -pix_fmt uyvy422 -s 720x486 -r 24000/1001 'DeckLink Mini Monitor'
|
| 1636 |
+
|
| 1637 |
+
fbdev
|
| 1638 |
+
Linux framebuffer output device.
|
| 1639 |
+
|
| 1640 |
+
The Linux framebuffer is a graphic hardware-independent abstraction
|
| 1641 |
+
layer to show graphics on a computer monitor, typically on the console.
|
| 1642 |
+
It is accessed through a file device node, usually /dev/fb0.
|
| 1643 |
+
|
| 1644 |
+
For more detailed information read the file
|
| 1645 |
+
Documentation/fb/framebuffer.txt included in the Linux source tree.
|
| 1646 |
+
|
| 1647 |
+
Options
|
| 1648 |
+
|
| 1649 |
+
xoffset
|
| 1650 |
+
yoffset
|
| 1651 |
+
Set x/y coordinate of top left corner. Default is 0.
|
| 1652 |
+
|
| 1653 |
+
Examples
|
| 1654 |
+
|
| 1655 |
+
Play a file on framebuffer device /dev/fb0. Required pixel format
|
| 1656 |
+
depends on current framebuffer settings.
|
| 1657 |
+
|
| 1658 |
+
ffmpeg -re -i INPUT -c:v rawvideo -pix_fmt bgra -f fbdev /dev/fb0
|
| 1659 |
+
|
| 1660 |
+
See also <http://linux-fbdev.sourceforge.net/>, and fbset(1).
|
| 1661 |
+
|
| 1662 |
+
opengl
|
| 1663 |
+
OpenGL output device. Deprecated and will be removed.
|
| 1664 |
+
|
| 1665 |
+
To enable this output device you need to configure FFmpeg with
|
| 1666 |
+
"--enable-opengl".
|
| 1667 |
+
|
| 1668 |
+
This output device allows one to render to OpenGL context. Context may
|
| 1669 |
+
be provided by application or default SDL window is created.
|
| 1670 |
+
|
| 1671 |
+
When device renders to external context, application must implement
|
| 1672 |
+
handlers for following messages: "AV_DEV_TO_APP_CREATE_WINDOW_BUFFER" -
|
| 1673 |
+
create OpenGL context on current thread.
|
| 1674 |
+
"AV_DEV_TO_APP_PREPARE_WINDOW_BUFFER" - make OpenGL context current.
|
| 1675 |
+
"AV_DEV_TO_APP_DISPLAY_WINDOW_BUFFER" - swap buffers.
|
| 1676 |
+
"AV_DEV_TO_APP_DESTROY_WINDOW_BUFFER" - destroy OpenGL context.
|
| 1677 |
+
Application is also required to inform a device about current
|
| 1678 |
+
resolution by sending "AV_APP_TO_DEV_WINDOW_SIZE" message.
|
| 1679 |
+
|
| 1680 |
+
Options
|
| 1681 |
+
|
| 1682 |
+
background
|
| 1683 |
+
Set background color. Black is a default.
|
| 1684 |
+
|
| 1685 |
+
no_window
|
| 1686 |
+
Disables default SDL window when set to non-zero value.
|
| 1687 |
+
Application must provide OpenGL context and both "window_size_cb"
|
| 1688 |
+
and "window_swap_buffers_cb" callbacks when set.
|
| 1689 |
+
|
| 1690 |
+
window_title
|
| 1691 |
+
Set the SDL window title, if not specified default to the filename
|
| 1692 |
+
specified for the output device. Ignored when no_window is set.
|
| 1693 |
+
|
| 1694 |
+
window_size
|
| 1695 |
+
Set preferred window size, can be a string of the form widthxheight
|
| 1696 |
+
or a video size abbreviation. If not specified it defaults to the
|
| 1697 |
+
size of the input video, downscaled according to the aspect ratio.
|
| 1698 |
+
Mostly usable when no_window is not set.
|
| 1699 |
+
|
| 1700 |
+
Examples
|
| 1701 |
+
|
| 1702 |
+
Play a file on SDL window using OpenGL rendering:
|
| 1703 |
+
|
| 1704 |
+
ffmpeg -i INPUT -f opengl "window title"
|
| 1705 |
+
|
| 1706 |
+
oss
|
| 1707 |
+
OSS (Open Sound System) output device.
|
| 1708 |
+
|
| 1709 |
+
pulse
|
| 1710 |
+
PulseAudio output device.
|
| 1711 |
+
|
| 1712 |
+
To enable this output device you need to configure FFmpeg with
|
| 1713 |
+
"--enable-libpulse".
|
| 1714 |
+
|
| 1715 |
+
More information about PulseAudio can be found on
|
| 1716 |
+
<http://www.pulseaudio.org>
|
| 1717 |
+
|
| 1718 |
+
Options
|
| 1719 |
+
|
| 1720 |
+
server
|
| 1721 |
+
Connect to a specific PulseAudio server, specified by an IP
|
| 1722 |
+
address. Default server is used when not provided.
|
| 1723 |
+
|
| 1724 |
+
name
|
| 1725 |
+
Specify the application name PulseAudio will use when showing
|
| 1726 |
+
active clients, by default it is the "LIBAVFORMAT_IDENT" string.
|
| 1727 |
+
|
| 1728 |
+
stream_name
|
| 1729 |
+
Specify the stream name PulseAudio will use when showing active
|
| 1730 |
+
streams, by default it is set to the specified output name.
|
| 1731 |
+
|
| 1732 |
+
device
|
| 1733 |
+
Specify the device to use. Default device is used when not
|
| 1734 |
+
provided. List of output devices can be obtained with command
|
| 1735 |
+
pactl list sinks.
|
| 1736 |
+
|
| 1737 |
+
buffer_size
|
| 1738 |
+
buffer_duration
|
| 1739 |
+
Control the size and duration of the PulseAudio buffer. A small
|
| 1740 |
+
buffer gives more control, but requires more frequent updates.
|
| 1741 |
+
|
| 1742 |
+
buffer_size specifies size in bytes while buffer_duration specifies
|
| 1743 |
+
duration in milliseconds.
|
| 1744 |
+
|
| 1745 |
+
When both options are provided then the highest value is used
|
| 1746 |
+
(duration is recalculated to bytes using stream parameters). If
|
| 1747 |
+
they are set to 0 (which is default), the device will use the
|
| 1748 |
+
default PulseAudio duration value. By default PulseAudio set buffer
|
| 1749 |
+
duration to around 2 seconds.
|
| 1750 |
+
|
| 1751 |
+
prebuf
|
| 1752 |
+
Specify pre-buffering size in bytes. The server does not start with
|
| 1753 |
+
playback before at least prebuf bytes are available in the buffer.
|
| 1754 |
+
By default this option is initialized to the same value as
|
| 1755 |
+
buffer_size or buffer_duration (whichever is bigger).
|
| 1756 |
+
|
| 1757 |
+
minreq
|
| 1758 |
+
Specify minimum request size in bytes. The server does not request
|
| 1759 |
+
less than minreq bytes from the client, instead waits until the
|
| 1760 |
+
buffer is free enough to request more bytes at once. It is
|
| 1761 |
+
recommended to not set this option, which will initialize this to a
|
| 1762 |
+
value that is deemed sensible by the server.
|
| 1763 |
+
|
| 1764 |
+
Examples
|
| 1765 |
+
|
| 1766 |
+
Play a file on default device on default server:
|
| 1767 |
+
|
| 1768 |
+
ffmpeg -i INPUT -f pulse "stream name"
|
| 1769 |
+
|
| 1770 |
+
sdl
|
| 1771 |
+
SDL (Simple DirectMedia Layer) output device. Deprecated and will be
|
| 1772 |
+
removed.
|
| 1773 |
+
|
| 1774 |
+
For monitoring purposes in FFmpeg, pipes and a video player such as
|
| 1775 |
+
ffplay can be used:
|
| 1776 |
+
|
| 1777 |
+
ffmpeg -i INPUT -f nut -c:v rawvideo - | ffplay -
|
| 1778 |
+
|
| 1779 |
+
"sdl2" can be used as alias for "sdl".
|
| 1780 |
+
|
| 1781 |
+
This output device allows one to show a video stream in an SDL window.
|
| 1782 |
+
Only one SDL window is allowed per application, so you can have only
|
| 1783 |
+
one instance of this output device in an application.
|
| 1784 |
+
|
| 1785 |
+
To enable this output device you need libsdl installed on your system
|
| 1786 |
+
when configuring your build.
|
| 1787 |
+
|
| 1788 |
+
For more information about SDL, check: <http://www.libsdl.org/>
|
| 1789 |
+
|
| 1790 |
+
Options
|
| 1791 |
+
|
| 1792 |
+
window_borderless
|
| 1793 |
+
Set SDL window border off. Default value is 0 (enable window
|
| 1794 |
+
border).
|
| 1795 |
+
|
| 1796 |
+
window_enable_quit
|
| 1797 |
+
Enable quit action (using window button or keyboard key) when non-
|
| 1798 |
+
zero value is provided. Default value is 1 (enable quit action).
|
| 1799 |
+
|
| 1800 |
+
window_fullscreen
|
| 1801 |
+
Set fullscreen mode when non-zero value is provided. Default value
|
| 1802 |
+
is zero.
|
| 1803 |
+
|
| 1804 |
+
window_size
|
| 1805 |
+
Set the SDL window size, can be a string of the form widthxheight
|
| 1806 |
+
or a video size abbreviation. If not specified it defaults to the
|
| 1807 |
+
size of the input video, downscaled according to the aspect ratio.
|
| 1808 |
+
|
| 1809 |
+
window_title
|
| 1810 |
+
Set the SDL window title, if not specified default to the filename
|
| 1811 |
+
specified for the output device.
|
| 1812 |
+
|
| 1813 |
+
window_x
|
| 1814 |
+
window_y
|
| 1815 |
+
Set the position of the window on the screen.
|
| 1816 |
+
|
| 1817 |
+
Interactive commands
|
| 1818 |
+
|
| 1819 |
+
The window created by the device can be controlled through the
|
| 1820 |
+
following interactive commands.
|
| 1821 |
+
|
| 1822 |
+
q, ESC
|
| 1823 |
+
Quit the device immediately.
|
| 1824 |
+
|
| 1825 |
+
Examples
|
| 1826 |
+
|
| 1827 |
+
The following command shows the ffmpeg output is an SDL window, forcing
|
| 1828 |
+
its size to the qcif format:
|
| 1829 |
+
|
| 1830 |
+
ffmpeg -i INPUT -c:v rawvideo -pix_fmt yuv420p -window_size qcif -f sdl "SDL output"
|
| 1831 |
+
|
| 1832 |
+
sndio
|
| 1833 |
+
sndio audio output device.
|
| 1834 |
+
|
| 1835 |
+
v4l2
|
| 1836 |
+
Video4Linux2 output device.
|
| 1837 |
+
|
| 1838 |
+
xv
|
| 1839 |
+
XV (XVideo) output device.
|
| 1840 |
+
|
| 1841 |
+
This output device allows one to show a video stream in a X Window
|
| 1842 |
+
System window.
|
| 1843 |
+
|
| 1844 |
+
Options
|
| 1845 |
+
|
| 1846 |
+
display_name
|
| 1847 |
+
Specify the hardware display name, which determines the display and
|
| 1848 |
+
communications domain to be used.
|
| 1849 |
+
|
| 1850 |
+
The display name or DISPLAY environment variable can be a string in
|
| 1851 |
+
the format hostname[:number[.screen_number]].
|
| 1852 |
+
|
| 1853 |
+
hostname specifies the name of the host machine on which the
|
| 1854 |
+
display is physically attached. number specifies the number of the
|
| 1855 |
+
display server on that host machine. screen_number specifies the
|
| 1856 |
+
screen to be used on that server.
|
| 1857 |
+
|
| 1858 |
+
If unspecified, it defaults to the value of the DISPLAY environment
|
| 1859 |
+
variable.
|
| 1860 |
+
|
| 1861 |
+
For example, "dual-headed:0.1" would specify screen 1 of display 0
|
| 1862 |
+
on the machine named ``dual-headed''.
|
| 1863 |
+
|
| 1864 |
+
Check the X11 specification for more detailed information about the
|
| 1865 |
+
display name format.
|
| 1866 |
+
|
| 1867 |
+
window_id
|
| 1868 |
+
When set to non-zero value then device doesn't create new window,
|
| 1869 |
+
but uses existing one with provided window_id. By default this
|
| 1870 |
+
options is set to zero and device creates its own window.
|
| 1871 |
+
|
| 1872 |
+
window_size
|
| 1873 |
+
Set the created window size, can be a string of the form
|
| 1874 |
+
widthxheight or a video size abbreviation. If not specified it
|
| 1875 |
+
defaults to the size of the input video. Ignored when window_id is
|
| 1876 |
+
set.
|
| 1877 |
+
|
| 1878 |
+
window_x
|
| 1879 |
+
window_y
|
| 1880 |
+
Set the X and Y window offsets for the created window. They are
|
| 1881 |
+
both set to 0 by default. The values may be ignored by the window
|
| 1882 |
+
manager. Ignored when window_id is set.
|
| 1883 |
+
|
| 1884 |
+
window_title
|
| 1885 |
+
Set the window title, if not specified default to the filename
|
| 1886 |
+
specified for the output device. Ignored when window_id is set.
|
| 1887 |
+
|
| 1888 |
+
For more information about XVideo see <http://www.x.org/>.
|
| 1889 |
+
|
| 1890 |
+
Examples
|
| 1891 |
+
|
| 1892 |
+
o Decode, display and encode video input with ffmpeg at the same
|
| 1893 |
+
time:
|
| 1894 |
+
|
| 1895 |
+
ffmpeg -i INPUT OUTPUT -f xv display
|
| 1896 |
+
|
| 1897 |
+
o Decode and display the input video to multiple X11 windows:
|
| 1898 |
+
|
| 1899 |
+
ffmpeg -i INPUT -f xv normal -vf negate -f xv negated
|
| 1900 |
+
|
| 1901 |
+
SEE ALSO
|
| 1902 |
+
ffmpeg(1), ffplay(1), ffprobe(1), libavdevice(3)
|
| 1903 |
+
|
| 1904 |
+
AUTHORS
|
| 1905 |
+
The FFmpeg developers.
|
| 1906 |
+
|
| 1907 |
+
For details about the authorship, see the Git history of the project
|
| 1908 |
+
(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command git log in
|
| 1909 |
+
the FFmpeg source directory, or browsing the online repository at
|
| 1910 |
+
<https://git.ffmpeg.org/ffmpeg>.
|
| 1911 |
+
|
| 1912 |
+
Maintainers for the specific components are listed in the file
|
| 1913 |
+
MAINTAINERS in the source code tree.
|
| 1914 |
+
|
| 1915 |
+
FFMPEG-DEVICES(1)
|
pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffmpeg-filters.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
pix2video-main/ffmpeg-7.0.2-i686-static/man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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FFMPEG-PROTOCOLS(1) FFMPEG-PROTOCOLS(1)
|
| 2 |
+
|
| 3 |
+
NAME
|
| 4 |
+
ffmpeg-protocols - FFmpeg protocols
|
| 5 |
+
|
| 6 |
+
DESCRIPTION
|
| 7 |
+
This document describes the input and output protocols provided by the
|
| 8 |
+
libavformat library.
|
| 9 |
+
|
| 10 |
+
PROTOCOL OPTIONS
|
| 11 |
+
The libavformat library provides some generic global options, which can
|
| 12 |
+
be set on all the protocols. In addition each protocol may support so-
|
| 13 |
+
called private options, which are specific for that component.
|
| 14 |
+
|
| 15 |
+
Options may be set by specifying -option value in the FFmpeg tools, or
|
| 16 |
+
by setting the value explicitly in the "AVFormatContext" options or
|
| 17 |
+
using the libavutil/opt.h API for programmatic use.
|
| 18 |
+
|
| 19 |
+
The list of supported options follows:
|
| 20 |
+
|
| 21 |
+
protocol_whitelist list (input)
|
| 22 |
+
Set a ","-separated list of allowed protocols. "ALL" matches all
|
| 23 |
+
protocols. Protocols prefixed by "-" are disabled. All protocols
|
| 24 |
+
are allowed by default but protocols used by an another protocol
|
| 25 |
+
(nested protocols) are restricted to a per protocol subset.
|
| 26 |
+
|
| 27 |
+
PROTOCOLS
|
| 28 |
+
Protocols are configured elements in FFmpeg that enable access to
|
| 29 |
+
resources that require specific protocols.
|
| 30 |
+
|
| 31 |
+
When you configure your FFmpeg build, all the supported protocols are
|
| 32 |
+
enabled by default. You can list all available ones using the configure
|
| 33 |
+
option "--list-protocols".
|
| 34 |
+
|
| 35 |
+
You can disable all the protocols using the configure option
|
| 36 |
+
"--disable-protocols", and selectively enable a protocol using the
|
| 37 |
+
option "--enable-protocol=PROTOCOL", or you can disable a particular
|
| 38 |
+
protocol using the option "--disable-protocol=PROTOCOL".
|
| 39 |
+
|
| 40 |
+
The option "-protocols" of the ff* tools will display the list of
|
| 41 |
+
supported protocols.
|
| 42 |
+
|
| 43 |
+
All protocols accept the following options:
|
| 44 |
+
|
| 45 |
+
rw_timeout
|
| 46 |
+
Maximum time to wait for (network) read/write operations to
|
| 47 |
+
complete, in microseconds.
|
| 48 |
+
|
| 49 |
+
A description of the currently available protocols follows.
|
| 50 |
+
|
| 51 |
+
amqp
|
| 52 |
+
Advanced Message Queueing Protocol (AMQP) version 0-9-1 is a broker
|
| 53 |
+
based publish-subscribe communication protocol.
|
| 54 |
+
|
| 55 |
+
FFmpeg must be compiled with --enable-librabbitmq to support AMQP. A
|
| 56 |
+
separate AMQP broker must also be run. An example open-source AMQP
|
| 57 |
+
broker is RabbitMQ.
|
| 58 |
+
|
| 59 |
+
After starting the broker, an FFmpeg client may stream data to the
|
| 60 |
+
broker using the command:
|
| 61 |
+
|
| 62 |
+
ffmpeg -re -i input -f mpegts amqp://[[user]:[password]@]hostname[:port][/vhost]
|
| 63 |
+
|
| 64 |
+
Where hostname and port (default is 5672) is the address of the broker.
|
| 65 |
+
The client may also set a user/password for authentication. The default
|
| 66 |
+
for both fields is "guest". Name of virtual host on broker can be set
|
| 67 |
+
with vhost. The default value is "/".
|
| 68 |
+
|
| 69 |
+
Muliple subscribers may stream from the broker using the command:
|
| 70 |
+
|
| 71 |
+
ffplay amqp://[[user]:[password]@]hostname[:port][/vhost]
|
| 72 |
+
|
| 73 |
+
In RabbitMQ all data published to the broker flows through a specific
|
| 74 |
+
exchange, and each subscribing client has an assigned queue/buffer.
|
| 75 |
+
When a packet arrives at an exchange, it may be copied to a client's
|
| 76 |
+
queue depending on the exchange and routing_key fields.
|
| 77 |
+
|
| 78 |
+
The following options are supported:
|
| 79 |
+
|
| 80 |
+
exchange
|
| 81 |
+
Sets the exchange to use on the broker. RabbitMQ has several
|
| 82 |
+
predefined exchanges: "amq.direct" is the default exchange, where
|
| 83 |
+
the publisher and subscriber must have a matching routing_key;
|
| 84 |
+
"amq.fanout" is the same as a broadcast operation (i.e. the data is
|
| 85 |
+
forwarded to all queues on the fanout exchange independent of the
|
| 86 |
+
routing_key); and "amq.topic" is similar to "amq.direct", but
|
| 87 |
+
allows for more complex pattern matching (refer to the RabbitMQ
|
| 88 |
+
documentation).
|
| 89 |
+
|
| 90 |
+
routing_key
|
| 91 |
+
Sets the routing key. The default value is "amqp". The routing key
|
| 92 |
+
is used on the "amq.direct" and "amq.topic" exchanges to decide
|
| 93 |
+
whether packets are written to the queue of a subscriber.
|
| 94 |
+
|
| 95 |
+
pkt_size
|
| 96 |
+
Maximum size of each packet sent/received to the broker. Default is
|
| 97 |
+
131072. Minimum is 4096 and max is any large value (representable
|
| 98 |
+
by an int). When receiving packets, this sets an internal buffer
|
| 99 |
+
size in FFmpeg. It should be equal to or greater than the size of
|
| 100 |
+
the published packets to the broker. Otherwise the received message
|
| 101 |
+
may be truncated causing decoding errors.
|
| 102 |
+
|
| 103 |
+
connection_timeout
|
| 104 |
+
The timeout in seconds during the initial connection to the broker.
|
| 105 |
+
The default value is rw_timeout, or 5 seconds if rw_timeout is not
|
| 106 |
+
set.
|
| 107 |
+
|
| 108 |
+
delivery_mode mode
|
| 109 |
+
Sets the delivery mode of each message sent to broker. The
|
| 110 |
+
following values are accepted:
|
| 111 |
+
|
| 112 |
+
persistent
|
| 113 |
+
Delivery mode set to "persistent" (2). This is the default
|
| 114 |
+
value. Messages may be written to the broker's disk depending
|
| 115 |
+
on its setup.
|
| 116 |
+
|
| 117 |
+
non-persistent
|
| 118 |
+
Delivery mode set to "non-persistent" (1). Messages will stay
|
| 119 |
+
in broker's memory unless the broker is under memory pressure.
|
| 120 |
+
|
| 121 |
+
async
|
| 122 |
+
Asynchronous data filling wrapper for input stream.
|
| 123 |
+
|
| 124 |
+
Fill data in a background thread, to decouple I/O operation from demux
|
| 125 |
+
thread.
|
| 126 |
+
|
| 127 |
+
async:<URL>
|
| 128 |
+
async:http://host/resource
|
| 129 |
+
async:cache:http://host/resource
|
| 130 |
+
|
| 131 |
+
bluray
|
| 132 |
+
Read BluRay playlist.
|
| 133 |
+
|
| 134 |
+
The accepted options are:
|
| 135 |
+
|
| 136 |
+
angle
|
| 137 |
+
BluRay angle
|
| 138 |
+
|
| 139 |
+
chapter
|
| 140 |
+
Start chapter (1...N)
|
| 141 |
+
|
| 142 |
+
playlist
|
| 143 |
+
Playlist to read (BDMV/PLAYLIST/?????.mpls)
|
| 144 |
+
|
| 145 |
+
Examples:
|
| 146 |
+
|
| 147 |
+
Read longest playlist from BluRay mounted to /mnt/bluray:
|
| 148 |
+
|
| 149 |
+
bluray:/mnt/bluray
|
| 150 |
+
|
| 151 |
+
Read angle 2 of playlist 4 from BluRay mounted to /mnt/bluray, start
|
| 152 |
+
from chapter 2:
|
| 153 |
+
|
| 154 |
+
-playlist 4 -angle 2 -chapter 2 bluray:/mnt/bluray
|
| 155 |
+
|
| 156 |
+
cache
|
| 157 |
+
Caching wrapper for input stream.
|
| 158 |
+
|
| 159 |
+
Cache the input stream to temporary file. It brings seeking capability
|
| 160 |
+
to live streams.
|
| 161 |
+
|
| 162 |
+
The accepted options are:
|
| 163 |
+
|
| 164 |
+
read_ahead_limit
|
| 165 |
+
Amount in bytes that may be read ahead when seeking isn't
|
| 166 |
+
supported. Range is -1 to INT_MAX. -1 for unlimited. Default is
|
| 167 |
+
65536.
|
| 168 |
+
|
| 169 |
+
URL Syntax is
|
| 170 |
+
|
| 171 |
+
cache:<URL>
|
| 172 |
+
|
| 173 |
+
concat
|
| 174 |
+
Physical concatenation protocol.
|
| 175 |
+
|
| 176 |
+
Read and seek from many resources in sequence as if they were a unique
|
| 177 |
+
resource.
|
| 178 |
+
|
| 179 |
+
A URL accepted by this protocol has the syntax:
|
| 180 |
+
|
| 181 |
+
concat:<URL1>|<URL2>|...|<URLN>
|
| 182 |
+
|
| 183 |
+
where URL1, URL2, ..., URLN are the urls of the resource to be
|
| 184 |
+
concatenated, each one possibly specifying a distinct protocol.
|
| 185 |
+
|
| 186 |
+
For example to read a sequence of files split1.mpeg, split2.mpeg,
|
| 187 |
+
split3.mpeg with ffplay use the command:
|
| 188 |
+
|
| 189 |
+
ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
|
| 190 |
+
|
| 191 |
+
Note that you may need to escape the character "|" which is special for
|
| 192 |
+
many shells.
|
| 193 |
+
|
| 194 |
+
concatf
|
| 195 |
+
Physical concatenation protocol using a line break delimited list of
|
| 196 |
+
resources.
|
| 197 |
+
|
| 198 |
+
Read and seek from many resources in sequence as if they were a unique
|
| 199 |
+
resource.
|
| 200 |
+
|
| 201 |
+
A URL accepted by this protocol has the syntax:
|
| 202 |
+
|
| 203 |
+
concatf:<URL>
|
| 204 |
+
|
| 205 |
+
where URL is the url containing a line break delimited list of
|
| 206 |
+
resources to be concatenated, each one possibly specifying a distinct
|
| 207 |
+
protocol. Special characters must be escaped with backslash or single
|
| 208 |
+
quotes. See the "Quoting and escaping" section in the ffmpeg-utils(1)
|
| 209 |
+
manual.
|
| 210 |
+
|
| 211 |
+
For example to read a sequence of files split1.mpeg, split2.mpeg,
|
| 212 |
+
split3.mpeg listed in separate lines within a file split.txt with
|
| 213 |
+
ffplay use the command:
|
| 214 |
+
|
| 215 |
+
ffplay concatf:split.txt
|
| 216 |
+
|
| 217 |
+
Where split.txt contains the lines:
|
| 218 |
+
|
| 219 |
+
split1.mpeg
|
| 220 |
+
split2.mpeg
|
| 221 |
+
split3.mpeg
|
| 222 |
+
|
| 223 |
+
crypto
|
| 224 |
+
AES-encrypted stream reading protocol.
|
| 225 |
+
|
| 226 |
+
The accepted options are:
|
| 227 |
+
|
| 228 |
+
key Set the AES decryption key binary block from given hexadecimal
|
| 229 |
+
representation.
|
| 230 |
+
|
| 231 |
+
iv Set the AES decryption initialization vector binary block from
|
| 232 |
+
given hexadecimal representation.
|
| 233 |
+
|
| 234 |
+
Accepted URL formats:
|
| 235 |
+
|
| 236 |
+
crypto:<URL>
|
| 237 |
+
crypto+<URL>
|
| 238 |
+
|
| 239 |
+
data
|
| 240 |
+
Data in-line in the URI. See
|
| 241 |
+
<http://en.wikipedia.org/wiki/Data_URI_scheme>.
|
| 242 |
+
|
| 243 |
+
For example, to convert a GIF file given inline with ffmpeg:
|
| 244 |
+
|
| 245 |
+
ffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP///////////////ywAAAAACAAIAAADF0gEDLojDgdGiJdJqUX02iB4E8Q9jUMkADs=" smiley.png
|
| 246 |
+
|
| 247 |
+
fd
|
| 248 |
+
File descriptor access protocol.
|
| 249 |
+
|
| 250 |
+
The accepted syntax is:
|
| 251 |
+
|
| 252 |
+
fd: -fd <file_descriptor>
|
| 253 |
+
|
| 254 |
+
If fd is not specified, by default the stdout file descriptor will be
|
| 255 |
+
used for writing, stdin for reading. Unlike the pipe protocol, fd
|
| 256 |
+
protocol has seek support if it corresponding to a regular file. fd
|
| 257 |
+
protocol doesn't support pass file descriptor via URL for security.
|
| 258 |
+
|
| 259 |
+
This protocol accepts the following options:
|
| 260 |
+
|
| 261 |
+
blocksize
|
| 262 |
+
Set I/O operation maximum block size, in bytes. Default value is
|
| 263 |
+
"INT_MAX", which results in not limiting the requested block size.
|
| 264 |
+
Setting this value reasonably low improves user termination request
|
| 265 |
+
reaction time, which is valuable if data transmission is slow.
|
| 266 |
+
|
| 267 |
+
fd Set file descriptor.
|
| 268 |
+
|
| 269 |
+
file
|
| 270 |
+
File access protocol.
|
| 271 |
+
|
| 272 |
+
Read from or write to a file.
|
| 273 |
+
|
| 274 |
+
A file URL can have the form:
|
| 275 |
+
|
| 276 |
+
file:<filename>
|
| 277 |
+
|
| 278 |
+
where filename is the path of the file to read.
|
| 279 |
+
|
| 280 |
+
An URL that does not have a protocol prefix will be assumed to be a
|
| 281 |
+
file URL. Depending on the build, an URL that looks like a Windows path
|
| 282 |
+
with the drive letter at the beginning will also be assumed to be a
|
| 283 |
+
file URL (usually not the case in builds for unix-like systems).
|
| 284 |
+
|
| 285 |
+
For example to read from a file input.mpeg with ffmpeg use the command:
|
| 286 |
+
|
| 287 |
+
ffmpeg -i file:input.mpeg output.mpeg
|
| 288 |
+
|
| 289 |
+
This protocol accepts the following options:
|
| 290 |
+
|
| 291 |
+
truncate
|
| 292 |
+
Truncate existing files on write, if set to 1. A value of 0
|
| 293 |
+
prevents truncating. Default value is 1.
|
| 294 |
+
|
| 295 |
+
blocksize
|
| 296 |
+
Set I/O operation maximum block size, in bytes. Default value is
|
| 297 |
+
"INT_MAX", which results in not limiting the requested block size.
|
| 298 |
+
Setting this value reasonably low improves user termination request
|
| 299 |
+
reaction time, which is valuable for files on slow medium.
|
| 300 |
+
|
| 301 |
+
follow
|
| 302 |
+
If set to 1, the protocol will retry reading at the end of the
|
| 303 |
+
file, allowing reading files that still are being written. In order
|
| 304 |
+
for this to terminate, you either need to use the rw_timeout
|
| 305 |
+
option, or use the interrupt callback (for API users).
|
| 306 |
+
|
| 307 |
+
seekable
|
| 308 |
+
Controls if seekability is advertised on the file. 0 means non-
|
| 309 |
+
seekable, -1 means auto (seekable for normal files, non-seekable
|
| 310 |
+
for named pipes).
|
| 311 |
+
|
| 312 |
+
Many demuxers handle seekable and non-seekable resources
|
| 313 |
+
differently, overriding this might speed up opening certain files
|
| 314 |
+
at the cost of losing some features (e.g. accurate seeking).
|
| 315 |
+
|
| 316 |
+
ftp
|
| 317 |
+
FTP (File Transfer Protocol).
|
| 318 |
+
|
| 319 |
+
Read from or write to remote resources using FTP protocol.
|
| 320 |
+
|
| 321 |
+
Following syntax is required.
|
| 322 |
+
|
| 323 |
+
ftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
|
| 324 |
+
|
| 325 |
+
This protocol accepts the following options.
|
| 326 |
+
|
| 327 |
+
timeout
|
| 328 |
+
Set timeout in microseconds of socket I/O operations used by the
|
| 329 |
+
underlying low level operation. By default it is set to -1, which
|
| 330 |
+
means that the timeout is not specified.
|
| 331 |
+
|
| 332 |
+
ftp-user
|
| 333 |
+
Set a user to be used for authenticating to the FTP server. This is
|
| 334 |
+
overridden by the user in the FTP URL.
|
| 335 |
+
|
| 336 |
+
ftp-password
|
| 337 |
+
Set a password to be used for authenticating to the FTP server.
|
| 338 |
+
This is overridden by the password in the FTP URL, or by ftp-
|
| 339 |
+
anonymous-password if no user is set.
|
| 340 |
+
|
| 341 |
+
ftp-anonymous-password
|
| 342 |
+
Password used when login as anonymous user. Typically an e-mail
|
| 343 |
+
address should be used.
|
| 344 |
+
|
| 345 |
+
ftp-write-seekable
|
| 346 |
+
Control seekability of connection during encoding. If set to 1 the
|
| 347 |
+
resource is supposed to be seekable, if set to 0 it is assumed not
|
| 348 |
+
to be seekable. Default value is 0.
|
| 349 |
+
|
| 350 |
+
NOTE: Protocol can be used as output, but it is recommended to not do
|
| 351 |
+
it, unless special care is taken (tests, customized server
|
| 352 |
+
configuration etc.). Different FTP servers behave in different way
|
| 353 |
+
during seek operation. ff* tools may produce incomplete content due to
|
| 354 |
+
server limitations.
|
| 355 |
+
|
| 356 |
+
gopher
|
| 357 |
+
Gopher protocol.
|
| 358 |
+
|
| 359 |
+
gophers
|
| 360 |
+
Gophers protocol.
|
| 361 |
+
|
| 362 |
+
The Gopher protocol with TLS encapsulation.
|
| 363 |
+
|
| 364 |
+
hls
|
| 365 |
+
Read Apple HTTP Live Streaming compliant segmented stream as a uniform
|
| 366 |
+
one. The M3U8 playlists describing the segments can be remote HTTP
|
| 367 |
+
resources or local files, accessed using the standard file protocol.
|
| 368 |
+
The nested protocol is declared by specifying "+proto" after the hls
|
| 369 |
+
URI scheme name, where proto is either "file" or "http".
|
| 370 |
+
|
| 371 |
+
hls+http://host/path/to/remote/resource.m3u8
|
| 372 |
+
hls+file://path/to/local/resource.m3u8
|
| 373 |
+
|
| 374 |
+
Using this protocol is discouraged - the hls demuxer should work just
|
| 375 |
+
as well (if not, please report the issues) and is more complete. To
|
| 376 |
+
use the hls demuxer instead, simply use the direct URLs to the m3u8
|
| 377 |
+
files.
|
| 378 |
+
|
| 379 |
+
http
|
| 380 |
+
HTTP (Hyper Text Transfer Protocol).
|
| 381 |
+
|
| 382 |
+
This protocol accepts the following options:
|
| 383 |
+
|
| 384 |
+
seekable
|
| 385 |
+
Control seekability of connection. If set to 1 the resource is
|
| 386 |
+
supposed to be seekable, if set to 0 it is assumed not to be
|
| 387 |
+
seekable, if set to -1 it will try to autodetect if it is seekable.
|
| 388 |
+
Default value is -1.
|
| 389 |
+
|
| 390 |
+
chunked_post
|
| 391 |
+
If set to 1 use chunked Transfer-Encoding for posts, default is 1.
|
| 392 |
+
|
| 393 |
+
content_type
|
| 394 |
+
Set a specific content type for the POST messages or for listen
|
| 395 |
+
mode.
|
| 396 |
+
|
| 397 |
+
http_proxy
|
| 398 |
+
set HTTP proxy to tunnel through e.g. http://example.com:1234
|
| 399 |
+
|
| 400 |
+
headers
|
| 401 |
+
Set custom HTTP headers, can override built in default headers. The
|
| 402 |
+
value must be a string encoding the headers.
|
| 403 |
+
|
| 404 |
+
multiple_requests
|
| 405 |
+
Use persistent connections if set to 1, default is 0.
|
| 406 |
+
|
| 407 |
+
post_data
|
| 408 |
+
Set custom HTTP post data.
|
| 409 |
+
|
| 410 |
+
referer
|
| 411 |
+
Set the Referer header. Include 'Referer: URL' header in HTTP
|
| 412 |
+
request.
|
| 413 |
+
|
| 414 |
+
user_agent
|
| 415 |
+
Override the User-Agent header. If not specified the protocol will
|
| 416 |
+
use a string describing the libavformat build. ("Lavf/<version>")
|
| 417 |
+
|
| 418 |
+
reconnect_at_eof
|
| 419 |
+
If set then eof is treated like an error and causes reconnection,
|
| 420 |
+
this is useful for live / endless streams.
|
| 421 |
+
|
| 422 |
+
reconnect_streamed
|
| 423 |
+
If set then even streamed/non seekable streams will be reconnected
|
| 424 |
+
on errors.
|
| 425 |
+
|
| 426 |
+
reconnect_on_network_error
|
| 427 |
+
Reconnect automatically in case of TCP/TLS errors during connect.
|
| 428 |
+
|
| 429 |
+
reconnect_on_http_error
|
| 430 |
+
A comma separated list of HTTP status codes to reconnect on. The
|
| 431 |
+
list can include specific status codes (e.g. '503') or the strings
|
| 432 |
+
'4xx' / '5xx'.
|
| 433 |
+
|
| 434 |
+
reconnect_delay_max
|
| 435 |
+
Sets the maximum delay in seconds after which to give up
|
| 436 |
+
reconnecting
|
| 437 |
+
|
| 438 |
+
mime_type
|
| 439 |
+
Export the MIME type.
|
| 440 |
+
|
| 441 |
+
http_version
|
| 442 |
+
Exports the HTTP response version number. Usually "1.0" or "1.1".
|
| 443 |
+
|
| 444 |
+
icy If set to 1 request ICY (SHOUTcast) metadata from the server. If
|
| 445 |
+
the server supports this, the metadata has to be retrieved by the
|
| 446 |
+
application by reading the icy_metadata_headers and
|
| 447 |
+
icy_metadata_packet options. The default is 1.
|
| 448 |
+
|
| 449 |
+
icy_metadata_headers
|
| 450 |
+
If the server supports ICY metadata, this contains the ICY-specific
|
| 451 |
+
HTTP reply headers, separated by newline characters.
|
| 452 |
+
|
| 453 |
+
icy_metadata_packet
|
| 454 |
+
If the server supports ICY metadata, and icy was set to 1, this
|
| 455 |
+
contains the last non-empty metadata packet sent by the server. It
|
| 456 |
+
should be polled in regular intervals by applications interested in
|
| 457 |
+
mid-stream metadata updates.
|
| 458 |
+
|
| 459 |
+
cookies
|
| 460 |
+
Set the cookies to be sent in future requests. The format of each
|
| 461 |
+
cookie is the same as the value of a Set-Cookie HTTP response
|
| 462 |
+
field. Multiple cookies can be delimited by a newline character.
|
| 463 |
+
|
| 464 |
+
offset
|
| 465 |
+
Set initial byte offset.
|
| 466 |
+
|
| 467 |
+
end_offset
|
| 468 |
+
Try to limit the request to bytes preceding this offset.
|
| 469 |
+
|
| 470 |
+
method
|
| 471 |
+
When used as a client option it sets the HTTP method for the
|
| 472 |
+
request.
|
| 473 |
+
|
| 474 |
+
When used as a server option it sets the HTTP method that is going
|
| 475 |
+
to be expected from the client(s). If the expected and the
|
| 476 |
+
received HTTP method do not match the client will be given a Bad
|
| 477 |
+
Request response. When unset the HTTP method is not checked for
|
| 478 |
+
now. This will be replaced by autodetection in the future.
|
| 479 |
+
|
| 480 |
+
listen
|
| 481 |
+
If set to 1 enables experimental HTTP server. This can be used to
|
| 482 |
+
send data when used as an output option, or read data from a client
|
| 483 |
+
with HTTP POST when used as an input option. If set to 2 enables
|
| 484 |
+
experimental multi-client HTTP server. This is not yet implemented
|
| 485 |
+
in ffmpeg.c and thus must not be used as a command line option.
|
| 486 |
+
|
| 487 |
+
# Server side (sending):
|
| 488 |
+
ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://<server>:<port>
|
| 489 |
+
|
| 490 |
+
# Client side (receiving):
|
| 491 |
+
ffmpeg -i http://<server>:<port> -c copy somefile.ogg
|
| 492 |
+
|
| 493 |
+
# Client can also be done with wget:
|
| 494 |
+
wget http://<server>:<port> -O somefile.ogg
|
| 495 |
+
|
| 496 |
+
# Server side (receiving):
|
| 497 |
+
ffmpeg -listen 1 -i http://<server>:<port> -c copy somefile.ogg
|
| 498 |
+
|
| 499 |
+
# Client side (sending):
|
| 500 |
+
ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://<server>:<port>
|
| 501 |
+
|
| 502 |
+
# Client can also be done with wget:
|
| 503 |
+
wget --post-file=somefile.ogg http://<server>:<port>
|
| 504 |
+
|
| 505 |
+
send_expect_100
|
| 506 |
+
Send an Expect: 100-continue header for POST. If set to 1 it will
|
| 507 |
+
send, if set to 0 it won't, if set to -1 it will try to send if it
|
| 508 |
+
is applicable. Default value is -1.
|
| 509 |
+
|
| 510 |
+
auth_type
|
| 511 |
+
Set HTTP authentication type. No option for Digest, since this
|
| 512 |
+
method requires getting nonce parameters from the server first and
|
| 513 |
+
can't be used straight away like Basic.
|
| 514 |
+
|
| 515 |
+
none
|
| 516 |
+
Choose the HTTP authentication type automatically. This is the
|
| 517 |
+
default.
|
| 518 |
+
|
| 519 |
+
basic
|
| 520 |
+
Choose the HTTP basic authentication.
|
| 521 |
+
|
| 522 |
+
Basic authentication sends a Base64-encoded string that
|
| 523 |
+
contains a user name and password for the client. Base64 is not
|
| 524 |
+
a form of encryption and should be considered the same as
|
| 525 |
+
sending the user name and password in clear text (Base64 is a
|
| 526 |
+
reversible encoding). If a resource needs to be protected,
|
| 527 |
+
strongly consider using an authentication scheme other than
|
| 528 |
+
basic authentication. HTTPS/TLS should be used with basic
|
| 529 |
+
authentication. Without these additional security
|
| 530 |
+
enhancements, basic authentication should not be used to
|
| 531 |
+
protect sensitive or valuable information.
|
| 532 |
+
|
| 533 |
+
HTTP Cookies
|
| 534 |
+
|
| 535 |
+
Some HTTP requests will be denied unless cookie values are passed in
|
| 536 |
+
with the request. The cookies option allows these cookies to be
|
| 537 |
+
specified. At the very least, each cookie must specify a value along
|
| 538 |
+
with a path and domain. HTTP requests that match both the domain and
|
| 539 |
+
path will automatically include the cookie value in the HTTP Cookie
|
| 540 |
+
header field. Multiple cookies can be delimited by a newline.
|
| 541 |
+
|
| 542 |
+
The required syntax to play a stream specifying a cookie is:
|
| 543 |
+
|
| 544 |
+
ffplay -cookies "nlqptid=nltid=tsn; path=/; domain=somedomain.com;" http://somedomain.com/somestream.m3u8
|
| 545 |
+
|
| 546 |
+
Icecast
|
| 547 |
+
Icecast protocol (stream to Icecast servers)
|
| 548 |
+
|
| 549 |
+
This protocol accepts the following options:
|
| 550 |
+
|
| 551 |
+
ice_genre
|
| 552 |
+
Set the stream genre.
|
| 553 |
+
|
| 554 |
+
ice_name
|
| 555 |
+
Set the stream name.
|
| 556 |
+
|
| 557 |
+
ice_description
|
| 558 |
+
Set the stream description.
|
| 559 |
+
|
| 560 |
+
ice_url
|
| 561 |
+
Set the stream website URL.
|
| 562 |
+
|
| 563 |
+
ice_public
|
| 564 |
+
Set if the stream should be public. The default is 0 (not public).
|
| 565 |
+
|
| 566 |
+
user_agent
|
| 567 |
+
Override the User-Agent header. If not specified a string of the
|
| 568 |
+
form "Lavf/<version>" will be used.
|
| 569 |
+
|
| 570 |
+
password
|
| 571 |
+
Set the Icecast mountpoint password.
|
| 572 |
+
|
| 573 |
+
content_type
|
| 574 |
+
Set the stream content type. This must be set if it is different
|
| 575 |
+
from audio/mpeg.
|
| 576 |
+
|
| 577 |
+
legacy_icecast
|
| 578 |
+
This enables support for Icecast versions < 2.4.0, that do not
|
| 579 |
+
support the HTTP PUT method but the SOURCE method.
|
| 580 |
+
|
| 581 |
+
tls Establish a TLS (HTTPS) connection to Icecast.
|
| 582 |
+
|
| 583 |
+
icecast://[<username>[:<password>]@]<server>:<port>/<mountpoint>
|
| 584 |
+
|
| 585 |
+
ipfs
|
| 586 |
+
InterPlanetary File System (IPFS) protocol support. One can access
|
| 587 |
+
files stored on the IPFS network through so-called gateways. These are
|
| 588 |
+
http(s) endpoints. This protocol wraps the IPFS native protocols
|
| 589 |
+
(ipfs:// and ipns://) to be sent to such a gateway. Users can (and
|
| 590 |
+
should) host their own node which means this protocol will use one's
|
| 591 |
+
local gateway to access files on the IPFS network.
|
| 592 |
+
|
| 593 |
+
This protocol accepts the following options:
|
| 594 |
+
|
| 595 |
+
gateway
|
| 596 |
+
Defines the gateway to use. When not set, the protocol will first
|
| 597 |
+
try locating the local gateway by looking at $IPFS_GATEWAY,
|
| 598 |
+
$IPFS_PATH and "$HOME/.ipfs/", in that order.
|
| 599 |
+
|
| 600 |
+
One can use this protocol in 2 ways. Using IPFS:
|
| 601 |
+
|
| 602 |
+
ffplay ipfs://<hash>
|
| 603 |
+
|
| 604 |
+
Or the IPNS protocol (IPNS is mutable IPFS):
|
| 605 |
+
|
| 606 |
+
ffplay ipns://<hash>
|
| 607 |
+
|
| 608 |
+
mmst
|
| 609 |
+
MMS (Microsoft Media Server) protocol over TCP.
|
| 610 |
+
|
| 611 |
+
mmsh
|
| 612 |
+
MMS (Microsoft Media Server) protocol over HTTP.
|
| 613 |
+
|
| 614 |
+
The required syntax is:
|
| 615 |
+
|
| 616 |
+
mmsh://<server>[:<port>][/<app>][/<playpath>]
|
| 617 |
+
|
| 618 |
+
md5
|
| 619 |
+
MD5 output protocol.
|
| 620 |
+
|
| 621 |
+
Computes the MD5 hash of the data to be written, and on close writes
|
| 622 |
+
this to the designated output or stdout if none is specified. It can be
|
| 623 |
+
used to test muxers without writing an actual file.
|
| 624 |
+
|
| 625 |
+
Some examples follow.
|
| 626 |
+
|
| 627 |
+
# Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
|
| 628 |
+
ffmpeg -i input.flv -f avi -y md5:output.avi.md5
|
| 629 |
+
|
| 630 |
+
# Write the MD5 hash of the encoded AVI file to stdout.
|
| 631 |
+
ffmpeg -i input.flv -f avi -y md5:
|
| 632 |
+
|
| 633 |
+
Note that some formats (typically MOV) require the output protocol to
|
| 634 |
+
be seekable, so they will fail with the MD5 output protocol.
|
| 635 |
+
|
| 636 |
+
pipe
|
| 637 |
+
UNIX pipe access protocol.
|
| 638 |
+
|
| 639 |
+
Read and write from UNIX pipes.
|
| 640 |
+
|
| 641 |
+
The accepted syntax is:
|
| 642 |
+
|
| 643 |
+
pipe:[<number>]
|
| 644 |
+
|
| 645 |
+
If fd isn't specified, number is the number corresponding to the file
|
| 646 |
+
descriptor of the pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr).
|
| 647 |
+
If number is not specified, by default the stdout file descriptor will
|
| 648 |
+
be used for writing, stdin for reading.
|
| 649 |
+
|
| 650 |
+
For example to read from stdin with ffmpeg:
|
| 651 |
+
|
| 652 |
+
cat test.wav | ffmpeg -i pipe:0
|
| 653 |
+
# ...this is the same as...
|
| 654 |
+
cat test.wav | ffmpeg -i pipe:
|
| 655 |
+
|
| 656 |
+
For writing to stdout with ffmpeg:
|
| 657 |
+
|
| 658 |
+
ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
|
| 659 |
+
# ...this is the same as...
|
| 660 |
+
ffmpeg -i test.wav -f avi pipe: | cat > test.avi
|
| 661 |
+
|
| 662 |
+
This protocol accepts the following options:
|
| 663 |
+
|
| 664 |
+
blocksize
|
| 665 |
+
Set I/O operation maximum block size, in bytes. Default value is
|
| 666 |
+
"INT_MAX", which results in not limiting the requested block size.
|
| 667 |
+
Setting this value reasonably low improves user termination request
|
| 668 |
+
reaction time, which is valuable if data transmission is slow.
|
| 669 |
+
|
| 670 |
+
fd Set file descriptor.
|
| 671 |
+
|
| 672 |
+
Note that some formats (typically MOV), require the output protocol to
|
| 673 |
+
be seekable, so they will fail with the pipe output protocol.
|
| 674 |
+
|
| 675 |
+
prompeg
|
| 676 |
+
Pro-MPEG Code of Practice #3 Release 2 FEC protocol.
|
| 677 |
+
|
| 678 |
+
The Pro-MPEG CoP#3 FEC is a 2D parity-check forward error correction
|
| 679 |
+
mechanism for MPEG-2 Transport Streams sent over RTP.
|
| 680 |
+
|
| 681 |
+
This protocol must be used in conjunction with the "rtp_mpegts" muxer
|
| 682 |
+
and the "rtp" protocol.
|
| 683 |
+
|
| 684 |
+
The required syntax is:
|
| 685 |
+
|
| 686 |
+
-f rtp_mpegts -fec prompeg=<option>=<val>... rtp://<hostname>:<port>
|
| 687 |
+
|
| 688 |
+
The destination UDP ports are "port + 2" for the column FEC stream and
|
| 689 |
+
"port + 4" for the row FEC stream.
|
| 690 |
+
|
| 691 |
+
This protocol accepts the following options:
|
| 692 |
+
|
| 693 |
+
l=n The number of columns (4-20, LxD <= 100)
|
| 694 |
+
|
| 695 |
+
d=n The number of rows (4-20, LxD <= 100)
|
| 696 |
+
|
| 697 |
+
Example usage:
|
| 698 |
+
|
| 699 |
+
-f rtp_mpegts -fec prompeg=l=8:d=4 rtp://<hostname>:<port>
|
| 700 |
+
|
| 701 |
+
rist
|
| 702 |
+
Reliable Internet Streaming Transport protocol
|
| 703 |
+
|
| 704 |
+
The accepted options are:
|
| 705 |
+
|
| 706 |
+
rist_profile
|
| 707 |
+
Supported values:
|
| 708 |
+
|
| 709 |
+
simple
|
| 710 |
+
main
|
| 711 |
+
This one is default.
|
| 712 |
+
|
| 713 |
+
advanced
|
| 714 |
+
buffer_size
|
| 715 |
+
Set internal RIST buffer size in milliseconds for retransmission of
|
| 716 |
+
data. Default value is 0 which means the librist default (1 sec).
|
| 717 |
+
Maximum value is 30 seconds.
|
| 718 |
+
|
| 719 |
+
fifo_size
|
| 720 |
+
Size of the librist receiver output fifo in number of packets. This
|
| 721 |
+
must be a power of 2. Defaults to 8192 (vs the librist default of
|
| 722 |
+
1024).
|
| 723 |
+
|
| 724 |
+
overrun_nonfatal=1|0
|
| 725 |
+
Survive in case of librist fifo buffer overrun. Default value is 0.
|
| 726 |
+
|
| 727 |
+
pkt_size
|
| 728 |
+
Set maximum packet size for sending data. 1316 by default.
|
| 729 |
+
|
| 730 |
+
log_level
|
| 731 |
+
Set loglevel for RIST logging messages. You only need to set this
|
| 732 |
+
if you explicitly want to enable debug level messages or packet
|
| 733 |
+
loss simulation, otherwise the regular loglevel is respected.
|
| 734 |
+
|
| 735 |
+
secret
|
| 736 |
+
Set override of encryption secret, by default is unset.
|
| 737 |
+
|
| 738 |
+
encryption
|
| 739 |
+
Set encryption type, by default is disabled. Acceptable values are
|
| 740 |
+
128 and 256.
|
| 741 |
+
|
| 742 |
+
rtmp
|
| 743 |
+
Real-Time Messaging Protocol.
|
| 744 |
+
|
| 745 |
+
The Real-Time Messaging Protocol (RTMP) is used for streaming
|
| 746 |
+
multimedia content across a TCP/IP network.
|
| 747 |
+
|
| 748 |
+
The required syntax is:
|
| 749 |
+
|
| 750 |
+
rtmp://[<username>:<password>@]<server>[:<port>][/<app>][/<instance>][/<playpath>]
|
| 751 |
+
|
| 752 |
+
The accepted parameters are:
|
| 753 |
+
|
| 754 |
+
username
|
| 755 |
+
An optional username (mostly for publishing).
|
| 756 |
+
|
| 757 |
+
password
|
| 758 |
+
An optional password (mostly for publishing).
|
| 759 |
+
|
| 760 |
+
server
|
| 761 |
+
The address of the RTMP server.
|
| 762 |
+
|
| 763 |
+
port
|
| 764 |
+
The number of the TCP port to use (by default is 1935).
|
| 765 |
+
|
| 766 |
+
app It is the name of the application to access. It usually corresponds
|
| 767 |
+
to the path where the application is installed on the RTMP server
|
| 768 |
+
(e.g. /ondemand/, /flash/live/, etc.). You can override the value
|
| 769 |
+
parsed from the URI through the "rtmp_app" option, too.
|
| 770 |
+
|
| 771 |
+
playpath
|
| 772 |
+
It is the path or name of the resource to play with reference to
|
| 773 |
+
the application specified in app, may be prefixed by "mp4:". You
|
| 774 |
+
can override the value parsed from the URI through the
|
| 775 |
+
"rtmp_playpath" option, too.
|
| 776 |
+
|
| 777 |
+
listen
|
| 778 |
+
Act as a server, listening for an incoming connection.
|
| 779 |
+
|
| 780 |
+
timeout
|
| 781 |
+
Maximum time to wait for the incoming connection. Implies listen.
|
| 782 |
+
|
| 783 |
+
Additionally, the following parameters can be set via command line
|
| 784 |
+
options (or in code via "AVOption"s):
|
| 785 |
+
|
| 786 |
+
rtmp_app
|
| 787 |
+
Name of application to connect on the RTMP server. This option
|
| 788 |
+
overrides the parameter specified in the URI.
|
| 789 |
+
|
| 790 |
+
rtmp_buffer
|
| 791 |
+
Set the client buffer time in milliseconds. The default is 3000.
|
| 792 |
+
|
| 793 |
+
rtmp_conn
|
| 794 |
+
Extra arbitrary AMF connection parameters, parsed from a string,
|
| 795 |
+
e.g. like "B:1 S:authMe O:1 NN:code:1.23 NS:flag:ok O:0". Each
|
| 796 |
+
value is prefixed by a single character denoting the type, B for
|
| 797 |
+
Boolean, N for number, S for string, O for object, or Z for null,
|
| 798 |
+
followed by a colon. For Booleans the data must be either 0 or 1
|
| 799 |
+
for FALSE or TRUE, respectively. Likewise for Objects the data
|
| 800 |
+
must be 0 or 1 to end or begin an object, respectively. Data items
|
| 801 |
+
in subobjects may be named, by prefixing the type with 'N' and
|
| 802 |
+
specifying the name before the value (i.e. "NB:myFlag:1"). This
|
| 803 |
+
option may be used multiple times to construct arbitrary AMF
|
| 804 |
+
sequences.
|
| 805 |
+
|
| 806 |
+
rtmp_enhanced_codecs
|
| 807 |
+
Specify the list of codecs the client advertises to support in an
|
| 808 |
+
enhanced RTMP stream. This option should be set to a comma
|
| 809 |
+
separated list of fourcc values, like "hvc1,av01,vp09" for multiple
|
| 810 |
+
codecs or "hvc1" for only one codec. The specified list will be
|
| 811 |
+
presented in the "fourCcLive" property of the Connect Command
|
| 812 |
+
Message.
|
| 813 |
+
|
| 814 |
+
rtmp_flashver
|
| 815 |
+
Version of the Flash plugin used to run the SWF player. The default
|
| 816 |
+
is LNX 9,0,124,2. (When publishing, the default is FMLE/3.0
|
| 817 |
+
(compatible; <libavformat version>).)
|
| 818 |
+
|
| 819 |
+
rtmp_flush_interval
|
| 820 |
+
Number of packets flushed in the same request (RTMPT only). The
|
| 821 |
+
default is 10.
|
| 822 |
+
|
| 823 |
+
rtmp_live
|
| 824 |
+
Specify that the media is a live stream. No resuming or seeking in
|
| 825 |
+
live streams is possible. The default value is "any", which means
|
| 826 |
+
the subscriber first tries to play the live stream specified in the
|
| 827 |
+
playpath. If a live stream of that name is not found, it plays the
|
| 828 |
+
recorded stream. The other possible values are "live" and
|
| 829 |
+
"recorded".
|
| 830 |
+
|
| 831 |
+
rtmp_pageurl
|
| 832 |
+
URL of the web page in which the media was embedded. By default no
|
| 833 |
+
value will be sent.
|
| 834 |
+
|
| 835 |
+
rtmp_playpath
|
| 836 |
+
Stream identifier to play or to publish. This option overrides the
|
| 837 |
+
parameter specified in the URI.
|
| 838 |
+
|
| 839 |
+
rtmp_subscribe
|
| 840 |
+
Name of live stream to subscribe to. By default no value will be
|
| 841 |
+
sent. It is only sent if the option is specified or if rtmp_live
|
| 842 |
+
is set to live.
|
| 843 |
+
|
| 844 |
+
rtmp_swfhash
|
| 845 |
+
SHA256 hash of the decompressed SWF file (32 bytes).
|
| 846 |
+
|
| 847 |
+
rtmp_swfsize
|
| 848 |
+
Size of the decompressed SWF file, required for SWFVerification.
|
| 849 |
+
|
| 850 |
+
rtmp_swfurl
|
| 851 |
+
URL of the SWF player for the media. By default no value will be
|
| 852 |
+
sent.
|
| 853 |
+
|
| 854 |
+
rtmp_swfverify
|
| 855 |
+
URL to player swf file, compute hash/size automatically.
|
| 856 |
+
|
| 857 |
+
rtmp_tcurl
|
| 858 |
+
URL of the target stream. Defaults to proto://host[:port]/app.
|
| 859 |
+
|
| 860 |
+
tcp_nodelay=1|0
|
| 861 |
+
Set TCP_NODELAY to disable Nagle's algorithm. Default value is 0.
|
| 862 |
+
|
| 863 |
+
Remark: Writing to the socket is currently not optimized to
|
| 864 |
+
minimize system calls and reduces the efficiency / effect of
|
| 865 |
+
TCP_NODELAY.
|
| 866 |
+
|
| 867 |
+
For example to read with ffplay a multimedia resource named "sample"
|
| 868 |
+
from the application "vod" from an RTMP server "myserver":
|
| 869 |
+
|
| 870 |
+
ffplay rtmp://myserver/vod/sample
|
| 871 |
+
|
| 872 |
+
To publish to a password protected server, passing the playpath and app
|
| 873 |
+
names separately:
|
| 874 |
+
|
| 875 |
+
ffmpeg -re -i <input> -f flv -rtmp_playpath some/long/path -rtmp_app long/app/name rtmp://username:password@myserver/
|
| 876 |
+
|
| 877 |
+
rtmpe
|
| 878 |
+
Encrypted Real-Time Messaging Protocol.
|
| 879 |
+
|
| 880 |
+
The Encrypted Real-Time Messaging Protocol (RTMPE) is used for
|
| 881 |
+
streaming multimedia content within standard cryptographic primitives,
|
| 882 |
+
consisting of Diffie-Hellman key exchange and HMACSHA256, generating a
|
| 883 |
+
pair of RC4 keys.
|
| 884 |
+
|
| 885 |
+
rtmps
|
| 886 |
+
Real-Time Messaging Protocol over a secure SSL connection.
|
| 887 |
+
|
| 888 |
+
The Real-Time Messaging Protocol (RTMPS) is used for streaming
|
| 889 |
+
multimedia content across an encrypted connection.
|
| 890 |
+
|
| 891 |
+
rtmpt
|
| 892 |
+
Real-Time Messaging Protocol tunneled through HTTP.
|
| 893 |
+
|
| 894 |
+
The Real-Time Messaging Protocol tunneled through HTTP (RTMPT) is used
|
| 895 |
+
for streaming multimedia content within HTTP requests to traverse
|
| 896 |
+
firewalls.
|
| 897 |
+
|
| 898 |
+
rtmpte
|
| 899 |
+
Encrypted Real-Time Messaging Protocol tunneled through HTTP.
|
| 900 |
+
|
| 901 |
+
The Encrypted Real-Time Messaging Protocol tunneled through HTTP
|
| 902 |
+
(RTMPTE) is used for streaming multimedia content within HTTP requests
|
| 903 |
+
to traverse firewalls.
|
| 904 |
+
|
| 905 |
+
rtmpts
|
| 906 |
+
Real-Time Messaging Protocol tunneled through HTTPS.
|
| 907 |
+
|
| 908 |
+
The Real-Time Messaging Protocol tunneled through HTTPS (RTMPTS) is
|
| 909 |
+
used for streaming multimedia content within HTTPS requests to traverse
|
| 910 |
+
firewalls.
|
| 911 |
+
|
| 912 |
+
libsmbclient
|
| 913 |
+
libsmbclient permits one to manipulate CIFS/SMB network resources.
|
| 914 |
+
|
| 915 |
+
Following syntax is required.
|
| 916 |
+
|
| 917 |
+
smb://[[domain:]user[:password@]]server[/share[/path[/file]]]
|
| 918 |
+
|
| 919 |
+
This protocol accepts the following options.
|
| 920 |
+
|
| 921 |
+
timeout
|
| 922 |
+
Set timeout in milliseconds of socket I/O operations used by the
|
| 923 |
+
underlying low level operation. By default it is set to -1, which
|
| 924 |
+
means that the timeout is not specified.
|
| 925 |
+
|
| 926 |
+
truncate
|
| 927 |
+
Truncate existing files on write, if set to 1. A value of 0
|
| 928 |
+
prevents truncating. Default value is 1.
|
| 929 |
+
|
| 930 |
+
workgroup
|
| 931 |
+
Set the workgroup used for making connections. By default workgroup
|
| 932 |
+
is not specified.
|
| 933 |
+
|
| 934 |
+
For more information see: <http://www.samba.org/>.
|
| 935 |
+
|
| 936 |
+
libssh
|
| 937 |
+
Secure File Transfer Protocol via libssh
|
| 938 |
+
|
| 939 |
+
Read from or write to remote resources using SFTP protocol.
|
| 940 |
+
|
| 941 |
+
Following syntax is required.
|
| 942 |
+
|
| 943 |
+
sftp://[user[:password]@]server[:port]/path/to/remote/resource.mpeg
|
| 944 |
+
|
| 945 |
+
This protocol accepts the following options.
|
| 946 |
+
|
| 947 |
+
timeout
|
| 948 |
+
Set timeout of socket I/O operations used by the underlying low
|
| 949 |
+
level operation. By default it is set to -1, which means that the
|
| 950 |
+
timeout is not specified.
|
| 951 |
+
|
| 952 |
+
truncate
|
| 953 |
+
Truncate existing files on write, if set to 1. A value of 0
|
| 954 |
+
prevents truncating. Default value is 1.
|
| 955 |
+
|
| 956 |
+
private_key
|
| 957 |
+
Specify the path of the file containing private key to use during
|
| 958 |
+
authorization. By default libssh searches for keys in the ~/.ssh/
|
| 959 |
+
directory.
|
| 960 |
+
|
| 961 |
+
Example: Play a file stored on remote server.
|
| 962 |
+
|
| 963 |
+
ffplay sftp://user:password@server_address:22/home/user/resource.mpeg
|
| 964 |
+
|
| 965 |
+
librtmp rtmp, rtmpe, rtmps, rtmpt, rtmpte
|
| 966 |
+
Real-Time Messaging Protocol and its variants supported through
|
| 967 |
+
librtmp.
|
| 968 |
+
|
| 969 |
+
Requires the presence of the librtmp headers and library during
|
| 970 |
+
configuration. You need to explicitly configure the build with
|
| 971 |
+
"--enable-librtmp". If enabled this will replace the native RTMP
|
| 972 |
+
protocol.
|
| 973 |
+
|
| 974 |
+
This protocol provides most client functions and a few server functions
|
| 975 |
+
needed to support RTMP, RTMP tunneled in HTTP (RTMPT), encrypted RTMP
|
| 976 |
+
(RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled variants of these
|
| 977 |
+
encrypted types (RTMPTE, RTMPTS).
|
| 978 |
+
|
| 979 |
+
The required syntax is:
|
| 980 |
+
|
| 981 |
+
<rtmp_proto>://<server>[:<port>][/<app>][/<playpath>] <options>
|
| 982 |
+
|
| 983 |
+
where rtmp_proto is one of the strings "rtmp", "rtmpt", "rtmpe",
|
| 984 |
+
"rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and
|
| 985 |
+
server, port, app and playpath have the same meaning as specified for
|
| 986 |
+
the RTMP native protocol. options contains a list of space-separated
|
| 987 |
+
options of the form key=val.
|
| 988 |
+
|
| 989 |
+
See the librtmp manual page (man 3 librtmp) for more information.
|
| 990 |
+
|
| 991 |
+
For example, to stream a file in real-time to an RTMP server using
|
| 992 |
+
ffmpeg:
|
| 993 |
+
|
| 994 |
+
ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
|
| 995 |
+
|
| 996 |
+
To play the same stream using ffplay:
|
| 997 |
+
|
| 998 |
+
ffplay "rtmp://myserver/live/mystream live=1"
|
| 999 |
+
|
| 1000 |
+
rtp
|
| 1001 |
+
Real-time Transport Protocol.
|
| 1002 |
+
|
| 1003 |
+
The required syntax for an RTP URL is:
|
| 1004 |
+
rtp://hostname[:port][?option=val...]
|
| 1005 |
+
|
| 1006 |
+
port specifies the RTP port to use.
|
| 1007 |
+
|
| 1008 |
+
The following URL options are supported:
|
| 1009 |
+
|
| 1010 |
+
ttl=n
|
| 1011 |
+
Set the TTL (Time-To-Live) value (for multicast only).
|
| 1012 |
+
|
| 1013 |
+
rtcpport=n
|
| 1014 |
+
Set the remote RTCP port to n.
|
| 1015 |
+
|
| 1016 |
+
localrtpport=n
|
| 1017 |
+
Set the local RTP port to n.
|
| 1018 |
+
|
| 1019 |
+
localrtcpport=n'
|
| 1020 |
+
Set the local RTCP port to n.
|
| 1021 |
+
|
| 1022 |
+
pkt_size=n
|
| 1023 |
+
Set max packet size (in bytes) to n.
|
| 1024 |
+
|
| 1025 |
+
buffer_size=size
|
| 1026 |
+
Set the maximum UDP socket buffer size in bytes.
|
| 1027 |
+
|
| 1028 |
+
connect=0|1
|
| 1029 |
+
Do a "connect()" on the UDP socket (if set to 1) or not (if set to
|
| 1030 |
+
0).
|
| 1031 |
+
|
| 1032 |
+
sources=ip[,ip]
|
| 1033 |
+
List allowed source IP addresses.
|
| 1034 |
+
|
| 1035 |
+
block=ip[,ip]
|
| 1036 |
+
List disallowed (blocked) source IP addresses.
|
| 1037 |
+
|
| 1038 |
+
write_to_source=0|1
|
| 1039 |
+
Send packets to the source address of the latest received packet
|
| 1040 |
+
(if set to 1) or to a default remote address (if set to 0).
|
| 1041 |
+
|
| 1042 |
+
localport=n
|
| 1043 |
+
Set the local RTP port to n.
|
| 1044 |
+
|
| 1045 |
+
localaddr=addr
|
| 1046 |
+
Local IP address of a network interface used for sending packets or
|
| 1047 |
+
joining multicast groups.
|
| 1048 |
+
|
| 1049 |
+
timeout=n
|
| 1050 |
+
Set timeout (in microseconds) of socket I/O operations to n.
|
| 1051 |
+
|
| 1052 |
+
This is a deprecated option. Instead, localrtpport should be used.
|
| 1053 |
+
|
| 1054 |
+
Important notes:
|
| 1055 |
+
|
| 1056 |
+
1. If rtcpport is not set the RTCP port will be set to the RTP port
|
| 1057 |
+
value plus 1.
|
| 1058 |
+
|
| 1059 |
+
2. If localrtpport (the local RTP port) is not set any available port
|
| 1060 |
+
will be used for the local RTP and RTCP ports.
|
| 1061 |
+
|
| 1062 |
+
3. If localrtcpport (the local RTCP port) is not set it will be set to
|
| 1063 |
+
the local RTP port value plus 1.
|
| 1064 |
+
|
| 1065 |
+
rtsp
|
| 1066 |
+
Real-Time Streaming Protocol.
|
| 1067 |
+
|
| 1068 |
+
RTSP is not technically a protocol handler in libavformat, it is a
|
| 1069 |
+
demuxer and muxer. The demuxer supports both normal RTSP (with data
|
| 1070 |
+
transferred over RTP; this is used by e.g. Apple and Microsoft) and
|
| 1071 |
+
Real-RTSP (with data transferred over RDT).
|
| 1072 |
+
|
| 1073 |
+
The muxer can be used to send a stream using RTSP ANNOUNCE to a server
|
| 1074 |
+
supporting it (currently Darwin Streaming Server and Mischa
|
| 1075 |
+
Spiegelmock's <https://github.com/revmischa/rtsp-server>).
|
| 1076 |
+
|
| 1077 |
+
The required syntax for a RTSP url is:
|
| 1078 |
+
|
| 1079 |
+
rtsp://<hostname>[:<port>]/<path>
|
| 1080 |
+
|
| 1081 |
+
Options can be set on the ffmpeg/ffplay command line, or set in code
|
| 1082 |
+
via "AVOption"s or in "avformat_open_input".
|
| 1083 |
+
|
| 1084 |
+
Muxer
|
| 1085 |
+
|
| 1086 |
+
The following options are supported.
|
| 1087 |
+
|
| 1088 |
+
rtsp_transport
|
| 1089 |
+
Set RTSP transport protocols.
|
| 1090 |
+
|
| 1091 |
+
It accepts the following values:
|
| 1092 |
+
|
| 1093 |
+
udp Use UDP as lower transport protocol.
|
| 1094 |
+
|
| 1095 |
+
tcp Use TCP (interleaving within the RTSP control channel) as lower
|
| 1096 |
+
transport protocol.
|
| 1097 |
+
|
| 1098 |
+
Default value is 0.
|
| 1099 |
+
|
| 1100 |
+
rtsp_flags
|
| 1101 |
+
Set RTSP flags.
|
| 1102 |
+
|
| 1103 |
+
The following values are accepted:
|
| 1104 |
+
|
| 1105 |
+
latm
|
| 1106 |
+
Use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC.
|
| 1107 |
+
|
| 1108 |
+
rfc2190
|
| 1109 |
+
Use RFC 2190 packetization instead of RFC 4629 for H.263.
|
| 1110 |
+
|
| 1111 |
+
skip_rtcp
|
| 1112 |
+
Don't send RTCP sender reports.
|
| 1113 |
+
|
| 1114 |
+
h264_mode0
|
| 1115 |
+
Use mode 0 for H.264 in RTP.
|
| 1116 |
+
|
| 1117 |
+
send_bye
|
| 1118 |
+
Send RTCP BYE packets when finishing.
|
| 1119 |
+
|
| 1120 |
+
Default value is 0.
|
| 1121 |
+
|
| 1122 |
+
min_port
|
| 1123 |
+
Set minimum local UDP port. Default value is 5000.
|
| 1124 |
+
|
| 1125 |
+
max_port
|
| 1126 |
+
Set maximum local UDP port. Default value is 65000.
|
| 1127 |
+
|
| 1128 |
+
buffer_size
|
| 1129 |
+
Set the maximum socket buffer size in bytes.
|
| 1130 |
+
|
| 1131 |
+
pkt_size
|
| 1132 |
+
Set max send packet size (in bytes). Default value is 1472.
|
| 1133 |
+
|
| 1134 |
+
Demuxer
|
| 1135 |
+
|
| 1136 |
+
The following options are supported.
|
| 1137 |
+
|
| 1138 |
+
initial_pause
|
| 1139 |
+
Do not start playing the stream immediately if set to 1. Default
|
| 1140 |
+
value is 0.
|
| 1141 |
+
|
| 1142 |
+
rtsp_transport
|
| 1143 |
+
Set RTSP transport protocols.
|
| 1144 |
+
|
| 1145 |
+
It accepts the following values:
|
| 1146 |
+
|
| 1147 |
+
udp Use UDP as lower transport protocol.
|
| 1148 |
+
|
| 1149 |
+
tcp Use TCP (interleaving within the RTSP control channel) as lower
|
| 1150 |
+
transport protocol.
|
| 1151 |
+
|
| 1152 |
+
udp_multicast
|
| 1153 |
+
Use UDP multicast as lower transport protocol.
|
| 1154 |
+
|
| 1155 |
+
http
|
| 1156 |
+
Use HTTP tunneling as lower transport protocol, which is useful
|
| 1157 |
+
for passing proxies.
|
| 1158 |
+
|
| 1159 |
+
https
|
| 1160 |
+
Use HTTPs tunneling as lower transport protocol, which is
|
| 1161 |
+
useful for passing proxies and widely used for security
|
| 1162 |
+
consideration.
|
| 1163 |
+
|
| 1164 |
+
Multiple lower transport protocols may be specified, in that case
|
| 1165 |
+
they are tried one at a time (if the setup of one fails, the next
|
| 1166 |
+
one is tried). For the muxer, only the tcp and udp options are
|
| 1167 |
+
supported.
|
| 1168 |
+
|
| 1169 |
+
rtsp_flags
|
| 1170 |
+
Set RTSP flags.
|
| 1171 |
+
|
| 1172 |
+
The following values are accepted:
|
| 1173 |
+
|
| 1174 |
+
filter_src
|
| 1175 |
+
Accept packets only from negotiated peer address and port.
|
| 1176 |
+
|
| 1177 |
+
listen
|
| 1178 |
+
Act as a server, listening for an incoming connection.
|
| 1179 |
+
|
| 1180 |
+
prefer_tcp
|
| 1181 |
+
Try TCP for RTP transport first, if TCP is available as RTSP
|
| 1182 |
+
RTP transport.
|
| 1183 |
+
|
| 1184 |
+
satip_raw
|
| 1185 |
+
Export raw MPEG-TS stream instead of demuxing. The flag will
|
| 1186 |
+
simply write out the raw stream, with the original PAT/PMT/PIDs
|
| 1187 |
+
intact.
|
| 1188 |
+
|
| 1189 |
+
Default value is none.
|
| 1190 |
+
|
| 1191 |
+
allowed_media_types
|
| 1192 |
+
Set media types to accept from the server.
|
| 1193 |
+
|
| 1194 |
+
The following flags are accepted:
|
| 1195 |
+
|
| 1196 |
+
video
|
| 1197 |
+
audio
|
| 1198 |
+
data
|
| 1199 |
+
subtitle
|
| 1200 |
+
|
| 1201 |
+
By default it accepts all media types.
|
| 1202 |
+
|
| 1203 |
+
min_port
|
| 1204 |
+
Set minimum local UDP port. Default value is 5000.
|
| 1205 |
+
|
| 1206 |
+
max_port
|
| 1207 |
+
Set maximum local UDP port. Default value is 65000.
|
| 1208 |
+
|
| 1209 |
+
listen_timeout
|
| 1210 |
+
Set maximum timeout (in seconds) to establish an initial
|
| 1211 |
+
connection. Setting listen_timeout > 0 sets rtsp_flags to listen.
|
| 1212 |
+
Default is -1 which means an infinite timeout when listen mode is
|
| 1213 |
+
set.
|
| 1214 |
+
|
| 1215 |
+
reorder_queue_size
|
| 1216 |
+
Set number of packets to buffer for handling of reordered packets.
|
| 1217 |
+
|
| 1218 |
+
timeout
|
| 1219 |
+
Set socket TCP I/O timeout in microseconds.
|
| 1220 |
+
|
| 1221 |
+
user_agent
|
| 1222 |
+
Override User-Agent header. If not specified, it defaults to the
|
| 1223 |
+
libavformat identifier string.
|
| 1224 |
+
|
| 1225 |
+
buffer_size
|
| 1226 |
+
Set the maximum socket buffer size in bytes.
|
| 1227 |
+
|
| 1228 |
+
When receiving data over UDP, the demuxer tries to reorder received
|
| 1229 |
+
packets (since they may arrive out of order, or packets may get lost
|
| 1230 |
+
totally). This can be disabled by setting the maximum demuxing delay to
|
| 1231 |
+
zero (via the "max_delay" field of AVFormatContext).
|
| 1232 |
+
|
| 1233 |
+
When watching multi-bitrate Real-RTSP streams with ffplay, the streams
|
| 1234 |
+
to display can be chosen with "-vst" n and "-ast" n for video and audio
|
| 1235 |
+
respectively, and can be switched on the fly by pressing "v" and "a".
|
| 1236 |
+
|
| 1237 |
+
Examples
|
| 1238 |
+
|
| 1239 |
+
The following examples all make use of the ffplay and ffmpeg tools.
|
| 1240 |
+
|
| 1241 |
+
o Watch a stream over UDP, with a max reordering delay of 0.5
|
| 1242 |
+
seconds:
|
| 1243 |
+
|
| 1244 |
+
ffplay -max_delay 500000 -rtsp_transport udp rtsp://server/video.mp4
|
| 1245 |
+
|
| 1246 |
+
o Watch a stream tunneled over HTTP:
|
| 1247 |
+
|
| 1248 |
+
ffplay -rtsp_transport http rtsp://server/video.mp4
|
| 1249 |
+
|
| 1250 |
+
o Send a stream in realtime to a RTSP server, for others to watch:
|
| 1251 |
+
|
| 1252 |
+
ffmpeg -re -i <input> -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
|
| 1253 |
+
|
| 1254 |
+
o Receive a stream in realtime:
|
| 1255 |
+
|
| 1256 |
+
ffmpeg -rtsp_flags listen -i rtsp://ownaddress/live.sdp <output>
|
| 1257 |
+
|
| 1258 |
+
sap
|
| 1259 |
+
Session Announcement Protocol (RFC 2974). This is not technically a
|
| 1260 |
+
protocol handler in libavformat, it is a muxer and demuxer. It is used
|
| 1261 |
+
for signalling of RTP streams, by announcing the SDP for the streams
|
| 1262 |
+
regularly on a separate port.
|
| 1263 |
+
|
| 1264 |
+
Muxer
|
| 1265 |
+
|
| 1266 |
+
The syntax for a SAP url given to the muxer is:
|
| 1267 |
+
|
| 1268 |
+
sap://<destination>[:<port>][?<options>]
|
| 1269 |
+
|
| 1270 |
+
The RTP packets are sent to destination on port port, or to port 5004
|
| 1271 |
+
if no port is specified. options is a "&"-separated list. The
|
| 1272 |
+
following options are supported:
|
| 1273 |
+
|
| 1274 |
+
announce_addr=address
|
| 1275 |
+
Specify the destination IP address for sending the announcements
|
| 1276 |
+
to. If omitted, the announcements are sent to the commonly used
|
| 1277 |
+
SAP announcement multicast address 224.2.127.254 (sap.mcast.net),
|
| 1278 |
+
or ff0e::2:7ffe if destination is an IPv6 address.
|
| 1279 |
+
|
| 1280 |
+
announce_port=port
|
| 1281 |
+
Specify the port to send the announcements on, defaults to 9875 if
|
| 1282 |
+
not specified.
|
| 1283 |
+
|
| 1284 |
+
ttl=ttl
|
| 1285 |
+
Specify the time to live value for the announcements and RTP
|
| 1286 |
+
packets, defaults to 255.
|
| 1287 |
+
|
| 1288 |
+
same_port=0|1
|
| 1289 |
+
If set to 1, send all RTP streams on the same port pair. If zero
|
| 1290 |
+
(the default), all streams are sent on unique ports, with each
|
| 1291 |
+
stream on a port 2 numbers higher than the previous. VLC/Live555
|
| 1292 |
+
requires this to be set to 1, to be able to receive the stream.
|
| 1293 |
+
The RTP stack in libavformat for receiving requires all streams to
|
| 1294 |
+
be sent on unique ports.
|
| 1295 |
+
|
| 1296 |
+
Example command lines follow.
|
| 1297 |
+
|
| 1298 |
+
To broadcast a stream on the local subnet, for watching in VLC:
|
| 1299 |
+
|
| 1300 |
+
ffmpeg -re -i <input> -f sap sap://224.0.0.255?same_port=1
|
| 1301 |
+
|
| 1302 |
+
Similarly, for watching in ffplay:
|
| 1303 |
+
|
| 1304 |
+
ffmpeg -re -i <input> -f sap sap://224.0.0.255
|
| 1305 |
+
|
| 1306 |
+
And for watching in ffplay, over IPv6:
|
| 1307 |
+
|
| 1308 |
+
ffmpeg -re -i <input> -f sap sap://[ff0e::1:2:3:4]
|
| 1309 |
+
|
| 1310 |
+
Demuxer
|
| 1311 |
+
|
| 1312 |
+
The syntax for a SAP url given to the demuxer is:
|
| 1313 |
+
|
| 1314 |
+
sap://[<address>][:<port>]
|
| 1315 |
+
|
| 1316 |
+
address is the multicast address to listen for announcements on, if
|
| 1317 |
+
omitted, the default 224.2.127.254 (sap.mcast.net) is used. port is the
|
| 1318 |
+
port that is listened on, 9875 if omitted.
|
| 1319 |
+
|
| 1320 |
+
The demuxers listens for announcements on the given address and port.
|
| 1321 |
+
Once an announcement is received, it tries to receive that particular
|
| 1322 |
+
stream.
|
| 1323 |
+
|
| 1324 |
+
Example command lines follow.
|
| 1325 |
+
|
| 1326 |
+
To play back the first stream announced on the normal SAP multicast
|
| 1327 |
+
address:
|
| 1328 |
+
|
| 1329 |
+
ffplay sap://
|
| 1330 |
+
|
| 1331 |
+
To play back the first stream announced on one the default IPv6 SAP
|
| 1332 |
+
multicast address:
|
| 1333 |
+
|
| 1334 |
+
ffplay sap://[ff0e::2:7ffe]
|
| 1335 |
+
|
| 1336 |
+
sctp
|
| 1337 |
+
Stream Control Transmission Protocol.
|
| 1338 |
+
|
| 1339 |
+
The accepted URL syntax is:
|
| 1340 |
+
|
| 1341 |
+
sctp://<host>:<port>[?<options>]
|
| 1342 |
+
|
| 1343 |
+
The protocol accepts the following options:
|
| 1344 |
+
|
| 1345 |
+
listen
|
| 1346 |
+
If set to any value, listen for an incoming connection. Outgoing
|
| 1347 |
+
connection is done by default.
|
| 1348 |
+
|
| 1349 |
+
max_streams
|
| 1350 |
+
Set the maximum number of streams. By default no limit is set.
|
| 1351 |
+
|
| 1352 |
+
srt
|
| 1353 |
+
Haivision Secure Reliable Transport Protocol via libsrt.
|
| 1354 |
+
|
| 1355 |
+
The supported syntax for a SRT URL is:
|
| 1356 |
+
|
| 1357 |
+
srt://<hostname>:<port>[?<options>]
|
| 1358 |
+
|
| 1359 |
+
options contains a list of &-separated options of the form key=val.
|
| 1360 |
+
|
| 1361 |
+
or
|
| 1362 |
+
|
| 1363 |
+
<options> srt://<hostname>:<port>
|
| 1364 |
+
|
| 1365 |
+
options contains a list of '-key val' options.
|
| 1366 |
+
|
| 1367 |
+
This protocol accepts the following options.
|
| 1368 |
+
|
| 1369 |
+
connect_timeout=milliseconds
|
| 1370 |
+
Connection timeout; SRT cannot connect for RTT > 1500 msec (2
|
| 1371 |
+
handshake exchanges) with the default connect timeout of 3 seconds.
|
| 1372 |
+
This option applies to the caller and rendezvous connection modes.
|
| 1373 |
+
The connect timeout is 10 times the value set for the rendezvous
|
| 1374 |
+
mode (which can be used as a workaround for this connection problem
|
| 1375 |
+
with earlier versions).
|
| 1376 |
+
|
| 1377 |
+
ffs=bytes
|
| 1378 |
+
Flight Flag Size (Window Size), in bytes. FFS is actually an
|
| 1379 |
+
internal parameter and you should set it to not less than
|
| 1380 |
+
recv_buffer_size and mss. The default value is relatively large,
|
| 1381 |
+
therefore unless you set a very large receiver buffer, you do not
|
| 1382 |
+
need to change this option. Default value is 25600.
|
| 1383 |
+
|
| 1384 |
+
inputbw=bytes/seconds
|
| 1385 |
+
Sender nominal input rate, in bytes per seconds. Used along with
|
| 1386 |
+
oheadbw, when maxbw is set to relative (0), to calculate maximum
|
| 1387 |
+
sending rate when recovery packets are sent along with the main
|
| 1388 |
+
media stream: inputbw * (100 + oheadbw) / 100 if inputbw is not set
|
| 1389 |
+
while maxbw is set to relative (0), the actual input rate is
|
| 1390 |
+
evaluated inside the library. Default value is 0.
|
| 1391 |
+
|
| 1392 |
+
iptos=tos
|
| 1393 |
+
IP Type of Service. Applies to sender only. Default value is 0xB8.
|
| 1394 |
+
|
| 1395 |
+
ipttl=ttl
|
| 1396 |
+
IP Time To Live. Applies to sender only. Default value is 64.
|
| 1397 |
+
|
| 1398 |
+
latency=microseconds
|
| 1399 |
+
Timestamp-based Packet Delivery Delay. Used to absorb bursts of
|
| 1400 |
+
missed packet retransmissions. This flag sets both rcvlatency and
|
| 1401 |
+
peerlatency to the same value. Note that prior to version 1.3.0
|
| 1402 |
+
this is the only flag to set the latency, however this is
|
| 1403 |
+
effectively equivalent to setting peerlatency, when side is sender
|
| 1404 |
+
and rcvlatency when side is receiver, and the bidirectional stream
|
| 1405 |
+
sending is not supported.
|
| 1406 |
+
|
| 1407 |
+
listen_timeout=microseconds
|
| 1408 |
+
Set socket listen timeout.
|
| 1409 |
+
|
| 1410 |
+
maxbw=bytes/seconds
|
| 1411 |
+
Maximum sending bandwidth, in bytes per seconds. -1 infinite
|
| 1412 |
+
(CSRTCC limit is 30mbps) 0 relative to input rate (see inputbw) >0
|
| 1413 |
+
absolute limit value Default value is 0 (relative)
|
| 1414 |
+
|
| 1415 |
+
mode=caller|listener|rendezvous
|
| 1416 |
+
Connection mode. caller opens client connection. listener starts
|
| 1417 |
+
server to listen for incoming connections. rendezvous use Rendez-
|
| 1418 |
+
Vous connection mode. Default value is caller.
|
| 1419 |
+
|
| 1420 |
+
mss=bytes
|
| 1421 |
+
Maximum Segment Size, in bytes. Used for buffer allocation and rate
|
| 1422 |
+
calculation using a packet counter assuming fully filled packets.
|
| 1423 |
+
The smallest MSS between the peers is used. This is 1500 by default
|
| 1424 |
+
in the overall internet. This is the maximum size of the UDP
|
| 1425 |
+
packet and can be only decreased, unless you have some unusual
|
| 1426 |
+
dedicated network settings. Default value is 1500.
|
| 1427 |
+
|
| 1428 |
+
nakreport=1|0
|
| 1429 |
+
If set to 1, Receiver will send `UMSG_LOSSREPORT` messages
|
| 1430 |
+
periodically until a lost packet is retransmitted or intentionally
|
| 1431 |
+
dropped. Default value is 1.
|
| 1432 |
+
|
| 1433 |
+
oheadbw=percents
|
| 1434 |
+
Recovery bandwidth overhead above input rate, in percents. See
|
| 1435 |
+
inputbw. Default value is 25%.
|
| 1436 |
+
|
| 1437 |
+
passphrase=string
|
| 1438 |
+
HaiCrypt Encryption/Decryption Passphrase string, length from 10 to
|
| 1439 |
+
79 characters. The passphrase is the shared secret between the
|
| 1440 |
+
sender and the receiver. It is used to generate the Key Encrypting
|
| 1441 |
+
Key using PBKDF2 (Password-Based Key Derivation Function). It is
|
| 1442 |
+
used only if pbkeylen is non-zero. It is used on the receiver only
|
| 1443 |
+
if the received data is encrypted. The configured passphrase
|
| 1444 |
+
cannot be recovered (write-only).
|
| 1445 |
+
|
| 1446 |
+
enforced_encryption=1|0
|
| 1447 |
+
If true, both connection parties must have the same password set
|
| 1448 |
+
(including empty, that is, with no encryption). If the password
|
| 1449 |
+
doesn't match or only one side is unencrypted, the connection is
|
| 1450 |
+
rejected. Default is true.
|
| 1451 |
+
|
| 1452 |
+
kmrefreshrate=packets
|
| 1453 |
+
The number of packets to be transmitted after which the encryption
|
| 1454 |
+
key is switched to a new key. Default is -1. -1 means auto
|
| 1455 |
+
(0x1000000 in srt library). The range for this option is integers
|
| 1456 |
+
in the 0 - "INT_MAX".
|
| 1457 |
+
|
| 1458 |
+
kmpreannounce=packets
|
| 1459 |
+
The interval between when a new encryption key is sent and when
|
| 1460 |
+
switchover occurs. This value also applies to the subsequent
|
| 1461 |
+
interval between when switchover occurs and when the old encryption
|
| 1462 |
+
key is decommissioned. Default is -1. -1 means auto (0x1000 in srt
|
| 1463 |
+
library). The range for this option is integers in the 0 -
|
| 1464 |
+
"INT_MAX".
|
| 1465 |
+
|
| 1466 |
+
snddropdelay=microseconds
|
| 1467 |
+
The sender's extra delay before dropping packets. This delay is
|
| 1468 |
+
added to the default drop delay time interval value.
|
| 1469 |
+
|
| 1470 |
+
Special value -1: Do not drop packets on the sender at all.
|
| 1471 |
+
|
| 1472 |
+
payload_size=bytes
|
| 1473 |
+
Sets the maximum declared size of a packet transferred during the
|
| 1474 |
+
single call to the sending function in Live mode. Use 0 if this
|
| 1475 |
+
value isn't used (which is default in file mode). Default is -1
|
| 1476 |
+
(automatic), which typically means MPEG-TS; if you are going to use
|
| 1477 |
+
SRT to send any different kind of payload, such as, for example,
|
| 1478 |
+
wrapping a live stream in very small frames, then you can use a
|
| 1479 |
+
bigger maximum frame size, though not greater than 1456 bytes.
|
| 1480 |
+
|
| 1481 |
+
pkt_size=bytes
|
| 1482 |
+
Alias for payload_size.
|
| 1483 |
+
|
| 1484 |
+
peerlatency=microseconds
|
| 1485 |
+
The latency value (as described in rcvlatency) that is set by the
|
| 1486 |
+
sender side as a minimum value for the receiver.
|
| 1487 |
+
|
| 1488 |
+
pbkeylen=bytes
|
| 1489 |
+
Sender encryption key length, in bytes. Only can be set to 0, 16,
|
| 1490 |
+
24 and 32. Enable sender encryption if not 0. Not required on
|
| 1491 |
+
receiver (set to 0), key size obtained from sender in HaiCrypt
|
| 1492 |
+
handshake. Default value is 0.
|
| 1493 |
+
|
| 1494 |
+
rcvlatency=microseconds
|
| 1495 |
+
The time that should elapse since the moment when the packet was
|
| 1496 |
+
sent and the moment when it's delivered to the receiver application
|
| 1497 |
+
in the receiving function. This time should be a buffer time large
|
| 1498 |
+
enough to cover the time spent for sending, unexpectedly extended
|
| 1499 |
+
RTT time, and the time needed to retransmit the lost UDP packet.
|
| 1500 |
+
The effective latency value will be the maximum of this options'
|
| 1501 |
+
value and the value of peerlatency set by the peer side. Before
|
| 1502 |
+
version 1.3.0 this option is only available as latency.
|
| 1503 |
+
|
| 1504 |
+
recv_buffer_size=bytes
|
| 1505 |
+
Set UDP receive buffer size, expressed in bytes.
|
| 1506 |
+
|
| 1507 |
+
send_buffer_size=bytes
|
| 1508 |
+
Set UDP send buffer size, expressed in bytes.
|
| 1509 |
+
|
| 1510 |
+
timeout=microseconds
|
| 1511 |
+
Set raise error timeouts for read, write and connect operations.
|
| 1512 |
+
Note that the SRT library has internal timeouts which can be
|
| 1513 |
+
controlled separately, the value set here is only a cap on those.
|
| 1514 |
+
|
| 1515 |
+
tlpktdrop=1|0
|
| 1516 |
+
Too-late Packet Drop. When enabled on receiver, it skips missing
|
| 1517 |
+
packets that have not been delivered in time and delivers the
|
| 1518 |
+
following packets to the application when their time-to-play has
|
| 1519 |
+
come. It also sends a fake ACK to the sender. When enabled on
|
| 1520 |
+
sender and enabled on the receiving peer, the sender drops the
|
| 1521 |
+
older packets that have no chance of being delivered in time. It
|
| 1522 |
+
was automatically enabled in the sender if the receiver supports
|
| 1523 |
+
it.
|
| 1524 |
+
|
| 1525 |
+
sndbuf=bytes
|
| 1526 |
+
Set send buffer size, expressed in bytes.
|
| 1527 |
+
|
| 1528 |
+
rcvbuf=bytes
|
| 1529 |
+
Set receive buffer size, expressed in bytes.
|
| 1530 |
+
|
| 1531 |
+
Receive buffer must not be greater than ffs.
|
| 1532 |
+
|
| 1533 |
+
lossmaxttl=packets
|
| 1534 |
+
The value up to which the Reorder Tolerance may grow. When Reorder
|
| 1535 |
+
Tolerance is > 0, then packet loss report is delayed until that
|
| 1536 |
+
number of packets come in. Reorder Tolerance increases every time a
|
| 1537 |
+
"belated" packet has come, but it wasn't due to retransmission
|
| 1538 |
+
(that is, when UDP packets tend to come out of order), with the
|
| 1539 |
+
difference between the latest sequence and this packet's sequence,
|
| 1540 |
+
and not more than the value of this option. By default it's 0,
|
| 1541 |
+
which means that this mechanism is turned off, and the loss report
|
| 1542 |
+
is always sent immediately upon experiencing a "gap" in sequences.
|
| 1543 |
+
|
| 1544 |
+
minversion
|
| 1545 |
+
The minimum SRT version that is required from the peer. A
|
| 1546 |
+
connection to a peer that does not satisfy the minimum version
|
| 1547 |
+
requirement will be rejected.
|
| 1548 |
+
|
| 1549 |
+
The version format in hex is 0xXXYYZZ for x.y.z in human readable
|
| 1550 |
+
form.
|
| 1551 |
+
|
| 1552 |
+
streamid=string
|
| 1553 |
+
A string limited to 512 characters that can be set on the socket
|
| 1554 |
+
prior to connecting. This stream ID will be able to be retrieved by
|
| 1555 |
+
the listener side from the socket that is returned from srt_accept
|
| 1556 |
+
and was connected by a socket with that set stream ID. SRT does not
|
| 1557 |
+
enforce any special interpretation of the contents of this string.
|
| 1558 |
+
This option doesnXt make sense in Rendezvous connection; the result
|
| 1559 |
+
might be that simply one side will override the value from the
|
| 1560 |
+
other side and itXs the matter of luck which one would win
|
| 1561 |
+
|
| 1562 |
+
srt_streamid=string
|
| 1563 |
+
Alias for streamid to avoid conflict with ffmpeg command line
|
| 1564 |
+
option.
|
| 1565 |
+
|
| 1566 |
+
smoother=live|file
|
| 1567 |
+
The type of Smoother used for the transmission for that socket,
|
| 1568 |
+
which is responsible for the transmission and congestion control.
|
| 1569 |
+
The Smoother type must be exactly the same on both connecting
|
| 1570 |
+
parties, otherwise the connection is rejected.
|
| 1571 |
+
|
| 1572 |
+
messageapi=1|0
|
| 1573 |
+
When set, this socket uses the Message API, otherwise it uses
|
| 1574 |
+
Buffer API. Note that in live mode (see transtype) thereXs only
|
| 1575 |
+
message API available. In File mode you can chose to use one of two
|
| 1576 |
+
modes:
|
| 1577 |
+
|
| 1578 |
+
Stream API (default, when this option is false). In this mode you
|
| 1579 |
+
may send as many data as you wish with one sending instruction, or
|
| 1580 |
+
even use dedicated functions that read directly from a file. The
|
| 1581 |
+
internal facility will take care of any speed and congestion
|
| 1582 |
+
control. When receiving, you can also receive as many data as
|
| 1583 |
+
desired, the data not extracted will be waiting for the next call.
|
| 1584 |
+
There is no boundary between data portions in the Stream mode.
|
| 1585 |
+
|
| 1586 |
+
Message API. In this mode your single sending instruction passes
|
| 1587 |
+
exactly one piece of data that has boundaries (a message). Contrary
|
| 1588 |
+
to Live mode, this message may span across multiple UDP packets and
|
| 1589 |
+
the only size limitation is that it shall fit as a whole in the
|
| 1590 |
+
sending buffer. The receiver shall use as large buffer as necessary
|
| 1591 |
+
to receive the message, otherwise the message will not be given up.
|
| 1592 |
+
When the message is not complete (not all packets received or there
|
| 1593 |
+
was a packet loss) it will not be given up.
|
| 1594 |
+
|
| 1595 |
+
transtype=live|file
|
| 1596 |
+
Sets the transmission type for the socket, in particular, setting
|
| 1597 |
+
this option sets multiple other parameters to their default values
|
| 1598 |
+
as required for a particular transmission type.
|
| 1599 |
+
|
| 1600 |
+
live: Set options as for live transmission. In this mode, you
|
| 1601 |
+
should send by one sending instruction only so many data that fit
|
| 1602 |
+
in one UDP packet, and limited to the value defined first in
|
| 1603 |
+
payload_size (1316 is default in this mode). There is no speed
|
| 1604 |
+
control in this mode, only the bandwidth control, if configured, in
|
| 1605 |
+
order to not exceed the bandwidth with the overhead transmission
|
| 1606 |
+
(retransmitted and control packets).
|
| 1607 |
+
|
| 1608 |
+
file: Set options as for non-live transmission. See messageapi for
|
| 1609 |
+
further explanations
|
| 1610 |
+
|
| 1611 |
+
linger=seconds
|
| 1612 |
+
The number of seconds that the socket waits for unsent data when
|
| 1613 |
+
closing. Default is -1. -1 means auto (off with 0 seconds in live
|
| 1614 |
+
mode, on with 180 seconds in file mode). The range for this option
|
| 1615 |
+
is integers in the 0 - "INT_MAX".
|
| 1616 |
+
|
| 1617 |
+
tsbpd=1|0
|
| 1618 |
+
When true, use Timestamp-based Packet Delivery mode. The default
|
| 1619 |
+
behavior depends on the transmission type: enabled in live mode,
|
| 1620 |
+
disabled in file mode.
|
| 1621 |
+
|
| 1622 |
+
For more information see: <https://github.com/Haivision/srt>.
|
| 1623 |
+
|
| 1624 |
+
srtp
|
| 1625 |
+
Secure Real-time Transport Protocol.
|
| 1626 |
+
|
| 1627 |
+
The accepted options are:
|
| 1628 |
+
|
| 1629 |
+
srtp_in_suite
|
| 1630 |
+
srtp_out_suite
|
| 1631 |
+
Select input and output encoding suites.
|
| 1632 |
+
|
| 1633 |
+
Supported values:
|
| 1634 |
+
|
| 1635 |
+
AES_CM_128_HMAC_SHA1_80
|
| 1636 |
+
SRTP_AES128_CM_HMAC_SHA1_80
|
| 1637 |
+
AES_CM_128_HMAC_SHA1_32
|
| 1638 |
+
SRTP_AES128_CM_HMAC_SHA1_32
|
| 1639 |
+
srtp_in_params
|
| 1640 |
+
srtp_out_params
|
| 1641 |
+
Set input and output encoding parameters, which are expressed by a
|
| 1642 |
+
base64-encoded representation of a binary block. The first 16 bytes
|
| 1643 |
+
of this binary block are used as master key, the following 14 bytes
|
| 1644 |
+
are used as master salt.
|
| 1645 |
+
|
| 1646 |
+
subfile
|
| 1647 |
+
Virtually extract a segment of a file or another stream. The
|
| 1648 |
+
underlying stream must be seekable.
|
| 1649 |
+
|
| 1650 |
+
Accepted options:
|
| 1651 |
+
|
| 1652 |
+
start
|
| 1653 |
+
Start offset of the extracted segment, in bytes.
|
| 1654 |
+
|
| 1655 |
+
end End offset of the extracted segment, in bytes. If set to 0,
|
| 1656 |
+
extract till end of file.
|
| 1657 |
+
|
| 1658 |
+
Examples:
|
| 1659 |
+
|
| 1660 |
+
Extract a chapter from a DVD VOB file (start and end sectors obtained
|
| 1661 |
+
externally and multiplied by 2048):
|
| 1662 |
+
|
| 1663 |
+
subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB
|
| 1664 |
+
|
| 1665 |
+
Play an AVI file directly from a TAR archive:
|
| 1666 |
+
|
| 1667 |
+
subfile,,start,183241728,end,366490624,,:archive.tar
|
| 1668 |
+
|
| 1669 |
+
Play a MPEG-TS file from start offset till end:
|
| 1670 |
+
|
| 1671 |
+
subfile,,start,32815239,end,0,,:video.ts
|
| 1672 |
+
|
| 1673 |
+
tee
|
| 1674 |
+
Writes the output to multiple protocols. The individual outputs are
|
| 1675 |
+
separated by |
|
| 1676 |
+
|
| 1677 |
+
tee:file://path/to/local/this.avi|file://path/to/local/that.avi
|
| 1678 |
+
|
| 1679 |
+
tcp
|
| 1680 |
+
Transmission Control Protocol.
|
| 1681 |
+
|
| 1682 |
+
The required syntax for a TCP url is:
|
| 1683 |
+
|
| 1684 |
+
tcp://<hostname>:<port>[?<options>]
|
| 1685 |
+
|
| 1686 |
+
options contains a list of &-separated options of the form key=val.
|
| 1687 |
+
|
| 1688 |
+
The list of supported options follows.
|
| 1689 |
+
|
| 1690 |
+
listen=2|1|0
|
| 1691 |
+
Listen for an incoming connection. 0 disables listen, 1 enables
|
| 1692 |
+
listen in single client mode, 2 enables listen in multi-client
|
| 1693 |
+
mode. Default value is 0.
|
| 1694 |
+
|
| 1695 |
+
local_addr=addr
|
| 1696 |
+
Local IP address of a network interface used for tcp socket
|
| 1697 |
+
connect.
|
| 1698 |
+
|
| 1699 |
+
local_port=port
|
| 1700 |
+
Local port used for tcp socket connect.
|
| 1701 |
+
|
| 1702 |
+
timeout=microseconds
|
| 1703 |
+
Set raise error timeout, expressed in microseconds.
|
| 1704 |
+
|
| 1705 |
+
This option is only relevant in read mode: if no data arrived in
|
| 1706 |
+
more than this time interval, raise error.
|
| 1707 |
+
|
| 1708 |
+
listen_timeout=milliseconds
|
| 1709 |
+
Set listen timeout, expressed in milliseconds.
|
| 1710 |
+
|
| 1711 |
+
recv_buffer_size=bytes
|
| 1712 |
+
Set receive buffer size, expressed bytes.
|
| 1713 |
+
|
| 1714 |
+
send_buffer_size=bytes
|
| 1715 |
+
Set send buffer size, expressed bytes.
|
| 1716 |
+
|
| 1717 |
+
tcp_nodelay=1|0
|
| 1718 |
+
Set TCP_NODELAY to disable Nagle's algorithm. Default value is 0.
|
| 1719 |
+
|
| 1720 |
+
Remark: Writing to the socket is currently not optimized to
|
| 1721 |
+
minimize system calls and reduces the efficiency / effect of
|
| 1722 |
+
TCP_NODELAY.
|
| 1723 |
+
|
| 1724 |
+
tcp_mss=bytes
|
| 1725 |
+
Set maximum segment size for outgoing TCP packets, expressed in
|
| 1726 |
+
bytes.
|
| 1727 |
+
|
| 1728 |
+
The following example shows how to setup a listening TCP connection
|
| 1729 |
+
with ffmpeg, which is then accessed with ffplay:
|
| 1730 |
+
|
| 1731 |
+
ffmpeg -i <input> -f <format> tcp://<hostname>:<port>?listen
|
| 1732 |
+
ffplay tcp://<hostname>:<port>
|
| 1733 |
+
|
| 1734 |
+
tls
|
| 1735 |
+
Transport Layer Security (TLS) / Secure Sockets Layer (SSL)
|
| 1736 |
+
|
| 1737 |
+
The required syntax for a TLS/SSL url is:
|
| 1738 |
+
|
| 1739 |
+
tls://<hostname>:<port>[?<options>]
|
| 1740 |
+
|
| 1741 |
+
The following parameters can be set via command line options (or in
|
| 1742 |
+
code via "AVOption"s):
|
| 1743 |
+
|
| 1744 |
+
ca_file, cafile=filename
|
| 1745 |
+
A file containing certificate authority (CA) root certificates to
|
| 1746 |
+
treat as trusted. If the linked TLS library contains a default this
|
| 1747 |
+
might not need to be specified for verification to work, but not
|
| 1748 |
+
all libraries and setups have defaults built in. The file must be
|
| 1749 |
+
in OpenSSL PEM format.
|
| 1750 |
+
|
| 1751 |
+
tls_verify=1|0
|
| 1752 |
+
If enabled, try to verify the peer that we are communicating with.
|
| 1753 |
+
Note, if using OpenSSL, this currently only makes sure that the
|
| 1754 |
+
peer certificate is signed by one of the root certificates in the
|
| 1755 |
+
CA database, but it does not validate that the certificate actually
|
| 1756 |
+
matches the host name we are trying to connect to. (With other
|
| 1757 |
+
backends, the host name is validated as well.)
|
| 1758 |
+
|
| 1759 |
+
This is disabled by default since it requires a CA database to be
|
| 1760 |
+
provided by the caller in many cases.
|
| 1761 |
+
|
| 1762 |
+
cert_file, cert=filename
|
| 1763 |
+
A file containing a certificate to use in the handshake with the
|
| 1764 |
+
peer. (When operating as server, in listen mode, this is more
|
| 1765 |
+
often required by the peer, while client certificates only are
|
| 1766 |
+
mandated in certain setups.)
|
| 1767 |
+
|
| 1768 |
+
key_file, key=filename
|
| 1769 |
+
A file containing the private key for the certificate.
|
| 1770 |
+
|
| 1771 |
+
listen=1|0
|
| 1772 |
+
If enabled, listen for connections on the provided port, and assume
|
| 1773 |
+
the server role in the handshake instead of the client role.
|
| 1774 |
+
|
| 1775 |
+
http_proxy
|
| 1776 |
+
The HTTP proxy to tunnel through, e.g. "http://example.com:1234".
|
| 1777 |
+
The proxy must support the CONNECT method.
|
| 1778 |
+
|
| 1779 |
+
Example command lines:
|
| 1780 |
+
|
| 1781 |
+
To create a TLS/SSL server that serves an input stream.
|
| 1782 |
+
|
| 1783 |
+
ffmpeg -i <input> -f <format> tls://<hostname>:<port>?listen&cert=<server.crt>&key=<server.key>
|
| 1784 |
+
|
| 1785 |
+
To play back a stream from the TLS/SSL server using ffplay:
|
| 1786 |
+
|
| 1787 |
+
ffplay tls://<hostname>:<port>
|
| 1788 |
+
|
| 1789 |
+
udp
|
| 1790 |
+
User Datagram Protocol.
|
| 1791 |
+
|
| 1792 |
+
The required syntax for an UDP URL is:
|
| 1793 |
+
|
| 1794 |
+
udp://<hostname>:<port>[?<options>]
|
| 1795 |
+
|
| 1796 |
+
options contains a list of &-separated options of the form key=val.
|
| 1797 |
+
|
| 1798 |
+
In case threading is enabled on the system, a circular buffer is used
|
| 1799 |
+
to store the incoming data, which allows one to reduce loss of data due
|
| 1800 |
+
to UDP socket buffer overruns. The fifo_size and overrun_nonfatal
|
| 1801 |
+
options are related to this buffer.
|
| 1802 |
+
|
| 1803 |
+
The list of supported options follows.
|
| 1804 |
+
|
| 1805 |
+
buffer_size=size
|
| 1806 |
+
Set the UDP maximum socket buffer size in bytes. This is used to
|
| 1807 |
+
set either the receive or send buffer size, depending on what the
|
| 1808 |
+
socket is used for. Default is 32 KB for output, 384 KB for input.
|
| 1809 |
+
See also fifo_size.
|
| 1810 |
+
|
| 1811 |
+
bitrate=bitrate
|
| 1812 |
+
If set to nonzero, the output will have the specified constant
|
| 1813 |
+
bitrate if the input has enough packets to sustain it.
|
| 1814 |
+
|
| 1815 |
+
burst_bits=bits
|
| 1816 |
+
When using bitrate this specifies the maximum number of bits in
|
| 1817 |
+
packet bursts.
|
| 1818 |
+
|
| 1819 |
+
localport=port
|
| 1820 |
+
Override the local UDP port to bind with.
|
| 1821 |
+
|
| 1822 |
+
localaddr=addr
|
| 1823 |
+
Local IP address of a network interface used for sending packets or
|
| 1824 |
+
joining multicast groups.
|
| 1825 |
+
|
| 1826 |
+
pkt_size=size
|
| 1827 |
+
Set the size in bytes of UDP packets.
|
| 1828 |
+
|
| 1829 |
+
reuse=1|0
|
| 1830 |
+
Explicitly allow or disallow reusing UDP sockets.
|
| 1831 |
+
|
| 1832 |
+
ttl=ttl
|
| 1833 |
+
Set the time to live value (for multicast only).
|
| 1834 |
+
|
| 1835 |
+
connect=1|0
|
| 1836 |
+
Initialize the UDP socket with "connect()". In this case, the
|
| 1837 |
+
destination address can't be changed with ff_udp_set_remote_url
|
| 1838 |
+
later. If the destination address isn't known at the start, this
|
| 1839 |
+
option can be specified in ff_udp_set_remote_url, too. This allows
|
| 1840 |
+
finding out the source address for the packets with getsockname,
|
| 1841 |
+
and makes writes return with AVERROR(ECONNREFUSED) if "destination
|
| 1842 |
+
unreachable" is received. For receiving, this gives the benefit of
|
| 1843 |
+
only receiving packets from the specified peer address/port.
|
| 1844 |
+
|
| 1845 |
+
sources=address[,address]
|
| 1846 |
+
Only receive packets sent from the specified addresses. In case of
|
| 1847 |
+
multicast, also subscribe to multicast traffic coming from these
|
| 1848 |
+
addresses only.
|
| 1849 |
+
|
| 1850 |
+
block=address[,address]
|
| 1851 |
+
Ignore packets sent from the specified addresses. In case of
|
| 1852 |
+
multicast, also exclude the source addresses in the multicast
|
| 1853 |
+
subscription.
|
| 1854 |
+
|
| 1855 |
+
fifo_size=units
|
| 1856 |
+
Set the UDP receiving circular buffer size, expressed as a number
|
| 1857 |
+
of packets with size of 188 bytes. If not specified defaults to
|
| 1858 |
+
7*4096.
|
| 1859 |
+
|
| 1860 |
+
overrun_nonfatal=1|0
|
| 1861 |
+
Survive in case of UDP receiving circular buffer overrun. Default
|
| 1862 |
+
value is 0.
|
| 1863 |
+
|
| 1864 |
+
timeout=microseconds
|
| 1865 |
+
Set raise error timeout, expressed in microseconds.
|
| 1866 |
+
|
| 1867 |
+
This option is only relevant in read mode: if no data arrived in
|
| 1868 |
+
more than this time interval, raise error.
|
| 1869 |
+
|
| 1870 |
+
broadcast=1|0
|
| 1871 |
+
Explicitly allow or disallow UDP broadcasting.
|
| 1872 |
+
|
| 1873 |
+
Note that broadcasting may not work properly on networks having a
|
| 1874 |
+
broadcast storm protection.
|
| 1875 |
+
|
| 1876 |
+
Examples
|
| 1877 |
+
|
| 1878 |
+
o Use ffmpeg to stream over UDP to a remote endpoint:
|
| 1879 |
+
|
| 1880 |
+
ffmpeg -i <input> -f <format> udp://<hostname>:<port>
|
| 1881 |
+
|
| 1882 |
+
o Use ffmpeg to stream in mpegts format over UDP using 188 sized UDP
|
| 1883 |
+
packets, using a large input buffer:
|
| 1884 |
+
|
| 1885 |
+
ffmpeg -i <input> -f mpegts udp://<hostname>:<port>?pkt_size=188&buffer_size=65535
|
| 1886 |
+
|
| 1887 |
+
o Use ffmpeg to receive over UDP from a remote endpoint:
|
| 1888 |
+
|
| 1889 |
+
ffmpeg -i udp://[<multicast-address>]:<port> ...
|
| 1890 |
+
|
| 1891 |
+
unix
|
| 1892 |
+
Unix local socket
|
| 1893 |
+
|
| 1894 |
+
The required syntax for a Unix socket URL is:
|
| 1895 |
+
|
| 1896 |
+
unix://<filepath>
|
| 1897 |
+
|
| 1898 |
+
The following parameters can be set via command line options (or in
|
| 1899 |
+
code via "AVOption"s):
|
| 1900 |
+
|
| 1901 |
+
timeout
|
| 1902 |
+
Timeout in ms.
|
| 1903 |
+
|
| 1904 |
+
listen
|
| 1905 |
+
Create the Unix socket in listening mode.
|
| 1906 |
+
|
| 1907 |
+
zmq
|
| 1908 |
+
ZeroMQ asynchronous messaging using the libzmq library.
|
| 1909 |
+
|
| 1910 |
+
This library supports unicast streaming to multiple clients without
|
| 1911 |
+
relying on an external server.
|
| 1912 |
+
|
| 1913 |
+
The required syntax for streaming or connecting to a stream is:
|
| 1914 |
+
|
| 1915 |
+
zmq:tcp://ip-address:port
|
| 1916 |
+
|
| 1917 |
+
Example: Create a localhost stream on port 5555:
|
| 1918 |
+
|
| 1919 |
+
ffmpeg -re -i input -f mpegts zmq:tcp://127.0.0.1:5555
|
| 1920 |
+
|
| 1921 |
+
Multiple clients may connect to the stream using:
|
| 1922 |
+
|
| 1923 |
+
ffplay zmq:tcp://127.0.0.1:5555
|
| 1924 |
+
|
| 1925 |
+
Streaming to multiple clients is implemented using a ZeroMQ Pub-Sub
|
| 1926 |
+
pattern. The server side binds to a port and publishes data. Clients
|
| 1927 |
+
connect to the server (via IP address/port) and subscribe to the
|
| 1928 |
+
stream. The order in which the server and client start generally does
|
| 1929 |
+
not matter.
|
| 1930 |
+
|
| 1931 |
+
ffmpeg must be compiled with the --enable-libzmq option to support this
|
| 1932 |
+
protocol.
|
| 1933 |
+
|
| 1934 |
+
Options can be set on the ffmpeg/ffplay command line. The following
|
| 1935 |
+
options are supported:
|
| 1936 |
+
|
| 1937 |
+
pkt_size
|
| 1938 |
+
Forces the maximum packet size for sending/receiving data. The
|
| 1939 |
+
default value is 131,072 bytes. On the server side, this sets the
|
| 1940 |
+
maximum size of sent packets via ZeroMQ. On the clients, it sets an
|
| 1941 |
+
internal buffer size for receiving packets. Note that pkt_size on
|
| 1942 |
+
the clients should be equal to or greater than pkt_size on the
|
| 1943 |
+
server. Otherwise the received message may be truncated causing
|
| 1944 |
+
decoding errors.
|
| 1945 |
+
|
| 1946 |
+
SEE ALSO
|
| 1947 |
+
ffmpeg(1), ffplay(1), ffprobe(1), libavformat(3)
|
| 1948 |
+
|
| 1949 |
+
AUTHORS
|
| 1950 |
+
The FFmpeg developers.
|
| 1951 |
+
|
| 1952 |
+
For details about the authorship, see the Git history of the project
|
| 1953 |
+
(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command git log in
|
| 1954 |
+
the FFmpeg source directory, or browsing the online repository at
|
| 1955 |
+
<https://git.ffmpeg.org/ffmpeg>.
|
| 1956 |
+
|
| 1957 |
+
Maintainers for the specific components are listed in the file
|
| 1958 |
+
MAINTAINERS in the source code tree.
|
| 1959 |
+
|
| 1960 |
+
FFMPEG-PROTOCOLS(1)
|
pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffmpeg-resampler.txt
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FFMPEG-RESAMPLER(1) FFMPEG-RESAMPLER(1)
|
| 2 |
+
|
| 3 |
+
NAME
|
| 4 |
+
ffmpeg-resampler - FFmpeg Resampler
|
| 5 |
+
|
| 6 |
+
DESCRIPTION
|
| 7 |
+
The FFmpeg resampler provides a high-level interface to the
|
| 8 |
+
libswresample library audio resampling utilities. In particular it
|
| 9 |
+
allows one to perform audio resampling, audio channel layout
|
| 10 |
+
rematrixing, and convert audio format and packing layout.
|
| 11 |
+
|
| 12 |
+
RESAMPLER OPTIONS
|
| 13 |
+
The audio resampler supports the following named options.
|
| 14 |
+
|
| 15 |
+
Options may be set by specifying -option value in the FFmpeg tools,
|
| 16 |
+
option=value for the aresample filter, by setting the value explicitly
|
| 17 |
+
in the "SwrContext" options or using the libavutil/opt.h API for
|
| 18 |
+
programmatic use.
|
| 19 |
+
|
| 20 |
+
uchl, used_chlayout
|
| 21 |
+
Set used input channel layout. Default is unset. This option is
|
| 22 |
+
only used for special remapping.
|
| 23 |
+
|
| 24 |
+
isr, in_sample_rate
|
| 25 |
+
Set the input sample rate. Default value is 0.
|
| 26 |
+
|
| 27 |
+
osr, out_sample_rate
|
| 28 |
+
Set the output sample rate. Default value is 0.
|
| 29 |
+
|
| 30 |
+
isf, in_sample_fmt
|
| 31 |
+
Specify the input sample format. It is set by default to "none".
|
| 32 |
+
|
| 33 |
+
osf, out_sample_fmt
|
| 34 |
+
Specify the output sample format. It is set by default to "none".
|
| 35 |
+
|
| 36 |
+
tsf, internal_sample_fmt
|
| 37 |
+
Set the internal sample format. Default value is "none". This will
|
| 38 |
+
automatically be chosen when it is not explicitly set.
|
| 39 |
+
|
| 40 |
+
ichl, in_chlayout
|
| 41 |
+
ochl, out_chlayout
|
| 42 |
+
Set the input/output channel layout.
|
| 43 |
+
|
| 44 |
+
See the Channel Layout section in the ffmpeg-utils(1) manual for
|
| 45 |
+
the required syntax.
|
| 46 |
+
|
| 47 |
+
clev, center_mix_level
|
| 48 |
+
Set the center mix level. It is a value expressed in deciBel, and
|
| 49 |
+
must be in the interval [-32,32].
|
| 50 |
+
|
| 51 |
+
slev, surround_mix_level
|
| 52 |
+
Set the surround mix level. It is a value expressed in deciBel, and
|
| 53 |
+
must be in the interval [-32,32].
|
| 54 |
+
|
| 55 |
+
lfe_mix_level
|
| 56 |
+
Set LFE mix into non LFE level. It is used when there is a LFE
|
| 57 |
+
input but no LFE output. It is a value expressed in deciBel, and
|
| 58 |
+
must be in the interval [-32,32].
|
| 59 |
+
|
| 60 |
+
rmvol, rematrix_volume
|
| 61 |
+
Set rematrix volume. Default value is 1.0.
|
| 62 |
+
|
| 63 |
+
rematrix_maxval
|
| 64 |
+
Set maximum output value for rematrixing. This can be used to
|
| 65 |
+
prevent clipping vs. preventing volume reduction. A value of 1.0
|
| 66 |
+
prevents clipping.
|
| 67 |
+
|
| 68 |
+
flags, swr_flags
|
| 69 |
+
Set flags used by the converter. Default value is 0.
|
| 70 |
+
|
| 71 |
+
It supports the following individual flags:
|
| 72 |
+
|
| 73 |
+
res force resampling, this flag forces resampling to be used even
|
| 74 |
+
when the input and output sample rates match.
|
| 75 |
+
|
| 76 |
+
dither_scale
|
| 77 |
+
Set the dither scale. Default value is 1.
|
| 78 |
+
|
| 79 |
+
dither_method
|
| 80 |
+
Set dither method. Default value is 0.
|
| 81 |
+
|
| 82 |
+
Supported values:
|
| 83 |
+
|
| 84 |
+
rectangular
|
| 85 |
+
select rectangular dither
|
| 86 |
+
|
| 87 |
+
triangular
|
| 88 |
+
select triangular dither
|
| 89 |
+
|
| 90 |
+
triangular_hp
|
| 91 |
+
select triangular dither with high pass
|
| 92 |
+
|
| 93 |
+
lipshitz
|
| 94 |
+
select Lipshitz noise shaping dither.
|
| 95 |
+
|
| 96 |
+
shibata
|
| 97 |
+
select Shibata noise shaping dither.
|
| 98 |
+
|
| 99 |
+
low_shibata
|
| 100 |
+
select low Shibata noise shaping dither.
|
| 101 |
+
|
| 102 |
+
high_shibata
|
| 103 |
+
select high Shibata noise shaping dither.
|
| 104 |
+
|
| 105 |
+
f_weighted
|
| 106 |
+
select f-weighted noise shaping dither
|
| 107 |
+
|
| 108 |
+
modified_e_weighted
|
| 109 |
+
select modified-e-weighted noise shaping dither
|
| 110 |
+
|
| 111 |
+
improved_e_weighted
|
| 112 |
+
select improved-e-weighted noise shaping dither
|
| 113 |
+
|
| 114 |
+
resampler
|
| 115 |
+
Set resampling engine. Default value is swr.
|
| 116 |
+
|
| 117 |
+
Supported values:
|
| 118 |
+
|
| 119 |
+
swr select the native SW Resampler; filter options precision and
|
| 120 |
+
cheby are not applicable in this case.
|
| 121 |
+
|
| 122 |
+
soxr
|
| 123 |
+
select the SoX Resampler (where available); compensation, and
|
| 124 |
+
filter options filter_size, phase_shift, exact_rational,
|
| 125 |
+
filter_type & kaiser_beta, are not applicable in this case.
|
| 126 |
+
|
| 127 |
+
filter_size
|
| 128 |
+
For swr only, set resampling filter size, default value is 32.
|
| 129 |
+
|
| 130 |
+
phase_shift
|
| 131 |
+
For swr only, set resampling phase shift, default value is 10, and
|
| 132 |
+
must be in the interval [0,30].
|
| 133 |
+
|
| 134 |
+
linear_interp
|
| 135 |
+
Use linear interpolation when enabled (the default). Disable it if
|
| 136 |
+
you want to preserve speed instead of quality when exact_rational
|
| 137 |
+
fails.
|
| 138 |
+
|
| 139 |
+
exact_rational
|
| 140 |
+
For swr only, when enabled, try to use exact phase_count based on
|
| 141 |
+
input and output sample rate. However, if it is larger than "1 <<
|
| 142 |
+
phase_shift", the phase_count will be "1 << phase_shift" as
|
| 143 |
+
fallback. Default is enabled.
|
| 144 |
+
|
| 145 |
+
cutoff
|
| 146 |
+
Set cutoff frequency (swr: 6dB point; soxr: 0dB point) ratio; must
|
| 147 |
+
be a float value between 0 and 1. Default value is 0.97 with swr,
|
| 148 |
+
and 0.91 with soxr (which, with a sample-rate of 44100, preserves
|
| 149 |
+
the entire audio band to 20kHz).
|
| 150 |
+
|
| 151 |
+
precision
|
| 152 |
+
For soxr only, the precision in bits to which the resampled signal
|
| 153 |
+
will be calculated. The default value of 20 (which, with suitable
|
| 154 |
+
dithering, is appropriate for a destination bit-depth of 16) gives
|
| 155 |
+
SoX's 'High Quality'; a value of 28 gives SoX's 'Very High
|
| 156 |
+
Quality'.
|
| 157 |
+
|
| 158 |
+
cheby
|
| 159 |
+
For soxr only, selects passband rolloff none (Chebyshev) & higher-
|
| 160 |
+
precision approximation for 'irrational' ratios. Default value is
|
| 161 |
+
0.
|
| 162 |
+
|
| 163 |
+
async
|
| 164 |
+
For swr only, simple 1 parameter audio sync to timestamps using
|
| 165 |
+
stretching, squeezing, filling and trimming. Setting this to 1 will
|
| 166 |
+
enable filling and trimming, larger values represent the maximum
|
| 167 |
+
amount in samples that the data may be stretched or squeezed for
|
| 168 |
+
each second. Default value is 0, thus no compensation is applied
|
| 169 |
+
to make the samples match the audio timestamps.
|
| 170 |
+
|
| 171 |
+
first_pts
|
| 172 |
+
For swr only, assume the first pts should be this value. The time
|
| 173 |
+
unit is 1 / sample rate. This allows for padding/trimming at the
|
| 174 |
+
start of stream. By default, no assumption is made about the first
|
| 175 |
+
frame's expected pts, so no padding or trimming is done. For
|
| 176 |
+
example, this could be set to 0 to pad the beginning with silence
|
| 177 |
+
if an audio stream starts after the video stream or to trim any
|
| 178 |
+
samples with a negative pts due to encoder delay.
|
| 179 |
+
|
| 180 |
+
min_comp
|
| 181 |
+
For swr only, set the minimum difference between timestamps and
|
| 182 |
+
audio data (in seconds) to trigger stretching/squeezing/filling or
|
| 183 |
+
trimming of the data to make it match the timestamps. The default
|
| 184 |
+
is that stretching/squeezing/filling and trimming is disabled
|
| 185 |
+
(min_comp = "FLT_MAX").
|
| 186 |
+
|
| 187 |
+
min_hard_comp
|
| 188 |
+
For swr only, set the minimum difference between timestamps and
|
| 189 |
+
audio data (in seconds) to trigger adding/dropping samples to make
|
| 190 |
+
it match the timestamps. This option effectively is a threshold to
|
| 191 |
+
select between hard (trim/fill) and soft (squeeze/stretch)
|
| 192 |
+
compensation. Note that all compensation is by default disabled
|
| 193 |
+
through min_comp. The default is 0.1.
|
| 194 |
+
|
| 195 |
+
comp_duration
|
| 196 |
+
For swr only, set duration (in seconds) over which data is
|
| 197 |
+
stretched/squeezed to make it match the timestamps. Must be a non-
|
| 198 |
+
negative double float value, default value is 1.0.
|
| 199 |
+
|
| 200 |
+
max_soft_comp
|
| 201 |
+
For swr only, set maximum factor by which data is
|
| 202 |
+
stretched/squeezed to make it match the timestamps. Must be a non-
|
| 203 |
+
negative double float value, default value is 0.
|
| 204 |
+
|
| 205 |
+
matrix_encoding
|
| 206 |
+
Select matrixed stereo encoding.
|
| 207 |
+
|
| 208 |
+
It accepts the following values:
|
| 209 |
+
|
| 210 |
+
none
|
| 211 |
+
select none
|
| 212 |
+
|
| 213 |
+
dolby
|
| 214 |
+
select Dolby
|
| 215 |
+
|
| 216 |
+
dplii
|
| 217 |
+
select Dolby Pro Logic II
|
| 218 |
+
|
| 219 |
+
Default value is "none".
|
| 220 |
+
|
| 221 |
+
filter_type
|
| 222 |
+
For swr only, select resampling filter type. This only affects
|
| 223 |
+
resampling operations.
|
| 224 |
+
|
| 225 |
+
It accepts the following values:
|
| 226 |
+
|
| 227 |
+
cubic
|
| 228 |
+
select cubic
|
| 229 |
+
|
| 230 |
+
blackman_nuttall
|
| 231 |
+
select Blackman Nuttall windowed sinc
|
| 232 |
+
|
| 233 |
+
kaiser
|
| 234 |
+
select Kaiser windowed sinc
|
| 235 |
+
|
| 236 |
+
kaiser_beta
|
| 237 |
+
For swr only, set Kaiser window beta value. Must be a double float
|
| 238 |
+
value in the interval [2,16], default value is 9.
|
| 239 |
+
|
| 240 |
+
output_sample_bits
|
| 241 |
+
For swr only, set number of used output sample bits for dithering.
|
| 242 |
+
Must be an integer in the interval [0,64], default value is 0,
|
| 243 |
+
which means it's not used.
|
| 244 |
+
|
| 245 |
+
SEE ALSO
|
| 246 |
+
ffmpeg(1), ffplay(1), ffprobe(1), libswresample(3)
|
| 247 |
+
|
| 248 |
+
AUTHORS
|
| 249 |
+
The FFmpeg developers.
|
| 250 |
+
|
| 251 |
+
For details about the authorship, see the Git history of the project
|
| 252 |
+
(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command git log in
|
| 253 |
+
the FFmpeg source directory, or browsing the online repository at
|
| 254 |
+
<https://git.ffmpeg.org/ffmpeg>.
|
| 255 |
+
|
| 256 |
+
Maintainers for the specific components are listed in the file
|
| 257 |
+
MAINTAINERS in the source code tree.
|
| 258 |
+
|
| 259 |
+
FFMPEG-RESAMPLER(1)
|
pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffmpeg-scaler.txt
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FFMPEG-SCALER(1) FFMPEG-SCALER(1)
|
| 2 |
+
|
| 3 |
+
NAME
|
| 4 |
+
ffmpeg-scaler - FFmpeg video scaling and pixel format converter
|
| 5 |
+
|
| 6 |
+
DESCRIPTION
|
| 7 |
+
The FFmpeg rescaler provides a high-level interface to the libswscale
|
| 8 |
+
library image conversion utilities. In particular it allows one to
|
| 9 |
+
perform image rescaling and pixel format conversion.
|
| 10 |
+
|
| 11 |
+
SCALER OPTIONS
|
| 12 |
+
The video scaler supports the following named options.
|
| 13 |
+
|
| 14 |
+
Options may be set by specifying -option value in the FFmpeg tools,
|
| 15 |
+
with a few API-only exceptions noted below. For programmatic use, they
|
| 16 |
+
can be set explicitly in the "SwsContext" options or through the
|
| 17 |
+
libavutil/opt.h API.
|
| 18 |
+
|
| 19 |
+
sws_flags
|
| 20 |
+
Set the scaler flags. This is also used to set the scaling
|
| 21 |
+
algorithm. Only a single algorithm should be selected. Default
|
| 22 |
+
value is bicubic.
|
| 23 |
+
|
| 24 |
+
It accepts the following values:
|
| 25 |
+
|
| 26 |
+
fast_bilinear
|
| 27 |
+
Select fast bilinear scaling algorithm.
|
| 28 |
+
|
| 29 |
+
bilinear
|
| 30 |
+
Select bilinear scaling algorithm.
|
| 31 |
+
|
| 32 |
+
bicubic
|
| 33 |
+
Select bicubic scaling algorithm.
|
| 34 |
+
|
| 35 |
+
experimental
|
| 36 |
+
Select experimental scaling algorithm.
|
| 37 |
+
|
| 38 |
+
neighbor
|
| 39 |
+
Select nearest neighbor rescaling algorithm.
|
| 40 |
+
|
| 41 |
+
area
|
| 42 |
+
Select averaging area rescaling algorithm.
|
| 43 |
+
|
| 44 |
+
bicublin
|
| 45 |
+
Select bicubic scaling algorithm for the luma component,
|
| 46 |
+
bilinear for chroma components.
|
| 47 |
+
|
| 48 |
+
gauss
|
| 49 |
+
Select Gaussian rescaling algorithm.
|
| 50 |
+
|
| 51 |
+
sinc
|
| 52 |
+
Select sinc rescaling algorithm.
|
| 53 |
+
|
| 54 |
+
lanczos
|
| 55 |
+
Select Lanczos rescaling algorithm. The default width (alpha)
|
| 56 |
+
is 3 and can be changed by setting "param0".
|
| 57 |
+
|
| 58 |
+
spline
|
| 59 |
+
Select natural bicubic spline rescaling algorithm.
|
| 60 |
+
|
| 61 |
+
print_info
|
| 62 |
+
Enable printing/debug logging.
|
| 63 |
+
|
| 64 |
+
accurate_rnd
|
| 65 |
+
Enable accurate rounding.
|
| 66 |
+
|
| 67 |
+
full_chroma_int
|
| 68 |
+
Enable full chroma interpolation.
|
| 69 |
+
|
| 70 |
+
full_chroma_inp
|
| 71 |
+
Select full chroma input.
|
| 72 |
+
|
| 73 |
+
bitexact
|
| 74 |
+
Enable bitexact output.
|
| 75 |
+
|
| 76 |
+
srcw (API only)
|
| 77 |
+
Set source width.
|
| 78 |
+
|
| 79 |
+
srch (API only)
|
| 80 |
+
Set source height.
|
| 81 |
+
|
| 82 |
+
dstw (API only)
|
| 83 |
+
Set destination width.
|
| 84 |
+
|
| 85 |
+
dsth (API only)
|
| 86 |
+
Set destination height.
|
| 87 |
+
|
| 88 |
+
src_format (API only)
|
| 89 |
+
Set source pixel format (must be expressed as an integer).
|
| 90 |
+
|
| 91 |
+
dst_format (API only)
|
| 92 |
+
Set destination pixel format (must be expressed as an integer).
|
| 93 |
+
|
| 94 |
+
src_range (boolean)
|
| 95 |
+
If value is set to 1, indicates source is full range. Default value
|
| 96 |
+
is 0, which indicates source is limited range.
|
| 97 |
+
|
| 98 |
+
dst_range (boolean)
|
| 99 |
+
If value is set to 1, enable full range for destination. Default
|
| 100 |
+
value is 0, which enables limited range.
|
| 101 |
+
|
| 102 |
+
param0, param1
|
| 103 |
+
Set scaling algorithm parameters. The specified values are specific
|
| 104 |
+
of some scaling algorithms and ignored by others. The specified
|
| 105 |
+
values are floating point number values.
|
| 106 |
+
|
| 107 |
+
sws_dither
|
| 108 |
+
Set the dithering algorithm. Accepts one of the following values.
|
| 109 |
+
Default value is auto.
|
| 110 |
+
|
| 111 |
+
auto
|
| 112 |
+
automatic choice
|
| 113 |
+
|
| 114 |
+
none
|
| 115 |
+
no dithering
|
| 116 |
+
|
| 117 |
+
bayer
|
| 118 |
+
bayer dither
|
| 119 |
+
|
| 120 |
+
ed error diffusion dither
|
| 121 |
+
|
| 122 |
+
a_dither
|
| 123 |
+
arithmetic dither, based using addition
|
| 124 |
+
|
| 125 |
+
x_dither
|
| 126 |
+
arithmetic dither, based using xor (more random/less apparent
|
| 127 |
+
patterning that a_dither).
|
| 128 |
+
|
| 129 |
+
alphablend
|
| 130 |
+
Set the alpha blending to use when the input has alpha but the
|
| 131 |
+
output does not. Default value is none.
|
| 132 |
+
|
| 133 |
+
uniform_color
|
| 134 |
+
Blend onto a uniform background color
|
| 135 |
+
|
| 136 |
+
checkerboard
|
| 137 |
+
Blend onto a checkerboard
|
| 138 |
+
|
| 139 |
+
none
|
| 140 |
+
No blending
|
| 141 |
+
|
| 142 |
+
SEE ALSO
|
| 143 |
+
ffmpeg(1), ffplay(1), ffprobe(1), libswscale(3)
|
| 144 |
+
|
| 145 |
+
AUTHORS
|
| 146 |
+
The FFmpeg developers.
|
| 147 |
+
|
| 148 |
+
For details about the authorship, see the Git history of the project
|
| 149 |
+
(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command git log in
|
| 150 |
+
the FFmpeg source directory, or browsing the online repository at
|
| 151 |
+
<https://git.ffmpeg.org/ffmpeg>.
|
| 152 |
+
|
| 153 |
+
Maintainers for the specific components are listed in the file
|
| 154 |
+
MAINTAINERS in the source code tree.
|
| 155 |
+
|
| 156 |
+
FFMPEG-SCALER(1)
|
pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffmpeg-utils.txt
ADDED
|
@@ -0,0 +1,1267 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 5 |
+
|
| 6 |
+
DESCRIPTION
|
| 7 |
+
This document describes some generic features and utilities provided by
|
| 8 |
+
the libavutil library.
|
| 9 |
+
|
| 10 |
+
SYNTAX
|
| 11 |
+
This section documents the syntax and formats employed by the FFmpeg
|
| 12 |
+
libraries and tools.
|
| 13 |
+
|
| 14 |
+
Quoting and escaping
|
| 15 |
+
FFmpeg adopts the following quoting and escaping mechanism, unless
|
| 16 |
+
explicitly specified. The following rules are applied:
|
| 17 |
+
|
| 18 |
+
o ' and \ are special characters (respectively used for quoting and
|
| 19 |
+
escaping). In addition to them, there might be other special
|
| 20 |
+
characters depending on the specific syntax where the escaping and
|
| 21 |
+
quoting are employed.
|
| 22 |
+
|
| 23 |
+
o A special character is escaped by prefixing it with a \.
|
| 24 |
+
|
| 25 |
+
o All characters enclosed between '' are included literally in the
|
| 26 |
+
parsed string. The quote character ' itself cannot be quoted, so
|
| 27 |
+
you may need to close the quote and escape it.
|
| 28 |
+
|
| 29 |
+
o Leading and trailing whitespaces, unless escaped or quoted, are
|
| 30 |
+
removed from the parsed string.
|
| 31 |
+
|
| 32 |
+
Note that you may need to add a second level of escaping when using the
|
| 33 |
+
command line or a script, which depends on the syntax of the adopted
|
| 34 |
+
shell language.
|
| 35 |
+
|
| 36 |
+
The function "av_get_token" defined in libavutil/avstring.h can be used
|
| 37 |
+
to parse a token quoted or escaped according to the rules defined
|
| 38 |
+
above.
|
| 39 |
+
|
| 40 |
+
The tool tools/ffescape in the FFmpeg source tree can be used to
|
| 41 |
+
automatically quote or escape a string in a script.
|
| 42 |
+
|
| 43 |
+
Examples
|
| 44 |
+
|
| 45 |
+
o Escape the string "Crime d'Amour" containing the "'" special
|
| 46 |
+
character:
|
| 47 |
+
|
| 48 |
+
Crime d\'Amour
|
| 49 |
+
|
| 50 |
+
o The string above contains a quote, so the "'" needs to be escaped
|
| 51 |
+
when quoting it:
|
| 52 |
+
|
| 53 |
+
'Crime d'\''Amour'
|
| 54 |
+
|
| 55 |
+
o Include leading or trailing whitespaces using quoting:
|
| 56 |
+
|
| 57 |
+
' this string starts and ends with whitespaces '
|
| 58 |
+
|
| 59 |
+
o Escaping and quoting can be mixed together:
|
| 60 |
+
|
| 61 |
+
' The string '\'string\'' is a string '
|
| 62 |
+
|
| 63 |
+
o To include a literal \ you can use either escaping or quoting:
|
| 64 |
+
|
| 65 |
+
'c:\foo' can be written as c:\\foo
|
| 66 |
+
|
| 67 |
+
Date
|
| 68 |
+
The accepted syntax is:
|
| 69 |
+
|
| 70 |
+
[(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH:MM:SS[.m...]]])|(HHMMSS[.m...]]]))[Z]
|
| 71 |
+
now
|
| 72 |
+
|
| 73 |
+
If the value is "now" it takes the current time.
|
| 74 |
+
|
| 75 |
+
Time is local time unless Z is appended, in which case it is
|
| 76 |
+
interpreted as UTC. If the year-month-day part is not specified it
|
| 77 |
+
takes the current year-month-day.
|
| 78 |
+
|
| 79 |
+
Time duration
|
| 80 |
+
There are two accepted syntaxes for expressing time duration.
|
| 81 |
+
|
| 82 |
+
[-][<HH>:]<MM>:<SS>[.<m>...]
|
| 83 |
+
|
| 84 |
+
HH expresses the number of hours, MM the number of minutes for a
|
| 85 |
+
maximum of 2 digits, and SS the number of seconds for a maximum of 2
|
| 86 |
+
digits. The m at the end expresses decimal value for SS.
|
| 87 |
+
|
| 88 |
+
or
|
| 89 |
+
|
| 90 |
+
[-]<S>+[.<m>...][s|ms|us]
|
| 91 |
+
|
| 92 |
+
S expresses the number of seconds, with the optional decimal part m.
|
| 93 |
+
The optional literal suffixes s, ms or us indicate to interpret the
|
| 94 |
+
value as seconds, milliseconds or microseconds, respectively.
|
| 95 |
+
|
| 96 |
+
In both expressions, the optional - indicates negative duration.
|
| 97 |
+
|
| 98 |
+
Examples
|
| 99 |
+
|
| 100 |
+
The following examples are all valid time duration:
|
| 101 |
+
|
| 102 |
+
55 55 seconds
|
| 103 |
+
|
| 104 |
+
0.2 0.2 seconds
|
| 105 |
+
|
| 106 |
+
200ms
|
| 107 |
+
200 milliseconds, that's 0.2s
|
| 108 |
+
|
| 109 |
+
200000us
|
| 110 |
+
200000 microseconds, that's 0.2s
|
| 111 |
+
|
| 112 |
+
12:03:45
|
| 113 |
+
12 hours, 03 minutes and 45 seconds
|
| 114 |
+
|
| 115 |
+
23.189
|
| 116 |
+
23.189 seconds
|
| 117 |
+
|
| 118 |
+
Video size
|
| 119 |
+
Specify the size of the sourced video, it may be a string of the form
|
| 120 |
+
widthxheight, or the name of a size abbreviation.
|
| 121 |
+
|
| 122 |
+
The following abbreviations are recognized:
|
| 123 |
+
|
| 124 |
+
ntsc
|
| 125 |
+
720x480
|
| 126 |
+
|
| 127 |
+
pal 720x576
|
| 128 |
+
|
| 129 |
+
qntsc
|
| 130 |
+
352x240
|
| 131 |
+
|
| 132 |
+
qpal
|
| 133 |
+
352x288
|
| 134 |
+
|
| 135 |
+
sntsc
|
| 136 |
+
640x480
|
| 137 |
+
|
| 138 |
+
spal
|
| 139 |
+
768x576
|
| 140 |
+
|
| 141 |
+
film
|
| 142 |
+
352x240
|
| 143 |
+
|
| 144 |
+
ntsc-film
|
| 145 |
+
352x240
|
| 146 |
+
|
| 147 |
+
sqcif
|
| 148 |
+
128x96
|
| 149 |
+
|
| 150 |
+
qcif
|
| 151 |
+
176x144
|
| 152 |
+
|
| 153 |
+
cif 352x288
|
| 154 |
+
|
| 155 |
+
4cif
|
| 156 |
+
704x576
|
| 157 |
+
|
| 158 |
+
16cif
|
| 159 |
+
1408x1152
|
| 160 |
+
|
| 161 |
+
qqvga
|
| 162 |
+
160x120
|
| 163 |
+
|
| 164 |
+
qvga
|
| 165 |
+
320x240
|
| 166 |
+
|
| 167 |
+
vga 640x480
|
| 168 |
+
|
| 169 |
+
svga
|
| 170 |
+
800x600
|
| 171 |
+
|
| 172 |
+
xga 1024x768
|
| 173 |
+
|
| 174 |
+
uxga
|
| 175 |
+
1600x1200
|
| 176 |
+
|
| 177 |
+
qxga
|
| 178 |
+
2048x1536
|
| 179 |
+
|
| 180 |
+
sxga
|
| 181 |
+
1280x1024
|
| 182 |
+
|
| 183 |
+
qsxga
|
| 184 |
+
2560x2048
|
| 185 |
+
|
| 186 |
+
hsxga
|
| 187 |
+
5120x4096
|
| 188 |
+
|
| 189 |
+
wvga
|
| 190 |
+
852x480
|
| 191 |
+
|
| 192 |
+
wxga
|
| 193 |
+
1366x768
|
| 194 |
+
|
| 195 |
+
wsxga
|
| 196 |
+
1600x1024
|
| 197 |
+
|
| 198 |
+
wuxga
|
| 199 |
+
1920x1200
|
| 200 |
+
|
| 201 |
+
woxga
|
| 202 |
+
2560x1600
|
| 203 |
+
|
| 204 |
+
wqsxga
|
| 205 |
+
3200x2048
|
| 206 |
+
|
| 207 |
+
wquxga
|
| 208 |
+
3840x2400
|
| 209 |
+
|
| 210 |
+
whsxga
|
| 211 |
+
6400x4096
|
| 212 |
+
|
| 213 |
+
whuxga
|
| 214 |
+
7680x4800
|
| 215 |
+
|
| 216 |
+
cga 320x200
|
| 217 |
+
|
| 218 |
+
ega 640x350
|
| 219 |
+
|
| 220 |
+
hd480
|
| 221 |
+
852x480
|
| 222 |
+
|
| 223 |
+
hd720
|
| 224 |
+
1280x720
|
| 225 |
+
|
| 226 |
+
hd1080
|
| 227 |
+
1920x1080
|
| 228 |
+
|
| 229 |
+
2k 2048x1080
|
| 230 |
+
|
| 231 |
+
2kflat
|
| 232 |
+
1998x1080
|
| 233 |
+
|
| 234 |
+
2kscope
|
| 235 |
+
2048x858
|
| 236 |
+
|
| 237 |
+
4k 4096x2160
|
| 238 |
+
|
| 239 |
+
4kflat
|
| 240 |
+
3996x2160
|
| 241 |
+
|
| 242 |
+
4kscope
|
| 243 |
+
4096x1716
|
| 244 |
+
|
| 245 |
+
nhd 640x360
|
| 246 |
+
|
| 247 |
+
hqvga
|
| 248 |
+
240x160
|
| 249 |
+
|
| 250 |
+
wqvga
|
| 251 |
+
400x240
|
| 252 |
+
|
| 253 |
+
fwqvga
|
| 254 |
+
432x240
|
| 255 |
+
|
| 256 |
+
hvga
|
| 257 |
+
480x320
|
| 258 |
+
|
| 259 |
+
qhd 960x540
|
| 260 |
+
|
| 261 |
+
2kdci
|
| 262 |
+
2048x1080
|
| 263 |
+
|
| 264 |
+
4kdci
|
| 265 |
+
4096x2160
|
| 266 |
+
|
| 267 |
+
uhd2160
|
| 268 |
+
3840x2160
|
| 269 |
+
|
| 270 |
+
uhd4320
|
| 271 |
+
7680x4320
|
| 272 |
+
|
| 273 |
+
Video rate
|
| 274 |
+
Specify the frame rate of a video, expressed as the number of frames
|
| 275 |
+
generated per second. It has to be a string in the format
|
| 276 |
+
frame_rate_num/frame_rate_den, an integer number, a float number or a
|
| 277 |
+
valid video frame rate abbreviation.
|
| 278 |
+
|
| 279 |
+
The following abbreviations are recognized:
|
| 280 |
+
|
| 281 |
+
ntsc
|
| 282 |
+
30000/1001
|
| 283 |
+
|
| 284 |
+
pal 25/1
|
| 285 |
+
|
| 286 |
+
qntsc
|
| 287 |
+
30000/1001
|
| 288 |
+
|
| 289 |
+
qpal
|
| 290 |
+
25/1
|
| 291 |
+
|
| 292 |
+
sntsc
|
| 293 |
+
30000/1001
|
| 294 |
+
|
| 295 |
+
spal
|
| 296 |
+
25/1
|
| 297 |
+
|
| 298 |
+
film
|
| 299 |
+
24/1
|
| 300 |
+
|
| 301 |
+
ntsc-film
|
| 302 |
+
24000/1001
|
| 303 |
+
|
| 304 |
+
Ratio
|
| 305 |
+
A ratio can be expressed as an expression, or in the form
|
| 306 |
+
numerator:denominator.
|
| 307 |
+
|
| 308 |
+
Note that a ratio with infinite (1/0) or negative value is considered
|
| 309 |
+
valid, so you should check on the returned value if you want to exclude
|
| 310 |
+
those values.
|
| 311 |
+
|
| 312 |
+
The undefined value can be expressed using the "0:0" string.
|
| 313 |
+
|
| 314 |
+
Color
|
| 315 |
+
It can be the name of a color as defined below (case insensitive match)
|
| 316 |
+
or a "[0x|#]RRGGBB[AA]" sequence, possibly followed by @ and a string
|
| 317 |
+
representing the alpha component.
|
| 318 |
+
|
| 319 |
+
The alpha component may be a string composed by "0x" followed by an
|
| 320 |
+
hexadecimal number or a decimal number between 0.0 and 1.0, which
|
| 321 |
+
represents the opacity value (0x00 or 0.0 means completely transparent,
|
| 322 |
+
0xff or 1.0 completely opaque). If the alpha component is not specified
|
| 323 |
+
then 0xff is assumed.
|
| 324 |
+
|
| 325 |
+
The string random will result in a random color.
|
| 326 |
+
|
| 327 |
+
The following names of colors are recognized:
|
| 328 |
+
|
| 329 |
+
AliceBlue
|
| 330 |
+
0xF0F8FF
|
| 331 |
+
|
| 332 |
+
AntiqueWhite
|
| 333 |
+
0xFAEBD7
|
| 334 |
+
|
| 335 |
+
Aqua
|
| 336 |
+
0x00FFFF
|
| 337 |
+
|
| 338 |
+
Aquamarine
|
| 339 |
+
0x7FFFD4
|
| 340 |
+
|
| 341 |
+
Azure
|
| 342 |
+
0xF0FFFF
|
| 343 |
+
|
| 344 |
+
Beige
|
| 345 |
+
0xF5F5DC
|
| 346 |
+
|
| 347 |
+
Bisque
|
| 348 |
+
0xFFE4C4
|
| 349 |
+
|
| 350 |
+
Black
|
| 351 |
+
0x000000
|
| 352 |
+
|
| 353 |
+
BlanchedAlmond
|
| 354 |
+
0xFFEBCD
|
| 355 |
+
|
| 356 |
+
Blue
|
| 357 |
+
0x0000FF
|
| 358 |
+
|
| 359 |
+
BlueViolet
|
| 360 |
+
0x8A2BE2
|
| 361 |
+
|
| 362 |
+
Brown
|
| 363 |
+
0xA52A2A
|
| 364 |
+
|
| 365 |
+
BurlyWood
|
| 366 |
+
0xDEB887
|
| 367 |
+
|
| 368 |
+
CadetBlue
|
| 369 |
+
0x5F9EA0
|
| 370 |
+
|
| 371 |
+
Chartreuse
|
| 372 |
+
0x7FFF00
|
| 373 |
+
|
| 374 |
+
Chocolate
|
| 375 |
+
0xD2691E
|
| 376 |
+
|
| 377 |
+
Coral
|
| 378 |
+
0xFF7F50
|
| 379 |
+
|
| 380 |
+
CornflowerBlue
|
| 381 |
+
0x6495ED
|
| 382 |
+
|
| 383 |
+
Cornsilk
|
| 384 |
+
0xFFF8DC
|
| 385 |
+
|
| 386 |
+
Crimson
|
| 387 |
+
0xDC143C
|
| 388 |
+
|
| 389 |
+
Cyan
|
| 390 |
+
0x00FFFF
|
| 391 |
+
|
| 392 |
+
DarkBlue
|
| 393 |
+
0x00008B
|
| 394 |
+
|
| 395 |
+
DarkCyan
|
| 396 |
+
0x008B8B
|
| 397 |
+
|
| 398 |
+
DarkGoldenRod
|
| 399 |
+
0xB8860B
|
| 400 |
+
|
| 401 |
+
DarkGray
|
| 402 |
+
0xA9A9A9
|
| 403 |
+
|
| 404 |
+
DarkGreen
|
| 405 |
+
0x006400
|
| 406 |
+
|
| 407 |
+
DarkKhaki
|
| 408 |
+
0xBDB76B
|
| 409 |
+
|
| 410 |
+
DarkMagenta
|
| 411 |
+
0x8B008B
|
| 412 |
+
|
| 413 |
+
DarkOliveGreen
|
| 414 |
+
0x556B2F
|
| 415 |
+
|
| 416 |
+
Darkorange
|
| 417 |
+
0xFF8C00
|
| 418 |
+
|
| 419 |
+
DarkOrchid
|
| 420 |
+
0x9932CC
|
| 421 |
+
|
| 422 |
+
DarkRed
|
| 423 |
+
0x8B0000
|
| 424 |
+
|
| 425 |
+
DarkSalmon
|
| 426 |
+
0xE9967A
|
| 427 |
+
|
| 428 |
+
DarkSeaGreen
|
| 429 |
+
0x8FBC8F
|
| 430 |
+
|
| 431 |
+
DarkSlateBlue
|
| 432 |
+
0x483D8B
|
| 433 |
+
|
| 434 |
+
DarkSlateGray
|
| 435 |
+
0x2F4F4F
|
| 436 |
+
|
| 437 |
+
DarkTurquoise
|
| 438 |
+
0x00CED1
|
| 439 |
+
|
| 440 |
+
DarkViolet
|
| 441 |
+
0x9400D3
|
| 442 |
+
|
| 443 |
+
DeepPink
|
| 444 |
+
0xFF1493
|
| 445 |
+
|
| 446 |
+
DeepSkyBlue
|
| 447 |
+
0x00BFFF
|
| 448 |
+
|
| 449 |
+
DimGray
|
| 450 |
+
0x696969
|
| 451 |
+
|
| 452 |
+
DodgerBlue
|
| 453 |
+
0x1E90FF
|
| 454 |
+
|
| 455 |
+
FireBrick
|
| 456 |
+
0xB22222
|
| 457 |
+
|
| 458 |
+
FloralWhite
|
| 459 |
+
0xFFFAF0
|
| 460 |
+
|
| 461 |
+
ForestGreen
|
| 462 |
+
0x228B22
|
| 463 |
+
|
| 464 |
+
Fuchsia
|
| 465 |
+
0xFF00FF
|
| 466 |
+
|
| 467 |
+
Gainsboro
|
| 468 |
+
0xDCDCDC
|
| 469 |
+
|
| 470 |
+
GhostWhite
|
| 471 |
+
0xF8F8FF
|
| 472 |
+
|
| 473 |
+
Gold
|
| 474 |
+
0xFFD700
|
| 475 |
+
|
| 476 |
+
GoldenRod
|
| 477 |
+
0xDAA520
|
| 478 |
+
|
| 479 |
+
Gray
|
| 480 |
+
0x808080
|
| 481 |
+
|
| 482 |
+
Green
|
| 483 |
+
0x008000
|
| 484 |
+
|
| 485 |
+
GreenYellow
|
| 486 |
+
0xADFF2F
|
| 487 |
+
|
| 488 |
+
HoneyDew
|
| 489 |
+
0xF0FFF0
|
| 490 |
+
|
| 491 |
+
HotPink
|
| 492 |
+
0xFF69B4
|
| 493 |
+
|
| 494 |
+
IndianRed
|
| 495 |
+
0xCD5C5C
|
| 496 |
+
|
| 497 |
+
Indigo
|
| 498 |
+
0x4B0082
|
| 499 |
+
|
| 500 |
+
Ivory
|
| 501 |
+
0xFFFFF0
|
| 502 |
+
|
| 503 |
+
Khaki
|
| 504 |
+
0xF0E68C
|
| 505 |
+
|
| 506 |
+
Lavender
|
| 507 |
+
0xE6E6FA
|
| 508 |
+
|
| 509 |
+
LavenderBlush
|
| 510 |
+
0xFFF0F5
|
| 511 |
+
|
| 512 |
+
LawnGreen
|
| 513 |
+
0x7CFC00
|
| 514 |
+
|
| 515 |
+
LemonChiffon
|
| 516 |
+
0xFFFACD
|
| 517 |
+
|
| 518 |
+
LightBlue
|
| 519 |
+
0xADD8E6
|
| 520 |
+
|
| 521 |
+
LightCoral
|
| 522 |
+
0xF08080
|
| 523 |
+
|
| 524 |
+
LightCyan
|
| 525 |
+
0xE0FFFF
|
| 526 |
+
|
| 527 |
+
LightGoldenRodYellow
|
| 528 |
+
0xFAFAD2
|
| 529 |
+
|
| 530 |
+
LightGreen
|
| 531 |
+
0x90EE90
|
| 532 |
+
|
| 533 |
+
LightGrey
|
| 534 |
+
0xD3D3D3
|
| 535 |
+
|
| 536 |
+
LightPink
|
| 537 |
+
0xFFB6C1
|
| 538 |
+
|
| 539 |
+
LightSalmon
|
| 540 |
+
0xFFA07A
|
| 541 |
+
|
| 542 |
+
LightSeaGreen
|
| 543 |
+
0x20B2AA
|
| 544 |
+
|
| 545 |
+
LightSkyBlue
|
| 546 |
+
0x87CEFA
|
| 547 |
+
|
| 548 |
+
LightSlateGray
|
| 549 |
+
0x778899
|
| 550 |
+
|
| 551 |
+
LightSteelBlue
|
| 552 |
+
0xB0C4DE
|
| 553 |
+
|
| 554 |
+
LightYellow
|
| 555 |
+
0xFFFFE0
|
| 556 |
+
|
| 557 |
+
Lime
|
| 558 |
+
0x00FF00
|
| 559 |
+
|
| 560 |
+
LimeGreen
|
| 561 |
+
0x32CD32
|
| 562 |
+
|
| 563 |
+
Linen
|
| 564 |
+
0xFAF0E6
|
| 565 |
+
|
| 566 |
+
Magenta
|
| 567 |
+
0xFF00FF
|
| 568 |
+
|
| 569 |
+
Maroon
|
| 570 |
+
0x800000
|
| 571 |
+
|
| 572 |
+
MediumAquaMarine
|
| 573 |
+
0x66CDAA
|
| 574 |
+
|
| 575 |
+
MediumBlue
|
| 576 |
+
0x0000CD
|
| 577 |
+
|
| 578 |
+
MediumOrchid
|
| 579 |
+
0xBA55D3
|
| 580 |
+
|
| 581 |
+
MediumPurple
|
| 582 |
+
0x9370D8
|
| 583 |
+
|
| 584 |
+
MediumSeaGreen
|
| 585 |
+
0x3CB371
|
| 586 |
+
|
| 587 |
+
MediumSlateBlue
|
| 588 |
+
0x7B68EE
|
| 589 |
+
|
| 590 |
+
MediumSpringGreen
|
| 591 |
+
0x00FA9A
|
| 592 |
+
|
| 593 |
+
MediumTurquoise
|
| 594 |
+
0x48D1CC
|
| 595 |
+
|
| 596 |
+
MediumVioletRed
|
| 597 |
+
0xC71585
|
| 598 |
+
|
| 599 |
+
MidnightBlue
|
| 600 |
+
0x191970
|
| 601 |
+
|
| 602 |
+
MintCream
|
| 603 |
+
0xF5FFFA
|
| 604 |
+
|
| 605 |
+
MistyRose
|
| 606 |
+
0xFFE4E1
|
| 607 |
+
|
| 608 |
+
Moccasin
|
| 609 |
+
0xFFE4B5
|
| 610 |
+
|
| 611 |
+
NavajoWhite
|
| 612 |
+
0xFFDEAD
|
| 613 |
+
|
| 614 |
+
Navy
|
| 615 |
+
0x000080
|
| 616 |
+
|
| 617 |
+
OldLace
|
| 618 |
+
0xFDF5E6
|
| 619 |
+
|
| 620 |
+
Olive
|
| 621 |
+
0x808000
|
| 622 |
+
|
| 623 |
+
OliveDrab
|
| 624 |
+
0x6B8E23
|
| 625 |
+
|
| 626 |
+
Orange
|
| 627 |
+
0xFFA500
|
| 628 |
+
|
| 629 |
+
OrangeRed
|
| 630 |
+
0xFF4500
|
| 631 |
+
|
| 632 |
+
Orchid
|
| 633 |
+
0xDA70D6
|
| 634 |
+
|
| 635 |
+
PaleGoldenRod
|
| 636 |
+
0xEEE8AA
|
| 637 |
+
|
| 638 |
+
PaleGreen
|
| 639 |
+
0x98FB98
|
| 640 |
+
|
| 641 |
+
PaleTurquoise
|
| 642 |
+
0xAFEEEE
|
| 643 |
+
|
| 644 |
+
PaleVioletRed
|
| 645 |
+
0xD87093
|
| 646 |
+
|
| 647 |
+
PapayaWhip
|
| 648 |
+
0xFFEFD5
|
| 649 |
+
|
| 650 |
+
PeachPuff
|
| 651 |
+
0xFFDAB9
|
| 652 |
+
|
| 653 |
+
Peru
|
| 654 |
+
0xCD853F
|
| 655 |
+
|
| 656 |
+
Pink
|
| 657 |
+
0xFFC0CB
|
| 658 |
+
|
| 659 |
+
Plum
|
| 660 |
+
0xDDA0DD
|
| 661 |
+
|
| 662 |
+
PowderBlue
|
| 663 |
+
0xB0E0E6
|
| 664 |
+
|
| 665 |
+
Purple
|
| 666 |
+
0x800080
|
| 667 |
+
|
| 668 |
+
Red 0xFF0000
|
| 669 |
+
|
| 670 |
+
RosyBrown
|
| 671 |
+
0xBC8F8F
|
| 672 |
+
|
| 673 |
+
RoyalBlue
|
| 674 |
+
0x4169E1
|
| 675 |
+
|
| 676 |
+
SaddleBrown
|
| 677 |
+
0x8B4513
|
| 678 |
+
|
| 679 |
+
Salmon
|
| 680 |
+
0xFA8072
|
| 681 |
+
|
| 682 |
+
SandyBrown
|
| 683 |
+
0xF4A460
|
| 684 |
+
|
| 685 |
+
SeaGreen
|
| 686 |
+
0x2E8B57
|
| 687 |
+
|
| 688 |
+
SeaShell
|
| 689 |
+
0xFFF5EE
|
| 690 |
+
|
| 691 |
+
Sienna
|
| 692 |
+
0xA0522D
|
| 693 |
+
|
| 694 |
+
Silver
|
| 695 |
+
0xC0C0C0
|
| 696 |
+
|
| 697 |
+
SkyBlue
|
| 698 |
+
0x87CEEB
|
| 699 |
+
|
| 700 |
+
SlateBlue
|
| 701 |
+
0x6A5ACD
|
| 702 |
+
|
| 703 |
+
SlateGray
|
| 704 |
+
0x708090
|
| 705 |
+
|
| 706 |
+
Snow
|
| 707 |
+
0xFFFAFA
|
| 708 |
+
|
| 709 |
+
SpringGreen
|
| 710 |
+
0x00FF7F
|
| 711 |
+
|
| 712 |
+
SteelBlue
|
| 713 |
+
0x4682B4
|
| 714 |
+
|
| 715 |
+
Tan 0xD2B48C
|
| 716 |
+
|
| 717 |
+
Teal
|
| 718 |
+
0x008080
|
| 719 |
+
|
| 720 |
+
Thistle
|
| 721 |
+
0xD8BFD8
|
| 722 |
+
|
| 723 |
+
Tomato
|
| 724 |
+
0xFF6347
|
| 725 |
+
|
| 726 |
+
Turquoise
|
| 727 |
+
0x40E0D0
|
| 728 |
+
|
| 729 |
+
Violet
|
| 730 |
+
0xEE82EE
|
| 731 |
+
|
| 732 |
+
Wheat
|
| 733 |
+
0xF5DEB3
|
| 734 |
+
|
| 735 |
+
White
|
| 736 |
+
0xFFFFFF
|
| 737 |
+
|
| 738 |
+
WhiteSmoke
|
| 739 |
+
0xF5F5F5
|
| 740 |
+
|
| 741 |
+
Yellow
|
| 742 |
+
0xFFFF00
|
| 743 |
+
|
| 744 |
+
YellowGreen
|
| 745 |
+
0x9ACD32
|
| 746 |
+
|
| 747 |
+
Channel Layout
|
| 748 |
+
A channel layout specifies the spatial disposition of the channels in a
|
| 749 |
+
multi-channel audio stream. To specify a channel layout, FFmpeg makes
|
| 750 |
+
use of a special syntax.
|
| 751 |
+
|
| 752 |
+
Individual channels are identified by an id, as given by the table
|
| 753 |
+
below:
|
| 754 |
+
|
| 755 |
+
FL front left
|
| 756 |
+
|
| 757 |
+
FR front right
|
| 758 |
+
|
| 759 |
+
FC front center
|
| 760 |
+
|
| 761 |
+
LFE low frequency
|
| 762 |
+
|
| 763 |
+
BL back left
|
| 764 |
+
|
| 765 |
+
BR back right
|
| 766 |
+
|
| 767 |
+
FLC front left-of-center
|
| 768 |
+
|
| 769 |
+
FRC front right-of-center
|
| 770 |
+
|
| 771 |
+
BC back center
|
| 772 |
+
|
| 773 |
+
SL side left
|
| 774 |
+
|
| 775 |
+
SR side right
|
| 776 |
+
|
| 777 |
+
TC top center
|
| 778 |
+
|
| 779 |
+
TFL top front left
|
| 780 |
+
|
| 781 |
+
TFC top front center
|
| 782 |
+
|
| 783 |
+
TFR top front right
|
| 784 |
+
|
| 785 |
+
TBL top back left
|
| 786 |
+
|
| 787 |
+
TBC top back center
|
| 788 |
+
|
| 789 |
+
TBR top back right
|
| 790 |
+
|
| 791 |
+
DL downmix left
|
| 792 |
+
|
| 793 |
+
DR downmix right
|
| 794 |
+
|
| 795 |
+
WL wide left
|
| 796 |
+
|
| 797 |
+
WR wide right
|
| 798 |
+
|
| 799 |
+
SDL surround direct left
|
| 800 |
+
|
| 801 |
+
SDR surround direct right
|
| 802 |
+
|
| 803 |
+
LFE2
|
| 804 |
+
low frequency 2
|
| 805 |
+
|
| 806 |
+
Standard channel layout compositions can be specified by using the
|
| 807 |
+
following identifiers:
|
| 808 |
+
|
| 809 |
+
mono
|
| 810 |
+
FC
|
| 811 |
+
|
| 812 |
+
stereo
|
| 813 |
+
FL+FR
|
| 814 |
+
|
| 815 |
+
2.1 FL+FR+LFE
|
| 816 |
+
|
| 817 |
+
3.0 FL+FR+FC
|
| 818 |
+
|
| 819 |
+
3.0(back)
|
| 820 |
+
FL+FR+BC
|
| 821 |
+
|
| 822 |
+
4.0 FL+FR+FC+BC
|
| 823 |
+
|
| 824 |
+
quad
|
| 825 |
+
FL+FR+BL+BR
|
| 826 |
+
|
| 827 |
+
quad(side)
|
| 828 |
+
FL+FR+SL+SR
|
| 829 |
+
|
| 830 |
+
3.1 FL+FR+FC+LFE
|
| 831 |
+
|
| 832 |
+
5.0 FL+FR+FC+BL+BR
|
| 833 |
+
|
| 834 |
+
5.0(side)
|
| 835 |
+
FL+FR+FC+SL+SR
|
| 836 |
+
|
| 837 |
+
4.1 FL+FR+FC+LFE+BC
|
| 838 |
+
|
| 839 |
+
5.1 FL+FR+FC+LFE+BL+BR
|
| 840 |
+
|
| 841 |
+
5.1(side)
|
| 842 |
+
FL+FR+FC+LFE+SL+SR
|
| 843 |
+
|
| 844 |
+
6.0 FL+FR+FC+BC+SL+SR
|
| 845 |
+
|
| 846 |
+
6.0(front)
|
| 847 |
+
FL+FR+FLC+FRC+SL+SR
|
| 848 |
+
|
| 849 |
+
3.1.2
|
| 850 |
+
FL+FR+FC+LFE+TFL+TFR
|
| 851 |
+
|
| 852 |
+
hexagonal
|
| 853 |
+
FL+FR+FC+BL+BR+BC
|
| 854 |
+
|
| 855 |
+
6.1 FL+FR+FC+LFE+BC+SL+SR
|
| 856 |
+
|
| 857 |
+
6.1 FL+FR+FC+LFE+BL+BR+BC
|
| 858 |
+
|
| 859 |
+
6.1(front)
|
| 860 |
+
FL+FR+LFE+FLC+FRC+SL+SR
|
| 861 |
+
|
| 862 |
+
7.0 FL+FR+FC+BL+BR+SL+SR
|
| 863 |
+
|
| 864 |
+
7.0(front)
|
| 865 |
+
FL+FR+FC+FLC+FRC+SL+SR
|
| 866 |
+
|
| 867 |
+
7.1 FL+FR+FC+LFE+BL+BR+SL+SR
|
| 868 |
+
|
| 869 |
+
7.1(wide)
|
| 870 |
+
FL+FR+FC+LFE+BL+BR+FLC+FRC
|
| 871 |
+
|
| 872 |
+
7.1(wide-side)
|
| 873 |
+
FL+FR+FC+LFE+FLC+FRC+SL+SR
|
| 874 |
+
|
| 875 |
+
5.1.2
|
| 876 |
+
FL+FR+FC+LFE+BL+BR+TFL+TFR
|
| 877 |
+
|
| 878 |
+
octagonal
|
| 879 |
+
FL+FR+FC+BL+BR+BC+SL+SR
|
| 880 |
+
|
| 881 |
+
cube
|
| 882 |
+
FL+FR+BL+BR+TFL+TFR+TBL+TBR
|
| 883 |
+
|
| 884 |
+
5.1.4
|
| 885 |
+
FL+FR+FC+LFE+BL+BR+TFL+TFR+TBL+TBR
|
| 886 |
+
|
| 887 |
+
7.1.2
|
| 888 |
+
FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR
|
| 889 |
+
|
| 890 |
+
7.1.4
|
| 891 |
+
FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR+TBL+TBR
|
| 892 |
+
|
| 893 |
+
7.2.3
|
| 894 |
+
FL+FR+FC+LFE+BL+BR+SL+SR+TFL+TFR+TBC+LFE2
|
| 895 |
+
|
| 896 |
+
9.1.4
|
| 897 |
+
FL+FR+FC+LFE+BL+BR+FLC+FRC+SL+SR+TFL+TFR+TBL+TBR
|
| 898 |
+
|
| 899 |
+
hexadecagonal
|
| 900 |
+
FL+FR+FC+BL+BR+BC+SL+SR+WL+WR+TBL+TBR+TBC+TFC+TFL+TFR
|
| 901 |
+
|
| 902 |
+
downmix
|
| 903 |
+
DL+DR
|
| 904 |
+
|
| 905 |
+
22.2
|
| 906 |
+
FL+FR+FC+LFE+BL+BR+FLC+FRC+BC+SL+SR+TC+TFL+TFC+TFR+TBL+TBC+TBR+LFE2+TSL+TSR+BFC+BFL+BFR
|
| 907 |
+
|
| 908 |
+
A custom channel layout can be specified as a sequence of terms,
|
| 909 |
+
separated by '+'. Each term can be:
|
| 910 |
+
|
| 911 |
+
o the name of a single channel (e.g. FL, FR, FC, LFE, etc.), each
|
| 912 |
+
optionally containing a custom name after a '@', (e.g. FL@Left,
|
| 913 |
+
FR@Right, FC@Center, LFE@Low_Frequency, etc.)
|
| 914 |
+
|
| 915 |
+
A standard channel layout can be specified by the following:
|
| 916 |
+
|
| 917 |
+
o the name of a single channel (e.g. FL, FR, FC, LFE, etc.)
|
| 918 |
+
|
| 919 |
+
o the name of a standard channel layout (e.g. mono, stereo, 4.0,
|
| 920 |
+
quad, 5.0, etc.)
|
| 921 |
+
|
| 922 |
+
o a number of channels, in decimal, followed by 'c', yielding the
|
| 923 |
+
default channel layout for that number of channels (see the
|
| 924 |
+
function "av_channel_layout_default"). Note that not all channel
|
| 925 |
+
counts have a default layout.
|
| 926 |
+
|
| 927 |
+
o a number of channels, in decimal, followed by 'C', yielding an
|
| 928 |
+
unknown channel layout with the specified number of channels. Note
|
| 929 |
+
that not all channel layout specification strings support unknown
|
| 930 |
+
channel layouts.
|
| 931 |
+
|
| 932 |
+
o a channel layout mask, in hexadecimal starting with "0x" (see the
|
| 933 |
+
"AV_CH_*" macros in libavutil/channel_layout.h.
|
| 934 |
+
|
| 935 |
+
Before libavutil version 53 the trailing character "c" to specify a
|
| 936 |
+
number of channels was optional, but now it is required, while a
|
| 937 |
+
channel layout mask can also be specified as a decimal number (if and
|
| 938 |
+
only if not followed by "c" or "C").
|
| 939 |
+
|
| 940 |
+
See also the function "av_channel_layout_from_string" defined in
|
| 941 |
+
libavutil/channel_layout.h.
|
| 942 |
+
|
| 943 |
+
EXPRESSION EVALUATION
|
| 944 |
+
When evaluating an arithmetic expression, FFmpeg uses an internal
|
| 945 |
+
formula evaluator, implemented through the libavutil/eval.h interface.
|
| 946 |
+
|
| 947 |
+
An expression may contain unary, binary operators, constants, and
|
| 948 |
+
functions.
|
| 949 |
+
|
| 950 |
+
Two expressions expr1 and expr2 can be combined to form another
|
| 951 |
+
expression "expr1;expr2". expr1 and expr2 are evaluated in turn, and
|
| 952 |
+
the new expression evaluates to the value of expr2.
|
| 953 |
+
|
| 954 |
+
The following binary operators are available: "+", "-", "*", "/", "^".
|
| 955 |
+
|
| 956 |
+
The following unary operators are available: "+", "-".
|
| 957 |
+
|
| 958 |
+
The following functions are available:
|
| 959 |
+
|
| 960 |
+
abs(x)
|
| 961 |
+
Compute absolute value of x.
|
| 962 |
+
|
| 963 |
+
acos(x)
|
| 964 |
+
Compute arccosine of x.
|
| 965 |
+
|
| 966 |
+
asin(x)
|
| 967 |
+
Compute arcsine of x.
|
| 968 |
+
|
| 969 |
+
atan(x)
|
| 970 |
+
Compute arctangent of x.
|
| 971 |
+
|
| 972 |
+
atan2(y, x)
|
| 973 |
+
Compute principal value of the arc tangent of y/x.
|
| 974 |
+
|
| 975 |
+
between(x, min, max)
|
| 976 |
+
Return 1 if x is greater than or equal to min and lesser than or
|
| 977 |
+
equal to max, 0 otherwise.
|
| 978 |
+
|
| 979 |
+
bitand(x, y)
|
| 980 |
+
bitor(x, y)
|
| 981 |
+
Compute bitwise and/or operation on x and y.
|
| 982 |
+
|
| 983 |
+
The results of the evaluation of x and y are converted to integers
|
| 984 |
+
before executing the bitwise operation.
|
| 985 |
+
|
| 986 |
+
Note that both the conversion to integer and the conversion back to
|
| 987 |
+
floating point can lose precision. Beware of unexpected results for
|
| 988 |
+
large numbers (usually 2^53 and larger).
|
| 989 |
+
|
| 990 |
+
ceil(expr)
|
| 991 |
+
Round the value of expression expr upwards to the nearest integer.
|
| 992 |
+
For example, "ceil(1.5)" is "2.0".
|
| 993 |
+
|
| 994 |
+
clip(x, min, max)
|
| 995 |
+
Return the value of x clipped between min and max.
|
| 996 |
+
|
| 997 |
+
cos(x)
|
| 998 |
+
Compute cosine of x.
|
| 999 |
+
|
| 1000 |
+
cosh(x)
|
| 1001 |
+
Compute hyperbolic cosine of x.
|
| 1002 |
+
|
| 1003 |
+
eq(x, y)
|
| 1004 |
+
Return 1 if x and y are equivalent, 0 otherwise.
|
| 1005 |
+
|
| 1006 |
+
exp(x)
|
| 1007 |
+
Compute exponential of x (with base "e", the Euler's number).
|
| 1008 |
+
|
| 1009 |
+
floor(expr)
|
| 1010 |
+
Round the value of expression expr downwards to the nearest
|
| 1011 |
+
integer. For example, "floor(-1.5)" is "-2.0".
|
| 1012 |
+
|
| 1013 |
+
gauss(x)
|
| 1014 |
+
Compute Gauss function of x, corresponding to "exp(-x*x/2) /
|
| 1015 |
+
sqrt(2*PI)".
|
| 1016 |
+
|
| 1017 |
+
gcd(x, y)
|
| 1018 |
+
Return the greatest common divisor of x and y. If both x and y are
|
| 1019 |
+
0 or either or both are less than zero then behavior is undefined.
|
| 1020 |
+
|
| 1021 |
+
gt(x, y)
|
| 1022 |
+
Return 1 if x is greater than y, 0 otherwise.
|
| 1023 |
+
|
| 1024 |
+
gte(x, y)
|
| 1025 |
+
Return 1 if x is greater than or equal to y, 0 otherwise.
|
| 1026 |
+
|
| 1027 |
+
hypot(x, y)
|
| 1028 |
+
This function is similar to the C function with the same name; it
|
| 1029 |
+
returns "sqrt(x*x + y*y)", the length of the hypotenuse of a right
|
| 1030 |
+
triangle with sides of length x and y, or the distance of the point
|
| 1031 |
+
(x, y) from the origin.
|
| 1032 |
+
|
| 1033 |
+
if(x, y)
|
| 1034 |
+
Evaluate x, and if the result is non-zero return the result of the
|
| 1035 |
+
evaluation of y, return 0 otherwise.
|
| 1036 |
+
|
| 1037 |
+
if(x, y, z)
|
| 1038 |
+
Evaluate x, and if the result is non-zero return the evaluation
|
| 1039 |
+
result of y, otherwise the evaluation result of z.
|
| 1040 |
+
|
| 1041 |
+
ifnot(x, y)
|
| 1042 |
+
Evaluate x, and if the result is zero return the result of the
|
| 1043 |
+
evaluation of y, return 0 otherwise.
|
| 1044 |
+
|
| 1045 |
+
ifnot(x, y, z)
|
| 1046 |
+
Evaluate x, and if the result is zero return the evaluation result
|
| 1047 |
+
of y, otherwise the evaluation result of z.
|
| 1048 |
+
|
| 1049 |
+
isinf(x)
|
| 1050 |
+
Return 1.0 if x is +/-INFINITY, 0.0 otherwise.
|
| 1051 |
+
|
| 1052 |
+
isnan(x)
|
| 1053 |
+
Return 1.0 if x is NAN, 0.0 otherwise.
|
| 1054 |
+
|
| 1055 |
+
ld(var)
|
| 1056 |
+
Load the value of the internal variable with number var, which was
|
| 1057 |
+
previously stored with st(var, expr). The function returns the
|
| 1058 |
+
loaded value.
|
| 1059 |
+
|
| 1060 |
+
lerp(x, y, z)
|
| 1061 |
+
Return linear interpolation between x and y by amount of z.
|
| 1062 |
+
|
| 1063 |
+
log(x)
|
| 1064 |
+
Compute natural logarithm of x.
|
| 1065 |
+
|
| 1066 |
+
lt(x, y)
|
| 1067 |
+
Return 1 if x is lesser than y, 0 otherwise.
|
| 1068 |
+
|
| 1069 |
+
lte(x, y)
|
| 1070 |
+
Return 1 if x is lesser than or equal to y, 0 otherwise.
|
| 1071 |
+
|
| 1072 |
+
max(x, y)
|
| 1073 |
+
Return the maximum between x and y.
|
| 1074 |
+
|
| 1075 |
+
min(x, y)
|
| 1076 |
+
Return the minimum between x and y.
|
| 1077 |
+
|
| 1078 |
+
mod(x, y)
|
| 1079 |
+
Compute the remainder of division of x by y.
|
| 1080 |
+
|
| 1081 |
+
not(expr)
|
| 1082 |
+
Return 1.0 if expr is zero, 0.0 otherwise.
|
| 1083 |
+
|
| 1084 |
+
pow(x, y)
|
| 1085 |
+
Compute the power of x elevated y, it is equivalent to "(x)^(y)".
|
| 1086 |
+
|
| 1087 |
+
print(t)
|
| 1088 |
+
print(t, l)
|
| 1089 |
+
Print the value of expression t with loglevel l. If l is not
|
| 1090 |
+
specified then a default log level is used. Returns the value of
|
| 1091 |
+
the expression printed.
|
| 1092 |
+
|
| 1093 |
+
Prints t with loglevel l
|
| 1094 |
+
|
| 1095 |
+
random(idx)
|
| 1096 |
+
Return a pseudo random value between 0.0 and 1.0. idx is the index
|
| 1097 |
+
of the internal variable which will be used to save the seed/state.
|
| 1098 |
+
|
| 1099 |
+
randomi(idx, min, max)
|
| 1100 |
+
Return a pseudo random value in the interval between min and max.
|
| 1101 |
+
idx is the index of the internal variable which will be used to
|
| 1102 |
+
save the seed/state.
|
| 1103 |
+
|
| 1104 |
+
root(expr, max)
|
| 1105 |
+
Find an input value for which the function represented by expr with
|
| 1106 |
+
argument ld(0) is 0 in the interval 0..max.
|
| 1107 |
+
|
| 1108 |
+
The expression in expr must denote a continuous function or the
|
| 1109 |
+
result is undefined.
|
| 1110 |
+
|
| 1111 |
+
ld(0) is used to represent the function input value, which means
|
| 1112 |
+
that the given expression will be evaluated multiple times with
|
| 1113 |
+
various input values that the expression can access through ld(0).
|
| 1114 |
+
When the expression evaluates to 0 then the corresponding input
|
| 1115 |
+
value will be returned.
|
| 1116 |
+
|
| 1117 |
+
round(expr)
|
| 1118 |
+
Round the value of expression expr to the nearest integer. For
|
| 1119 |
+
example, "round(1.5)" is "2.0".
|
| 1120 |
+
|
| 1121 |
+
sgn(x)
|
| 1122 |
+
Compute sign of x.
|
| 1123 |
+
|
| 1124 |
+
sin(x)
|
| 1125 |
+
Compute sine of x.
|
| 1126 |
+
|
| 1127 |
+
sinh(x)
|
| 1128 |
+
Compute hyperbolic sine of x.
|
| 1129 |
+
|
| 1130 |
+
sqrt(expr)
|
| 1131 |
+
Compute the square root of expr. This is equivalent to "(expr)^.5".
|
| 1132 |
+
|
| 1133 |
+
squish(x)
|
| 1134 |
+
Compute expression "1/(1 + exp(4*x))".
|
| 1135 |
+
|
| 1136 |
+
st(var, expr)
|
| 1137 |
+
Store the value of the expression expr in an internal variable. var
|
| 1138 |
+
specifies the number of the variable where to store the value, and
|
| 1139 |
+
it is a value ranging from 0 to 9. The function returns the value
|
| 1140 |
+
stored in the internal variable. Note, Variables are currently not
|
| 1141 |
+
shared between expressions.
|
| 1142 |
+
|
| 1143 |
+
tan(x)
|
| 1144 |
+
Compute tangent of x.
|
| 1145 |
+
|
| 1146 |
+
tanh(x)
|
| 1147 |
+
Compute hyperbolic tangent of x.
|
| 1148 |
+
|
| 1149 |
+
taylor(expr, x)
|
| 1150 |
+
taylor(expr, x, id)
|
| 1151 |
+
Evaluate a Taylor series at x, given an expression representing the
|
| 1152 |
+
"ld(id)"-th derivative of a function at 0.
|
| 1153 |
+
|
| 1154 |
+
When the series does not converge the result is undefined.
|
| 1155 |
+
|
| 1156 |
+
ld(id) is used to represent the derivative order in expr, which
|
| 1157 |
+
means that the given expression will be evaluated multiple times
|
| 1158 |
+
with various input values that the expression can access through
|
| 1159 |
+
"ld(id)". If id is not specified then 0 is assumed.
|
| 1160 |
+
|
| 1161 |
+
Note, when you have the derivatives at y instead of 0,
|
| 1162 |
+
"taylor(expr, x-y)" can be used.
|
| 1163 |
+
|
| 1164 |
+
time(0)
|
| 1165 |
+
Return the current (wallclock) time in seconds.
|
| 1166 |
+
|
| 1167 |
+
trunc(expr)
|
| 1168 |
+
Round the value of expression expr towards zero to the nearest
|
| 1169 |
+
integer. For example, "trunc(-1.5)" is "-1.0".
|
| 1170 |
+
|
| 1171 |
+
while(cond, expr)
|
| 1172 |
+
Evaluate expression expr while the expression cond is non-zero, and
|
| 1173 |
+
returns the value of the last expr evaluation, or NAN if cond was
|
| 1174 |
+
always false.
|
| 1175 |
+
|
| 1176 |
+
The following constants are available:
|
| 1177 |
+
|
| 1178 |
+
PI area of the unit disc, approximately 3.14
|
| 1179 |
+
|
| 1180 |
+
E exp(1) (Euler's number), approximately 2.718
|
| 1181 |
+
|
| 1182 |
+
PHI golden ratio (1+sqrt(5))/2, approximately 1.618
|
| 1183 |
+
|
| 1184 |
+
Assuming that an expression is considered "true" if it has a non-zero
|
| 1185 |
+
value, note that:
|
| 1186 |
+
|
| 1187 |
+
"*" works like AND
|
| 1188 |
+
|
| 1189 |
+
"+" works like OR
|
| 1190 |
+
|
| 1191 |
+
For example the construct:
|
| 1192 |
+
|
| 1193 |
+
if (A AND B) then C
|
| 1194 |
+
|
| 1195 |
+
is equivalent to:
|
| 1196 |
+
|
| 1197 |
+
if(A*B, C)
|
| 1198 |
+
|
| 1199 |
+
In your C code, you can extend the list of unary and binary functions,
|
| 1200 |
+
and define recognized constants, so that they are available for your
|
| 1201 |
+
expressions.
|
| 1202 |
+
|
| 1203 |
+
The evaluator also recognizes the International System unit prefixes.
|
| 1204 |
+
If 'i' is appended after the prefix, binary prefixes are used, which
|
| 1205 |
+
are based on powers of 1024 instead of powers of 1000. The 'B' postfix
|
| 1206 |
+
multiplies the value by 8, and can be appended after a unit prefix or
|
| 1207 |
+
used alone. This allows using for example 'KB', 'MiB', 'G' and 'B' as
|
| 1208 |
+
number postfix.
|
| 1209 |
+
|
| 1210 |
+
The list of available International System prefixes follows, with
|
| 1211 |
+
indication of the corresponding powers of 10 and of 2.
|
| 1212 |
+
|
| 1213 |
+
y 10^-24 / 2^-80
|
| 1214 |
+
|
| 1215 |
+
z 10^-21 / 2^-70
|
| 1216 |
+
|
| 1217 |
+
a 10^-18 / 2^-60
|
| 1218 |
+
|
| 1219 |
+
f 10^-15 / 2^-50
|
| 1220 |
+
|
| 1221 |
+
p 10^-12 / 2^-40
|
| 1222 |
+
|
| 1223 |
+
n 10^-9 / 2^-30
|
| 1224 |
+
|
| 1225 |
+
u 10^-6 / 2^-20
|
| 1226 |
+
|
| 1227 |
+
m 10^-3 / 2^-10
|
| 1228 |
+
|
| 1229 |
+
c 10^-2
|
| 1230 |
+
|
| 1231 |
+
d 10^-1
|
| 1232 |
+
|
| 1233 |
+
h 10^2
|
| 1234 |
+
|
| 1235 |
+
k 10^3 / 2^10
|
| 1236 |
+
|
| 1237 |
+
K 10^3 / 2^10
|
| 1238 |
+
|
| 1239 |
+
M 10^6 / 2^20
|
| 1240 |
+
|
| 1241 |
+
G 10^9 / 2^30
|
| 1242 |
+
|
| 1243 |
+
T 10^12 / 2^40
|
| 1244 |
+
|
| 1245 |
+
P 10^15 / 2^50
|
| 1246 |
+
|
| 1247 |
+
E 10^18 / 2^60
|
| 1248 |
+
|
| 1249 |
+
Z 10^21 / 2^70
|
| 1250 |
+
|
| 1251 |
+
Y 10^24 / 2^80
|
| 1252 |
+
|
| 1253 |
+
SEE ALSO
|
| 1254 |
+
ffmpeg(1), ffplay(1), ffprobe(1), libavutil(3)
|
| 1255 |
+
|
| 1256 |
+
AUTHORS
|
| 1257 |
+
The FFmpeg developers.
|
| 1258 |
+
|
| 1259 |
+
For details about the authorship, see the Git history of the project
|
| 1260 |
+
(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command git log in
|
| 1261 |
+
the FFmpeg source directory, or browsing the online repository at
|
| 1262 |
+
<https://git.ffmpeg.org/ffmpeg>.
|
| 1263 |
+
|
| 1264 |
+
Maintainers for the specific components are listed in the file
|
| 1265 |
+
MAINTAINERS in the source code tree.
|
| 1266 |
+
|
| 1267 |
+
FFMPEG-UTILS(1)
|
pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffmpeg.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
pix2video-main/ffmpeg-7.0.2-i686-static/manpages/ffprobe.txt
ADDED
|
@@ -0,0 +1,1008 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FFPROBE(1) FFPROBE(1)
|
| 2 |
+
|
| 3 |
+
NAME
|
| 4 |
+
ffprobe - ffprobe media prober
|
| 5 |
+
|
| 6 |
+
SYNOPSIS
|
| 7 |
+
ffprobe [options] input_url
|
| 8 |
+
|
| 9 |
+
DESCRIPTION
|
| 10 |
+
ffprobe gathers information from multimedia streams and prints it in
|
| 11 |
+
human- and machine-readable fashion.
|
| 12 |
+
|
| 13 |
+
For example it can be used to check the format of the container used by
|
| 14 |
+
a multimedia stream and the format and type of each media stream
|
| 15 |
+
contained in it.
|
| 16 |
+
|
| 17 |
+
If a url is specified in input, ffprobe will try to open and probe the
|
| 18 |
+
url content. If the url cannot be opened or recognized as a multimedia
|
| 19 |
+
file, a positive exit code is returned.
|
| 20 |
+
|
| 21 |
+
If no output is specified as output with o ffprobe will write to
|
| 22 |
+
stdout.
|
| 23 |
+
|
| 24 |
+
ffprobe may be employed both as a standalone application or in
|
| 25 |
+
combination with a textual filter, which may perform more sophisticated
|
| 26 |
+
processing, e.g. statistical processing or plotting.
|
| 27 |
+
|
| 28 |
+
Options are used to list some of the formats supported by ffprobe or
|
| 29 |
+
for specifying which information to display, and for setting how
|
| 30 |
+
ffprobe will show it.
|
| 31 |
+
|
| 32 |
+
ffprobe output is designed to be easily parsable by a textual filter,
|
| 33 |
+
and consists of one or more sections of a form defined by the selected
|
| 34 |
+
writer, which is specified by the output_format option.
|
| 35 |
+
|
| 36 |
+
Sections may contain other nested sections, and are identified by a
|
| 37 |
+
name (which may be shared by other sections), and an unique name. See
|
| 38 |
+
the output of sections.
|
| 39 |
+
|
| 40 |
+
Metadata tags stored in the container or in the streams are recognized
|
| 41 |
+
and printed in the corresponding "FORMAT", "STREAM",
|
| 42 |
+
"STREAM_GROUP_STREAM" or "PROGRAM_STREAM" section.
|
| 43 |
+
|
| 44 |
+
OPTIONS
|
| 45 |
+
All the numerical options, if not specified otherwise, accept a string
|
| 46 |
+
representing a number as input, which may be followed by one of the SI
|
| 47 |
+
unit prefixes, for example: 'K', 'M', or 'G'.
|
| 48 |
+
|
| 49 |
+
If 'i' is appended to the SI unit prefix, the complete prefix will be
|
| 50 |
+
interpreted as a unit prefix for binary multiples, which are based on
|
| 51 |
+
powers of 1024 instead of powers of 1000. Appending 'B' to the SI unit
|
| 52 |
+
prefix multiplies the value by 8. This allows using, for example: 'KB',
|
| 53 |
+
'MiB', 'G' and 'B' as number suffixes.
|
| 54 |
+
|
| 55 |
+
Options which do not take arguments are boolean options, and set the
|
| 56 |
+
corresponding value to true. They can be set to false by prefixing the
|
| 57 |
+
option name with "no". For example using "-nofoo" will set the boolean
|
| 58 |
+
option with name "foo" to false.
|
| 59 |
+
|
| 60 |
+
Options that take arguments support a special syntax where the argument
|
| 61 |
+
given on the command line is interpreted as a path to the file from
|
| 62 |
+
which the actual argument value is loaded. To use this feature, add a
|
| 63 |
+
forward slash '/' immediately before the option name (after the leading
|
| 64 |
+
dash). E.g.
|
| 65 |
+
|
| 66 |
+
ffmpeg -i INPUT -/filter:v filter.script OUTPUT
|
| 67 |
+
|
| 68 |
+
will load a filtergraph description from the file named filter.script.
|
| 69 |
+
|
| 70 |
+
Stream specifiers
|
| 71 |
+
Some options are applied per-stream, e.g. bitrate or codec. Stream
|
| 72 |
+
specifiers are used to precisely specify which stream(s) a given option
|
| 73 |
+
belongs to.
|
| 74 |
+
|
| 75 |
+
A stream specifier is a string generally appended to the option name
|
| 76 |
+
and separated from it by a colon. E.g. "-codec:a:1 ac3" contains the
|
| 77 |
+
"a:1" stream specifier, which matches the second audio stream.
|
| 78 |
+
Therefore, it would select the ac3 codec for the second audio stream.
|
| 79 |
+
|
| 80 |
+
A stream specifier can match several streams, so that the option is
|
| 81 |
+
applied to all of them. E.g. the stream specifier in "-b:a 128k"
|
| 82 |
+
matches all audio streams.
|
| 83 |
+
|
| 84 |
+
An empty stream specifier matches all streams. For example, "-codec
|
| 85 |
+
copy" or "-codec: copy" would copy all the streams without reencoding.
|
| 86 |
+
|
| 87 |
+
Possible forms of stream specifiers are:
|
| 88 |
+
|
| 89 |
+
stream_index
|
| 90 |
+
Matches the stream with this index. E.g. "-threads:1 4" would set
|
| 91 |
+
the thread count for the second stream to 4. If stream_index is
|
| 92 |
+
used as an additional stream specifier (see below), then it selects
|
| 93 |
+
stream number stream_index from the matching streams. Stream
|
| 94 |
+
numbering is based on the order of the streams as detected by
|
| 95 |
+
libavformat except when a stream group specifier or program ID is
|
| 96 |
+
also specified. In this case it is based on the ordering of the
|
| 97 |
+
streams in the group or program.
|
| 98 |
+
|
| 99 |
+
stream_type[:additional_stream_specifier]
|
| 100 |
+
stream_type is one of following: 'v' or 'V' for video, 'a' for
|
| 101 |
+
audio, 's' for subtitle, 'd' for data, and 't' for attachments. 'v'
|
| 102 |
+
matches all video streams, 'V' only matches video streams which are
|
| 103 |
+
not attached pictures, video thumbnails or cover arts. If
|
| 104 |
+
additional_stream_specifier is used, then it matches streams which
|
| 105 |
+
both have this type and match the additional_stream_specifier.
|
| 106 |
+
Otherwise, it matches all streams of the specified type.
|
| 107 |
+
|
| 108 |
+
g:group_specifier[:additional_stream_specifier]
|
| 109 |
+
Matches streams which are in the group with the specifier
|
| 110 |
+
group_specifier. if additional_stream_specifier is used, then it
|
| 111 |
+
matches streams which both are part of the group and match the
|
| 112 |
+
additional_stream_specifier. group_specifier may be one of the
|
| 113 |
+
following:
|
| 114 |
+
|
| 115 |
+
group_index
|
| 116 |
+
Match the stream with this group index.
|
| 117 |
+
|
| 118 |
+
#group_id or i:group_id
|
| 119 |
+
Match the stream with this group id.
|
| 120 |
+
|
| 121 |
+
p:program_id[:additional_stream_specifier]
|
| 122 |
+
Matches streams which are in the program with the id program_id. If
|
| 123 |
+
additional_stream_specifier is used, then it matches streams which
|
| 124 |
+
both are part of the program and match the
|
| 125 |
+
additional_stream_specifier.
|
| 126 |
+
|
| 127 |
+
#stream_id or i:stream_id
|
| 128 |
+
Match the stream by stream id (e.g. PID in MPEG-TS container).
|
| 129 |
+
|
| 130 |
+
m:key[:value]
|
| 131 |
+
Matches streams with the metadata tag key having the specified
|
| 132 |
+
value. If value is not given, matches streams that contain the
|
| 133 |
+
given tag with any value.
|
| 134 |
+
|
| 135 |
+
u Matches streams with usable configuration, the codec must be
|
| 136 |
+
defined and the essential information such as video dimension or
|
| 137 |
+
audio sample rate must be present.
|
| 138 |
+
|
| 139 |
+
Note that in ffmpeg, matching by metadata will only work properly
|
| 140 |
+
for input files.
|
| 141 |
+
|
| 142 |
+
Generic options
|
| 143 |
+
These options are shared amongst the ff* tools.
|
| 144 |
+
|
| 145 |
+
-L Show license.
|
| 146 |
+
|
| 147 |
+
-h, -?, -help, --help [arg]
|
| 148 |
+
Show help. An optional parameter may be specified to print help
|
| 149 |
+
about a specific item. If no argument is specified, only basic (non
|
| 150 |
+
advanced) tool options are shown.
|
| 151 |
+
|
| 152 |
+
Possible values of arg are:
|
| 153 |
+
|
| 154 |
+
long
|
| 155 |
+
Print advanced tool options in addition to the basic tool
|
| 156 |
+
options.
|
| 157 |
+
|
| 158 |
+
full
|
| 159 |
+
Print complete list of options, including shared and private
|
| 160 |
+
options for encoders, decoders, demuxers, muxers, filters, etc.
|
| 161 |
+
|
| 162 |
+
decoder=decoder_name
|
| 163 |
+
Print detailed information about the decoder named
|
| 164 |
+
decoder_name. Use the -decoders option to get a list of all
|
| 165 |
+
decoders.
|
| 166 |
+
|
| 167 |
+
encoder=encoder_name
|
| 168 |
+
Print detailed information about the encoder named
|
| 169 |
+
encoder_name. Use the -encoders option to get a list of all
|
| 170 |
+
encoders.
|
| 171 |
+
|
| 172 |
+
demuxer=demuxer_name
|
| 173 |
+
Print detailed information about the demuxer named
|
| 174 |
+
demuxer_name. Use the -formats option to get a list of all
|
| 175 |
+
demuxers and muxers.
|
| 176 |
+
|
| 177 |
+
muxer=muxer_name
|
| 178 |
+
Print detailed information about the muxer named muxer_name.
|
| 179 |
+
Use the -formats option to get a list of all muxers and
|
| 180 |
+
demuxers.
|
| 181 |
+
|
| 182 |
+
filter=filter_name
|
| 183 |
+
Print detailed information about the filter named filter_name.
|
| 184 |
+
Use the -filters option to get a list of all filters.
|
| 185 |
+
|
| 186 |
+
bsf=bitstream_filter_name
|
| 187 |
+
Print detailed information about the bitstream filter named
|
| 188 |
+
bitstream_filter_name. Use the -bsfs option to get a list of
|
| 189 |
+
all bitstream filters.
|
| 190 |
+
|
| 191 |
+
protocol=protocol_name
|
| 192 |
+
Print detailed information about the protocol named
|
| 193 |
+
protocol_name. Use the -protocols option to get a list of all
|
| 194 |
+
protocols.
|
| 195 |
+
|
| 196 |
+
-version
|
| 197 |
+
Show version.
|
| 198 |
+
|
| 199 |
+
-buildconf
|
| 200 |
+
Show the build configuration, one option per line.
|
| 201 |
+
|
| 202 |
+
-formats
|
| 203 |
+
Show available formats (including devices).
|
| 204 |
+
|
| 205 |
+
-demuxers
|
| 206 |
+
Show available demuxers.
|
| 207 |
+
|
| 208 |
+
-muxers
|
| 209 |
+
Show available muxers.
|
| 210 |
+
|
| 211 |
+
-devices
|
| 212 |
+
Show available devices.
|
| 213 |
+
|
| 214 |
+
-codecs
|
| 215 |
+
Show all codecs known to libavcodec.
|
| 216 |
+
|
| 217 |
+
Note that the term 'codec' is used throughout this documentation as
|
| 218 |
+
a shortcut for what is more correctly called a media bitstream
|
| 219 |
+
format.
|
| 220 |
+
|
| 221 |
+
-decoders
|
| 222 |
+
Show available decoders.
|
| 223 |
+
|
| 224 |
+
-encoders
|
| 225 |
+
Show all available encoders.
|
| 226 |
+
|
| 227 |
+
-bsfs
|
| 228 |
+
Show available bitstream filters.
|
| 229 |
+
|
| 230 |
+
-protocols
|
| 231 |
+
Show available protocols.
|
| 232 |
+
|
| 233 |
+
-filters
|
| 234 |
+
Show available libavfilter filters.
|
| 235 |
+
|
| 236 |
+
-pix_fmts
|
| 237 |
+
Show available pixel formats.
|
| 238 |
+
|
| 239 |
+
-sample_fmts
|
| 240 |
+
Show available sample formats.
|
| 241 |
+
|
| 242 |
+
-layouts
|
| 243 |
+
Show channel names and standard channel layouts.
|
| 244 |
+
|
| 245 |
+
-dispositions
|
| 246 |
+
Show stream dispositions.
|
| 247 |
+
|
| 248 |
+
-colors
|
| 249 |
+
Show recognized color names.
|
| 250 |
+
|
| 251 |
+
-sources device[,opt1=val1[,opt2=val2]...]
|
| 252 |
+
Show autodetected sources of the input device. Some devices may
|
| 253 |
+
provide system-dependent source names that cannot be autodetected.
|
| 254 |
+
The returned list cannot be assumed to be always complete.
|
| 255 |
+
|
| 256 |
+
ffmpeg -sources pulse,server=192.168.0.4
|
| 257 |
+
|
| 258 |
+
-sinks device[,opt1=val1[,opt2=val2]...]
|
| 259 |
+
Show autodetected sinks of the output device. Some devices may
|
| 260 |
+
provide system-dependent sink names that cannot be autodetected.
|
| 261 |
+
The returned list cannot be assumed to be always complete.
|
| 262 |
+
|
| 263 |
+
ffmpeg -sinks pulse,server=192.168.0.4
|
| 264 |
+
|
| 265 |
+
-loglevel [flags+]loglevel | -v [flags+]loglevel
|
| 266 |
+
Set logging level and flags used by the library.
|
| 267 |
+
|
| 268 |
+
The optional flags prefix can consist of the following values:
|
| 269 |
+
|
| 270 |
+
repeat
|
| 271 |
+
Indicates that repeated log output should not be compressed to
|
| 272 |
+
the first line and the "Last message repeated n times" line
|
| 273 |
+
will be omitted.
|
| 274 |
+
|
| 275 |
+
level
|
| 276 |
+
Indicates that log output should add a "[level]" prefix to each
|
| 277 |
+
message line. This can be used as an alternative to log
|
| 278 |
+
coloring, e.g. when dumping the log to file.
|
| 279 |
+
|
| 280 |
+
Flags can also be used alone by adding a '+'/'-' prefix to
|
| 281 |
+
set/reset a single flag without affecting other flags or changing
|
| 282 |
+
loglevel. When setting both flags and loglevel, a '+' separator is
|
| 283 |
+
expected between the last flags value and before loglevel.
|
| 284 |
+
|
| 285 |
+
loglevel is a string or a number containing one of the following
|
| 286 |
+
values:
|
| 287 |
+
|
| 288 |
+
quiet, -8
|
| 289 |
+
Show nothing at all; be silent.
|
| 290 |
+
|
| 291 |
+
panic, 0
|
| 292 |
+
Only show fatal errors which could lead the process to crash,
|
| 293 |
+
such as an assertion failure. This is not currently used for
|
| 294 |
+
anything.
|
| 295 |
+
|
| 296 |
+
fatal, 8
|
| 297 |
+
Only show fatal errors. These are errors after which the
|
| 298 |
+
process absolutely cannot continue.
|
| 299 |
+
|
| 300 |
+
error, 16
|
| 301 |
+
Show all errors, including ones which can be recovered from.
|
| 302 |
+
|
| 303 |
+
warning, 24
|
| 304 |
+
Show all warnings and errors. Any message related to possibly
|
| 305 |
+
incorrect or unexpected events will be shown.
|
| 306 |
+
|
| 307 |
+
info, 32
|
| 308 |
+
Show informative messages during processing. This is in
|
| 309 |
+
addition to warnings and errors. This is the default value.
|
| 310 |
+
|
| 311 |
+
verbose, 40
|
| 312 |
+
Same as "info", except more verbose.
|
| 313 |
+
|
| 314 |
+
debug, 48
|
| 315 |
+
Show everything, including debugging information.
|
| 316 |
+
|
| 317 |
+
trace, 56
|
| 318 |
+
|
| 319 |
+
For example to enable repeated log output, add the "level" prefix,
|
| 320 |
+
and set loglevel to "verbose":
|
| 321 |
+
|
| 322 |
+
ffmpeg -loglevel repeat+level+verbose -i input output
|
| 323 |
+
|
| 324 |
+
Another example that enables repeated log output without affecting
|
| 325 |
+
current state of "level" prefix flag or loglevel:
|
| 326 |
+
|
| 327 |
+
ffmpeg [...] -loglevel +repeat
|
| 328 |
+
|
| 329 |
+
By default the program logs to stderr. If coloring is supported by
|
| 330 |
+
the terminal, colors are used to mark errors and warnings. Log
|
| 331 |
+
coloring can be disabled setting the environment variable
|
| 332 |
+
AV_LOG_FORCE_NOCOLOR, or can be forced setting the environment
|
| 333 |
+
variable AV_LOG_FORCE_COLOR.
|
| 334 |
+
|
| 335 |
+
-report
|
| 336 |
+
Dump full command line and log output to a file named
|
| 337 |
+
"program-YYYYMMDD-HHMMSS.log" in the current directory. This file
|
| 338 |
+
can be useful for bug reports. It also implies "-loglevel debug".
|
| 339 |
+
|
| 340 |
+
Setting the environment variable FFREPORT to any value has the same
|
| 341 |
+
effect. If the value is a ':'-separated key=value sequence, these
|
| 342 |
+
options will affect the report; option values must be escaped if
|
| 343 |
+
they contain special characters or the options delimiter ':' (see
|
| 344 |
+
the ``Quoting and escaping'' section in the ffmpeg-utils manual).
|
| 345 |
+
|
| 346 |
+
The following options are recognized:
|
| 347 |
+
|
| 348 |
+
file
|
| 349 |
+
set the file name to use for the report; %p is expanded to the
|
| 350 |
+
name of the program, %t is expanded to a timestamp, "%%" is
|
| 351 |
+
expanded to a plain "%"
|
| 352 |
+
|
| 353 |
+
level
|
| 354 |
+
set the log verbosity level using a numerical value (see
|
| 355 |
+
"-loglevel").
|
| 356 |
+
|
| 357 |
+
For example, to output a report to a file named ffreport.log using
|
| 358 |
+
a log level of 32 (alias for log level "info"):
|
| 359 |
+
|
| 360 |
+
FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
|
| 361 |
+
|
| 362 |
+
Errors in parsing the environment variable are not fatal, and will
|
| 363 |
+
not appear in the report.
|
| 364 |
+
|
| 365 |
+
-hide_banner
|
| 366 |
+
Suppress printing banner.
|
| 367 |
+
|
| 368 |
+
All FFmpeg tools will normally show a copyright notice, build
|
| 369 |
+
options and library versions. This option can be used to suppress
|
| 370 |
+
printing this information.
|
| 371 |
+
|
| 372 |
+
-cpuflags flags (global)
|
| 373 |
+
Allows setting and clearing cpu flags. This option is intended for
|
| 374 |
+
testing. Do not use it unless you know what you're doing.
|
| 375 |
+
|
| 376 |
+
ffmpeg -cpuflags -sse+mmx ...
|
| 377 |
+
ffmpeg -cpuflags mmx ...
|
| 378 |
+
ffmpeg -cpuflags 0 ...
|
| 379 |
+
|
| 380 |
+
Possible flags for this option are:
|
| 381 |
+
|
| 382 |
+
x86
|
| 383 |
+
mmx
|
| 384 |
+
mmxext
|
| 385 |
+
sse
|
| 386 |
+
sse2
|
| 387 |
+
sse2slow
|
| 388 |
+
sse3
|
| 389 |
+
sse3slow
|
| 390 |
+
ssse3
|
| 391 |
+
atom
|
| 392 |
+
sse4.1
|
| 393 |
+
sse4.2
|
| 394 |
+
avx
|
| 395 |
+
avx2
|
| 396 |
+
xop
|
| 397 |
+
fma3
|
| 398 |
+
fma4
|
| 399 |
+
3dnow
|
| 400 |
+
3dnowext
|
| 401 |
+
bmi1
|
| 402 |
+
bmi2
|
| 403 |
+
cmov
|
| 404 |
+
ARM
|
| 405 |
+
armv5te
|
| 406 |
+
armv6
|
| 407 |
+
armv6t2
|
| 408 |
+
vfp
|
| 409 |
+
vfpv3
|
| 410 |
+
neon
|
| 411 |
+
setend
|
| 412 |
+
AArch64
|
| 413 |
+
armv8
|
| 414 |
+
vfp
|
| 415 |
+
neon
|
| 416 |
+
PowerPC
|
| 417 |
+
altivec
|
| 418 |
+
Specific Processors
|
| 419 |
+
pentium2
|
| 420 |
+
pentium3
|
| 421 |
+
pentium4
|
| 422 |
+
k6
|
| 423 |
+
k62
|
| 424 |
+
athlon
|
| 425 |
+
athlonxp
|
| 426 |
+
k8
|
| 427 |
+
-cpucount count (global)
|
| 428 |
+
Override detection of CPU count. This option is intended for
|
| 429 |
+
testing. Do not use it unless you know what you're doing.
|
| 430 |
+
|
| 431 |
+
ffmpeg -cpucount 2
|
| 432 |
+
|
| 433 |
+
-max_alloc bytes
|
| 434 |
+
Set the maximum size limit for allocating a block on the heap by
|
| 435 |
+
ffmpeg's family of malloc functions. Exercise extreme caution when
|
| 436 |
+
using this option. Don't use if you do not understand the full
|
| 437 |
+
consequence of doing so. Default is INT_MAX.
|
| 438 |
+
|
| 439 |
+
AVOptions
|
| 440 |
+
These options are provided directly by the libavformat, libavdevice and
|
| 441 |
+
libavcodec libraries. To see the list of available AVOptions, use the
|
| 442 |
+
-help option. They are separated into two categories:
|
| 443 |
+
|
| 444 |
+
generic
|
| 445 |
+
These options can be set for any container, codec or device.
|
| 446 |
+
Generic options are listed under AVFormatContext options for
|
| 447 |
+
containers/devices and under AVCodecContext options for codecs.
|
| 448 |
+
|
| 449 |
+
private
|
| 450 |
+
These options are specific to the given container, device or codec.
|
| 451 |
+
Private options are listed under their corresponding
|
| 452 |
+
containers/devices/codecs.
|
| 453 |
+
|
| 454 |
+
For example to write an ID3v2.3 header instead of a default ID3v2.4 to
|
| 455 |
+
an MP3 file, use the id3v2_version private option of the MP3 muxer:
|
| 456 |
+
|
| 457 |
+
ffmpeg -i input.flac -id3v2_version 3 out.mp3
|
| 458 |
+
|
| 459 |
+
All codec AVOptions are per-stream, and thus a stream specifier should
|
| 460 |
+
be attached to them:
|
| 461 |
+
|
| 462 |
+
ffmpeg -i multichannel.mxf -map 0:v:0 -map 0:a:0 -map 0:a:0 -c:a:0 ac3 -b:a:0 640k -ac:a:1 2 -c:a:1 aac -b:2 128k out.mp4
|
| 463 |
+
|
| 464 |
+
In the above example, a multichannel audio stream is mapped twice for
|
| 465 |
+
output. The first instance is encoded with codec ac3 and bitrate 640k.
|
| 466 |
+
The second instance is downmixed to 2 channels and encoded with codec
|
| 467 |
+
aac. A bitrate of 128k is specified for it using absolute index of the
|
| 468 |
+
output stream.
|
| 469 |
+
|
| 470 |
+
Note: the -nooption syntax cannot be used for boolean AVOptions, use
|
| 471 |
+
-option 0/-option 1.
|
| 472 |
+
|
| 473 |
+
Note: the old undocumented way of specifying per-stream AVOptions by
|
| 474 |
+
prepending v/a/s to the options name is now obsolete and will be
|
| 475 |
+
removed soon.
|
| 476 |
+
|
| 477 |
+
Main options
|
| 478 |
+
-f format
|
| 479 |
+
Force format to use.
|
| 480 |
+
|
| 481 |
+
-unit
|
| 482 |
+
Show the unit of the displayed values.
|
| 483 |
+
|
| 484 |
+
-prefix
|
| 485 |
+
Use SI prefixes for the displayed values. Unless the
|
| 486 |
+
"-byte_binary_prefix" option is used all the prefixes are decimal.
|
| 487 |
+
|
| 488 |
+
-byte_binary_prefix
|
| 489 |
+
Force the use of binary prefixes for byte values.
|
| 490 |
+
|
| 491 |
+
-sexagesimal
|
| 492 |
+
Use sexagesimal format HH:MM:SS.MICROSECONDS for time values.
|
| 493 |
+
|
| 494 |
+
-pretty
|
| 495 |
+
Prettify the format of the displayed values, it corresponds to the
|
| 496 |
+
options "-unit -prefix -byte_binary_prefix -sexagesimal".
|
| 497 |
+
|
| 498 |
+
-output_format, -of, -print_format writer_name[=writer_options]
|
| 499 |
+
Set the output printing format.
|
| 500 |
+
|
| 501 |
+
writer_name specifies the name of the writer, and writer_options
|
| 502 |
+
specifies the options to be passed to the writer.
|
| 503 |
+
|
| 504 |
+
For example for printing the output in JSON format, specify:
|
| 505 |
+
|
| 506 |
+
-output_format json
|
| 507 |
+
|
| 508 |
+
For more details on the available output printing formats, see the
|
| 509 |
+
Writers section below.
|
| 510 |
+
|
| 511 |
+
-sections
|
| 512 |
+
Print sections structure and section information, and exit. The
|
| 513 |
+
output is not meant to be parsed by a machine.
|
| 514 |
+
|
| 515 |
+
-select_streams stream_specifier
|
| 516 |
+
Select only the streams specified by stream_specifier. This option
|
| 517 |
+
affects only the options related to streams (e.g. "show_streams",
|
| 518 |
+
"show_packets", etc.).
|
| 519 |
+
|
| 520 |
+
For example to show only audio streams, you can use the command:
|
| 521 |
+
|
| 522 |
+
ffprobe -show_streams -select_streams a INPUT
|
| 523 |
+
|
| 524 |
+
To show only video packets belonging to the video stream with index
|
| 525 |
+
1:
|
| 526 |
+
|
| 527 |
+
ffprobe -show_packets -select_streams v:1 INPUT
|
| 528 |
+
|
| 529 |
+
-show_data
|
| 530 |
+
Show payload data, as a hexadecimal and ASCII dump. Coupled with
|
| 531 |
+
-show_packets, it will dump the packets' data. Coupled with
|
| 532 |
+
-show_streams, it will dump the codec extradata.
|
| 533 |
+
|
| 534 |
+
The dump is printed as the "data" field. It may contain newlines.
|
| 535 |
+
|
| 536 |
+
-show_data_hash algorithm
|
| 537 |
+
Show a hash of payload data, for packets with -show_packets and for
|
| 538 |
+
codec extradata with -show_streams.
|
| 539 |
+
|
| 540 |
+
-show_error
|
| 541 |
+
Show information about the error found when trying to probe the
|
| 542 |
+
input.
|
| 543 |
+
|
| 544 |
+
The error information is printed within a section with name
|
| 545 |
+
"ERROR".
|
| 546 |
+
|
| 547 |
+
-show_format
|
| 548 |
+
Show information about the container format of the input multimedia
|
| 549 |
+
stream.
|
| 550 |
+
|
| 551 |
+
All the container format information is printed within a section
|
| 552 |
+
with name "FORMAT".
|
| 553 |
+
|
| 554 |
+
-show_format_entry name
|
| 555 |
+
Like -show_format, but only prints the specified entry of the
|
| 556 |
+
container format information, rather than all. This option may be
|
| 557 |
+
given more than once, then all specified entries will be shown.
|
| 558 |
+
|
| 559 |
+
This option is deprecated, use "show_entries" instead.
|
| 560 |
+
|
| 561 |
+
-show_entries section_entries
|
| 562 |
+
Set list of entries to show.
|
| 563 |
+
|
| 564 |
+
Entries are specified according to the following syntax.
|
| 565 |
+
section_entries contains a list of section entries separated by
|
| 566 |
+
":". Each section entry is composed by a section name (or unique
|
| 567 |
+
name), optionally followed by a list of entries local to that
|
| 568 |
+
section, separated by ",".
|
| 569 |
+
|
| 570 |
+
If section name is specified but is followed by no "=", all entries
|
| 571 |
+
are printed to output, together with all the contained sections.
|
| 572 |
+
Otherwise only the entries specified in the local section entries
|
| 573 |
+
list are printed. In particular, if "=" is specified but the list
|
| 574 |
+
of local entries is empty, then no entries will be shown for that
|
| 575 |
+
section.
|
| 576 |
+
|
| 577 |
+
Note that the order of specification of the local section entries
|
| 578 |
+
is not honored in the output, and the usual display order will be
|
| 579 |
+
retained.
|
| 580 |
+
|
| 581 |
+
The formal syntax is given by:
|
| 582 |
+
|
| 583 |
+
<LOCAL_SECTION_ENTRIES> ::= <SECTION_ENTRY_NAME>[,<LOCAL_SECTION_ENTRIES>]
|
| 584 |
+
<SECTION_ENTRY> ::= <SECTION_NAME>[=[<LOCAL_SECTION_ENTRIES>]]
|
| 585 |
+
<SECTION_ENTRIES> ::= <SECTION_ENTRY>[:<SECTION_ENTRIES>]
|
| 586 |
+
|
| 587 |
+
For example, to show only the index and type of each stream, and
|
| 588 |
+
the PTS time, duration time, and stream index of the packets, you
|
| 589 |
+
can specify the argument:
|
| 590 |
+
|
| 591 |
+
packet=pts_time,duration_time,stream_index : stream=index,codec_type
|
| 592 |
+
|
| 593 |
+
To show all the entries in the section "format", but only the codec
|
| 594 |
+
type in the section "stream", specify the argument:
|
| 595 |
+
|
| 596 |
+
format : stream=codec_type
|
| 597 |
+
|
| 598 |
+
To show all the tags in the stream and format sections:
|
| 599 |
+
|
| 600 |
+
stream_tags : format_tags
|
| 601 |
+
|
| 602 |
+
To show only the "title" tag (if available) in the stream sections:
|
| 603 |
+
|
| 604 |
+
stream_tags=title
|
| 605 |
+
|
| 606 |
+
-show_packets
|
| 607 |
+
Show information about each packet contained in the input
|
| 608 |
+
multimedia stream.
|
| 609 |
+
|
| 610 |
+
The information for each single packet is printed within a
|
| 611 |
+
dedicated section with name "PACKET".
|
| 612 |
+
|
| 613 |
+
-show_frames
|
| 614 |
+
Show information about each frame and subtitle contained in the
|
| 615 |
+
input multimedia stream.
|
| 616 |
+
|
| 617 |
+
The information for each single frame is printed within a dedicated
|
| 618 |
+
section with name "FRAME" or "SUBTITLE".
|
| 619 |
+
|
| 620 |
+
-show_log loglevel
|
| 621 |
+
Show logging information from the decoder about each frame
|
| 622 |
+
according to the value set in loglevel, (see "-loglevel"). This
|
| 623 |
+
option requires "-show_frames".
|
| 624 |
+
|
| 625 |
+
The information for each log message is printed within a dedicated
|
| 626 |
+
section with name "LOG".
|
| 627 |
+
|
| 628 |
+
-show_streams
|
| 629 |
+
Show information about each media stream contained in the input
|
| 630 |
+
multimedia stream.
|
| 631 |
+
|
| 632 |
+
Each media stream information is printed within a dedicated section
|
| 633 |
+
with name "STREAM".
|
| 634 |
+
|
| 635 |
+
-show_programs
|
| 636 |
+
Show information about programs and their streams contained in the
|
| 637 |
+
input multimedia stream.
|
| 638 |
+
|
| 639 |
+
Each media stream information is printed within a dedicated section
|
| 640 |
+
with name "PROGRAM_STREAM".
|
| 641 |
+
|
| 642 |
+
-show_stream_groups
|
| 643 |
+
Show information about stream groups and their streams contained in
|
| 644 |
+
the input multimedia stream.
|
| 645 |
+
|
| 646 |
+
Each media stream information is printed within a dedicated section
|
| 647 |
+
with name "STREAM_GROUP_STREAM".
|
| 648 |
+
|
| 649 |
+
-show_chapters
|
| 650 |
+
Show information about chapters stored in the format.
|
| 651 |
+
|
| 652 |
+
Each chapter is printed within a dedicated section with name
|
| 653 |
+
"CHAPTER".
|
| 654 |
+
|
| 655 |
+
-count_frames
|
| 656 |
+
Count the number of frames per stream and report it in the
|
| 657 |
+
corresponding stream section.
|
| 658 |
+
|
| 659 |
+
-count_packets
|
| 660 |
+
Count the number of packets per stream and report it in the
|
| 661 |
+
corresponding stream section.
|
| 662 |
+
|
| 663 |
+
-read_intervals read_intervals
|
| 664 |
+
Read only the specified intervals. read_intervals must be a
|
| 665 |
+
sequence of interval specifications separated by ",". ffprobe will
|
| 666 |
+
seek to the interval starting point, and will continue reading from
|
| 667 |
+
that.
|
| 668 |
+
|
| 669 |
+
Each interval is specified by two optional parts, separated by "%".
|
| 670 |
+
|
| 671 |
+
The first part specifies the interval start position. It is
|
| 672 |
+
interpreted as an absolute position, or as a relative offset from
|
| 673 |
+
the current position if it is preceded by the "+" character. If
|
| 674 |
+
this first part is not specified, no seeking will be performed when
|
| 675 |
+
reading this interval.
|
| 676 |
+
|
| 677 |
+
The second part specifies the interval end position. It is
|
| 678 |
+
interpreted as an absolute position, or as a relative offset from
|
| 679 |
+
the current position if it is preceded by the "+" character. If the
|
| 680 |
+
offset specification starts with "#", it is interpreted as the
|
| 681 |
+
number of packets to read (not including the flushing packets) from
|
| 682 |
+
the interval start. If no second part is specified, the program
|
| 683 |
+
will read until the end of the input.
|
| 684 |
+
|
| 685 |
+
Note that seeking is not accurate, thus the actual interval start
|
| 686 |
+
point may be different from the specified position. Also, when an
|
| 687 |
+
interval duration is specified, the absolute end time will be
|
| 688 |
+
computed by adding the duration to the interval start point found
|
| 689 |
+
by seeking the file, rather than to the specified start value.
|
| 690 |
+
|
| 691 |
+
The formal syntax is given by:
|
| 692 |
+
|
| 693 |
+
<INTERVAL> ::= [<START>|+<START_OFFSET>][%[<END>|+<END_OFFSET>]]
|
| 694 |
+
<INTERVALS> ::= <INTERVAL>[,<INTERVALS>]
|
| 695 |
+
|
| 696 |
+
A few examples follow.
|
| 697 |
+
|
| 698 |
+
o Seek to time 10, read packets until 20 seconds after the found
|
| 699 |
+
seek point, then seek to position "01:30" (1 minute and thirty
|
| 700 |
+
seconds) and read packets until position "01:45".
|
| 701 |
+
|
| 702 |
+
10%+20,01:30%01:45
|
| 703 |
+
|
| 704 |
+
o Read only 42 packets after seeking to position "01:23":
|
| 705 |
+
|
| 706 |
+
01:23%+#42
|
| 707 |
+
|
| 708 |
+
o Read only the first 20 seconds from the start:
|
| 709 |
+
|
| 710 |
+
%+20
|
| 711 |
+
|
| 712 |
+
o Read from the start until position "02:30":
|
| 713 |
+
|
| 714 |
+
%02:30
|
| 715 |
+
|
| 716 |
+
-show_private_data, -private
|
| 717 |
+
Show private data, that is data depending on the format of the
|
| 718 |
+
particular shown element. This option is enabled by default, but
|
| 719 |
+
you may need to disable it for specific uses, for example when
|
| 720 |
+
creating XSD-compliant XML output.
|
| 721 |
+
|
| 722 |
+
-show_program_version
|
| 723 |
+
Show information related to program version.
|
| 724 |
+
|
| 725 |
+
Version information is printed within a section with name
|
| 726 |
+
"PROGRAM_VERSION".
|
| 727 |
+
|
| 728 |
+
-show_library_versions
|
| 729 |
+
Show information related to library versions.
|
| 730 |
+
|
| 731 |
+
Version information for each library is printed within a section
|
| 732 |
+
with name "LIBRARY_VERSION".
|
| 733 |
+
|
| 734 |
+
-show_versions
|
| 735 |
+
Show information related to program and library versions. This is
|
| 736 |
+
the equivalent of setting both -show_program_version and
|
| 737 |
+
-show_library_versions options.
|
| 738 |
+
|
| 739 |
+
-show_pixel_formats
|
| 740 |
+
Show information about all pixel formats supported by FFmpeg.
|
| 741 |
+
|
| 742 |
+
Pixel format information for each format is printed within a
|
| 743 |
+
section with name "PIXEL_FORMAT".
|
| 744 |
+
|
| 745 |
+
-show_optional_fields value
|
| 746 |
+
Some writers viz. JSON and XML, omit the printing of fields with
|
| 747 |
+
invalid or non-applicable values, while other writers always print
|
| 748 |
+
them. This option enables one to control this behaviour. Valid
|
| 749 |
+
values are "always"/1, "never"/0 and "auto"/"-1". Default is auto.
|
| 750 |
+
|
| 751 |
+
-bitexact
|
| 752 |
+
Force bitexact output, useful to produce output which is not
|
| 753 |
+
dependent on the specific build.
|
| 754 |
+
|
| 755 |
+
-i input_url
|
| 756 |
+
Read input_url.
|
| 757 |
+
|
| 758 |
+
-o output_url
|
| 759 |
+
Write output to output_url. If not specified, the output is sent to
|
| 760 |
+
stdout.
|
| 761 |
+
|
| 762 |
+
WRITERS
|
| 763 |
+
A writer defines the output format adopted by ffprobe, and will be used
|
| 764 |
+
for printing all the parts of the output.
|
| 765 |
+
|
| 766 |
+
A writer may accept one or more arguments, which specify the options to
|
| 767 |
+
adopt. The options are specified as a list of key=value pairs,
|
| 768 |
+
separated by ":".
|
| 769 |
+
|
| 770 |
+
All writers support the following options:
|
| 771 |
+
|
| 772 |
+
string_validation, sv
|
| 773 |
+
Set string validation mode.
|
| 774 |
+
|
| 775 |
+
The following values are accepted.
|
| 776 |
+
|
| 777 |
+
fail
|
| 778 |
+
The writer will fail immediately in case an invalid string
|
| 779 |
+
(UTF-8) sequence or code point is found in the input. This is
|
| 780 |
+
especially useful to validate input metadata.
|
| 781 |
+
|
| 782 |
+
ignore
|
| 783 |
+
Any validation error will be ignored. This will result in
|
| 784 |
+
possibly broken output, especially with the json or xml writer.
|
| 785 |
+
|
| 786 |
+
replace
|
| 787 |
+
The writer will substitute invalid UTF-8 sequences or code
|
| 788 |
+
points with the string specified with the
|
| 789 |
+
string_validation_replacement.
|
| 790 |
+
|
| 791 |
+
Default value is replace.
|
| 792 |
+
|
| 793 |
+
string_validation_replacement, svr
|
| 794 |
+
Set replacement string to use in case string_validation is set to
|
| 795 |
+
replace.
|
| 796 |
+
|
| 797 |
+
In case the option is not specified, the writer will assume the
|
| 798 |
+
empty string, that is it will remove the invalid sequences from the
|
| 799 |
+
input strings.
|
| 800 |
+
|
| 801 |
+
A description of the currently available writers follows.
|
| 802 |
+
|
| 803 |
+
default
|
| 804 |
+
Default format.
|
| 805 |
+
|
| 806 |
+
Print each section in the form:
|
| 807 |
+
|
| 808 |
+
[SECTION]
|
| 809 |
+
key1=val1
|
| 810 |
+
...
|
| 811 |
+
keyN=valN
|
| 812 |
+
[/SECTION]
|
| 813 |
+
|
| 814 |
+
Metadata tags are printed as a line in the corresponding FORMAT,
|
| 815 |
+
STREAM, STREAM_GROUP_STREAM or PROGRAM_STREAM section, and are prefixed
|
| 816 |
+
by the string "TAG:".
|
| 817 |
+
|
| 818 |
+
A description of the accepted options follows.
|
| 819 |
+
|
| 820 |
+
nokey, nk
|
| 821 |
+
If set to 1 specify not to print the key of each field. Default
|
| 822 |
+
value is 0.
|
| 823 |
+
|
| 824 |
+
noprint_wrappers, nw
|
| 825 |
+
If set to 1 specify not to print the section header and footer.
|
| 826 |
+
Default value is 0.
|
| 827 |
+
|
| 828 |
+
compact, csv
|
| 829 |
+
Compact and CSV format.
|
| 830 |
+
|
| 831 |
+
The "csv" writer is equivalent to "compact", but supports different
|
| 832 |
+
defaults.
|
| 833 |
+
|
| 834 |
+
Each section is printed on a single line. If no option is specified,
|
| 835 |
+
the output has the form:
|
| 836 |
+
|
| 837 |
+
section|key1=val1| ... |keyN=valN
|
| 838 |
+
|
| 839 |
+
Metadata tags are printed in the corresponding "format" or "stream"
|
| 840 |
+
section. A metadata tag key, if printed, is prefixed by the string
|
| 841 |
+
"tag:".
|
| 842 |
+
|
| 843 |
+
The description of the accepted options follows.
|
| 844 |
+
|
| 845 |
+
item_sep, s
|
| 846 |
+
Specify the character to use for separating fields in the output
|
| 847 |
+
line. It must be a single printable character, it is "|" by
|
| 848 |
+
default ("," for the "csv" writer).
|
| 849 |
+
|
| 850 |
+
nokey, nk
|
| 851 |
+
If set to 1 specify not to print the key of each field. Its default
|
| 852 |
+
value is 0 (1 for the "csv" writer).
|
| 853 |
+
|
| 854 |
+
escape, e
|
| 855 |
+
Set the escape mode to use, default to "c" ("csv" for the "csv"
|
| 856 |
+
writer).
|
| 857 |
+
|
| 858 |
+
It can assume one of the following values:
|
| 859 |
+
|
| 860 |
+
c Perform C-like escaping. Strings containing a newline (\n),
|
| 861 |
+
carriage return (\r), a tab (\t), a form feed (\f), the
|
| 862 |
+
escaping character (\) or the item separator character SEP are
|
| 863 |
+
escaped using C-like fashioned escaping, so that a newline is
|
| 864 |
+
converted to the sequence \n, a carriage return to \r, \ to \\
|
| 865 |
+
and the separator SEP is converted to \SEP.
|
| 866 |
+
|
| 867 |
+
csv Perform CSV-like escaping, as described in RFC4180. Strings
|
| 868 |
+
containing a newline (\n), a carriage return (\r), a double
|
| 869 |
+
quote ("), or SEP are enclosed in double-quotes.
|
| 870 |
+
|
| 871 |
+
none
|
| 872 |
+
Perform no escaping.
|
| 873 |
+
|
| 874 |
+
print_section, p
|
| 875 |
+
Print the section name at the beginning of each line if the value
|
| 876 |
+
is 1, disable it with value set to 0. Default value is 1.
|
| 877 |
+
|
| 878 |
+
flat
|
| 879 |
+
Flat format.
|
| 880 |
+
|
| 881 |
+
A free-form output where each line contains an explicit key=value, such
|
| 882 |
+
as "streams.stream.3.tags.foo=bar". The output is shell escaped, so it
|
| 883 |
+
can be directly embedded in sh scripts as long as the separator
|
| 884 |
+
character is an alphanumeric character or an underscore (see sep_char
|
| 885 |
+
option).
|
| 886 |
+
|
| 887 |
+
The description of the accepted options follows.
|
| 888 |
+
|
| 889 |
+
sep_char, s
|
| 890 |
+
Separator character used to separate the chapter, the section name,
|
| 891 |
+
IDs and potential tags in the printed field key.
|
| 892 |
+
|
| 893 |
+
Default value is ..
|
| 894 |
+
|
| 895 |
+
hierarchical, h
|
| 896 |
+
Specify if the section name specification should be hierarchical.
|
| 897 |
+
If set to 1, and if there is more than one section in the current
|
| 898 |
+
chapter, the section name will be prefixed by the name of the
|
| 899 |
+
chapter. A value of 0 will disable this behavior.
|
| 900 |
+
|
| 901 |
+
Default value is 1.
|
| 902 |
+
|
| 903 |
+
ini
|
| 904 |
+
INI format output.
|
| 905 |
+
|
| 906 |
+
Print output in an INI based format.
|
| 907 |
+
|
| 908 |
+
The following conventions are adopted:
|
| 909 |
+
|
| 910 |
+
o all key and values are UTF-8
|
| 911 |
+
|
| 912 |
+
o . is the subgroup separator
|
| 913 |
+
|
| 914 |
+
o newline, \t, \f, \b and the following characters are escaped
|
| 915 |
+
|
| 916 |
+
o \ is the escape character
|
| 917 |
+
|
| 918 |
+
o # is the comment indicator
|
| 919 |
+
|
| 920 |
+
o = is the key/value separator
|
| 921 |
+
|
| 922 |
+
o : is not used but usually parsed as key/value separator
|
| 923 |
+
|
| 924 |
+
This writer accepts options as a list of key=value pairs, separated by
|
| 925 |
+
:.
|
| 926 |
+
|
| 927 |
+
The description of the accepted options follows.
|
| 928 |
+
|
| 929 |
+
hierarchical, h
|
| 930 |
+
Specify if the section name specification should be hierarchical.
|
| 931 |
+
If set to 1, and if there is more than one section in the current
|
| 932 |
+
chapter, the section name will be prefixed by the name of the
|
| 933 |
+
chapter. A value of 0 will disable this behavior.
|
| 934 |
+
|
| 935 |
+
Default value is 1.
|
| 936 |
+
|
| 937 |
+
json
|
| 938 |
+
JSON based format.
|
| 939 |
+
|
| 940 |
+
Each section is printed using JSON notation.
|
| 941 |
+
|
| 942 |
+
The description of the accepted options follows.
|
| 943 |
+
|
| 944 |
+
compact, c
|
| 945 |
+
If set to 1 enable compact output, that is each section will be
|
| 946 |
+
printed on a single line. Default value is 0.
|
| 947 |
+
|
| 948 |
+
For more information about JSON, see <http://www.json.org/>.
|
| 949 |
+
|
| 950 |
+
xml
|
| 951 |
+
XML based format.
|
| 952 |
+
|
| 953 |
+
The XML output is described in the XML schema description file
|
| 954 |
+
ffprobe.xsd installed in the FFmpeg datadir.
|
| 955 |
+
|
| 956 |
+
An updated version of the schema can be retrieved at the url
|
| 957 |
+
<http://www.ffmpeg.org/schema/ffprobe.xsd>, which redirects to the
|
| 958 |
+
latest schema committed into the FFmpeg development source code tree.
|
| 959 |
+
|
| 960 |
+
Note that the output issued will be compliant to the ffprobe.xsd schema
|
| 961 |
+
only when no special global output options (unit, prefix,
|
| 962 |
+
byte_binary_prefix, sexagesimal etc.) are specified.
|
| 963 |
+
|
| 964 |
+
The description of the accepted options follows.
|
| 965 |
+
|
| 966 |
+
fully_qualified, q
|
| 967 |
+
If set to 1 specify if the output should be fully qualified.
|
| 968 |
+
Default value is 0. This is required for generating an XML file
|
| 969 |
+
which can be validated through an XSD file.
|
| 970 |
+
|
| 971 |
+
xsd_strict, x
|
| 972 |
+
If set to 1 perform more checks for ensuring that the output is XSD
|
| 973 |
+
compliant. Default value is 0. This option automatically sets
|
| 974 |
+
fully_qualified to 1.
|
| 975 |
+
|
| 976 |
+
For more information about the XML format, see
|
| 977 |
+
<https://www.w3.org/XML/>.
|
| 978 |
+
|
| 979 |
+
TIMECODE
|
| 980 |
+
ffprobe supports Timecode extraction:
|
| 981 |
+
|
| 982 |
+
o MPEG1/2 timecode is extracted from the GOP, and is available in the
|
| 983 |
+
video stream details (-show_streams, see timecode).
|
| 984 |
+
|
| 985 |
+
o MOV timecode is extracted from tmcd track, so is available in the
|
| 986 |
+
tmcd stream metadata (-show_streams, see TAG:timecode).
|
| 987 |
+
|
| 988 |
+
o DV, GXF and AVI timecodes are available in format metadata
|
| 989 |
+
(-show_format, see TAG:timecode).
|
| 990 |
+
|
| 991 |
+
SEE ALSO
|
| 992 |
+
ffprobe-all(1), ffmpeg(1), ffplay(1), ffmpeg-utils(1),
|
| 993 |
+
ffmpeg-scaler(1), ffmpeg-resampler(1), ffmpeg-codecs(1),
|
| 994 |
+
ffmpeg-bitstream-filters(1), ffmpeg-formats(1), ffmpeg-devices(1),
|
| 995 |
+
ffmpeg-protocols(1), ffmpeg-filters(1)
|
| 996 |
+
|
| 997 |
+
AUTHORS
|
| 998 |
+
The FFmpeg developers.
|
| 999 |
+
|
| 1000 |
+
For details about the authorship, see the Git history of the project
|
| 1001 |
+
(https://git.ffmpeg.org/ffmpeg), e.g. by typing the command git log in
|
| 1002 |
+
the FFmpeg source directory, or browsing the online repository at
|
| 1003 |
+
<https://git.ffmpeg.org/ffmpeg>.
|
| 1004 |
+
|
| 1005 |
+
Maintainers for the specific components are listed in the file
|
| 1006 |
+
MAINTAINERS in the source code tree.
|
| 1007 |
+
|
| 1008 |
+
FFPROBE(1)
|
pix2video-main/ffmpeg-7.0.2-i686-static/readme.txt
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
______ ______
|
| 3 |
+
/ ____// ____/____ ___ ____ ___ ____ _
|
| 4 |
+
/ /_ / /_ / __ `__ \ / __ \ / _ \ / __ `/
|
| 5 |
+
/ __/ / __/ / / / / / // /_/ // __// /_/ /
|
| 6 |
+
/_/ /_/ /_/ /_/ /_// .___/ \___/ \__, /
|
| 7 |
+
/_/ /____/
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
build: ffmpeg-7.0.2-i686-static.tar.xz
|
| 11 |
+
version: 7.0.2
|
| 12 |
+
|
| 13 |
+
gcc: 8.3.0
|
| 14 |
+
yasm: 1.3.0.36.ge2569
|
| 15 |
+
nasm: 2.15.05
|
| 16 |
+
|
| 17 |
+
libaom: N/A
|
| 18 |
+
libass: 0.17.3
|
| 19 |
+
libgme: 0.6.3
|
| 20 |
+
libsrt: 1.4.4
|
| 21 |
+
libvpx: 1.11.0-30-g888bafc78
|
| 22 |
+
libvmaf: N/A
|
| 23 |
+
libx264: 0.164.3191
|
| 24 |
+
libx265: 3.5+1-f0c1022b6
|
| 25 |
+
libxvid: 1.3.7
|
| 26 |
+
libwebp: 0.6.1
|
| 27 |
+
libzimg: 3.0.3
|
| 28 |
+
libzvbi: N/A
|
| 29 |
+
libdav1d: N/A
|
| 30 |
+
libgnutls: 3.7.2
|
| 31 |
+
libtheora: 1.2.0alpha1+git
|
| 32 |
+
libfrei0r: 1.6.1-2
|
| 33 |
+
libvidstab: 1.20
|
| 34 |
+
libfreetype: 2.9.1-3+deb10u1
|
| 35 |
+
libharfbuzz: 3.1.1
|
| 36 |
+
libopenjpeg: 2.4.0
|
| 37 |
+
|
| 38 |
+
libalsa: 1.2.4
|
| 39 |
+
libsoxr: 0.1.3
|
| 40 |
+
libopus: 1.3.1
|
| 41 |
+
libspeex: 1.2
|
| 42 |
+
libvorbis: 1.3.7
|
| 43 |
+
libmp3lame: 3.100
|
| 44 |
+
librubberband: 1.8.2
|
| 45 |
+
libvo-amrwbenc: 0.1.3-1+b1
|
| 46 |
+
libopencore-amrnb: 0.1.3-2.1+b2
|
| 47 |
+
libopencore-amrwb: 0.1.3-2.1+b2
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
Notes: A limitation of statically linking glibc is the loss of DNS resolution. Installing
|
| 51 |
+
nscd through your package manager will fix this.
|
| 52 |
+
|
| 53 |
+
The vmaf filter needs external files to work- see model/000-README.TXT
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
This static build is licensed under the GNU General Public License version 3.
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
Patreon: https://www.patreon.com/johnvansickle
|
| 60 |
+
Paypal: https://www.paypal.me/johnvansickle
|
| 61 |
+
Ethereum: 0x491f0b4bAd15FF178257D9Fa81ce87baa8b6E242
|
| 62 |
+
Bitcoin: 3ErDdF5JeG9RMx2DXwXEeunrsc5dVHjmeq
|
| 63 |
+
Dogecoin: DH4WZPTjwKh2TarQhkpQrKjHZ9kNTkiMNL
|
| 64 |
+
|
| 65 |
+
email: john.vansickle@gmail.com
|
| 66 |
+
irc: relaxed @ irc://chat.freenode.net #ffmpeg
|
| 67 |
+
url: https://johnvansickle.com/ffmpeg/
|
pix2video-main/mydiffusers/mydiffusers.egg-info/PKG-INFO
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
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.py
|
| 3 |
+
mydiffusers/configuration_utils.py
|
| 4 |
+
mydiffusers/dependency_versions_check.py
|
| 5 |
+
mydiffusers/dependency_versions_table.py
|
| 6 |
+
mydiffusers/dynamic_modules_utils.py
|
| 7 |
+
mydiffusers/hub_utils.py
|
| 8 |
+
mydiffusers/modeling_flax_pytorch_utils.py
|
| 9 |
+
mydiffusers/modeling_flax_utils.py
|
| 10 |
+
mydiffusers/modeling_utils.py
|
| 11 |
+
mydiffusers/onnx_utils.py
|
| 12 |
+
mydiffusers/optimization.py
|
| 13 |
+
mydiffusers/pipeline_flax_utils.py
|
| 14 |
+
mydiffusers/pipeline_utils.py
|
| 15 |
+
mydiffusers/training_utils.py
|
| 16 |
+
mydiffusers.egg-info/PKG-INFO
|
| 17 |
+
mydiffusers.egg-info/SOURCES.txt
|
| 18 |
+
mydiffusers.egg-info/dependency_links.txt
|
| 19 |
+
mydiffusers.egg-info/top_level.txt
|
| 20 |
+
mydiffusers/commands/__init__.py
|
| 21 |
+
mydiffusers/commands/diffusers_cli.py
|
| 22 |
+
mydiffusers/commands/env.py
|
| 23 |
+
mydiffusers/experimental/__init__.py
|
| 24 |
+
mydiffusers/experimental/rl/__init__.py
|
| 25 |
+
mydiffusers/experimental/rl/value_guided_sampling.py
|
| 26 |
+
mydiffusers/models/__init__.py
|
| 27 |
+
mydiffusers/models/attention.py
|
| 28 |
+
mydiffusers/models/attention_flax.py
|
| 29 |
+
mydiffusers/models/embeddings.py
|
| 30 |
+
mydiffusers/models/embeddings_flax.py
|
| 31 |
+
mydiffusers/models/resnet.py
|
| 32 |
+
mydiffusers/models/resnet_flax.py
|
| 33 |
+
mydiffusers/models/unet_1d.py
|
| 34 |
+
mydiffusers/models/unet_1d_blocks.py
|
| 35 |
+
mydiffusers/models/unet_2d.py
|
| 36 |
+
mydiffusers/models/unet_2d_blocks.py
|
| 37 |
+
mydiffusers/models/unet_2d_blocks_flax.py
|
| 38 |
+
mydiffusers/models/unet_2d_condition.py
|
| 39 |
+
mydiffusers/models/unet_2d_condition_flax.py
|
| 40 |
+
mydiffusers/models/vae.py
|
| 41 |
+
mydiffusers/models/vae_flax.py
|
| 42 |
+
mydiffusers/pipelines/__init__.py
|
| 43 |
+
mydiffusers/pipelines/alt_diffusion/__init__.py
|
| 44 |
+
mydiffusers/pipelines/alt_diffusion/modeling_roberta_series.py
|
| 45 |
+
mydiffusers/pipelines/alt_diffusion/pipeline_alt_diffusion.py
|
| 46 |
+
mydiffusers/pipelines/alt_diffusion/pipeline_alt_diffusion_img2img.py
|
| 47 |
+
mydiffusers/pipelines/audio_diffusion/__init__.py
|
| 48 |
+
mydiffusers/pipelines/audio_diffusion/mel.py
|
| 49 |
+
mydiffusers/pipelines/audio_diffusion/pipeline_audio_diffusion.py
|
| 50 |
+
mydiffusers/pipelines/dance_diffusion/__init__.py
|
| 51 |
+
mydiffusers/pipelines/dance_diffusion/pipeline_dance_diffusion.py
|
| 52 |
+
mydiffusers/pipelines/ddim/__init__.py
|
| 53 |
+
mydiffusers/pipelines/ddim/pipeline_ddim.py
|
| 54 |
+
mydiffusers/pipelines/ddpm/__init__.py
|
| 55 |
+
mydiffusers/pipelines/ddpm/pipeline_ddpm.py
|
| 56 |
+
mydiffusers/pipelines/latent_diffusion/__init__.py
|
| 57 |
+
mydiffusers/pipelines/latent_diffusion/pipeline_latent_diffusion.py
|
| 58 |
+
mydiffusers/pipelines/latent_diffusion/pipeline_latent_diffusion_superresolution.py
|
| 59 |
+
mydiffusers/pipelines/latent_diffusion_uncond/__init__.py
|
| 60 |
+
mydiffusers/pipelines/latent_diffusion_uncond/pipeline_latent_diffusion_uncond.py
|
| 61 |
+
mydiffusers/pipelines/paint_by_example/__init__.py
|
| 62 |
+
mydiffusers/pipelines/paint_by_example/image_encoder.py
|
| 63 |
+
mydiffusers/pipelines/paint_by_example/pipeline_paint_by_example.py
|
| 64 |
+
mydiffusers/pipelines/pndm/__init__.py
|
| 65 |
+
mydiffusers/pipelines/pndm/pipeline_pndm.py
|
| 66 |
+
mydiffusers/pipelines/repaint/__init__.py
|
| 67 |
+
mydiffusers/pipelines/repaint/pipeline_repaint.py
|
| 68 |
+
mydiffusers/pipelines/score_sde_ve/__init__.py
|
| 69 |
+
mydiffusers/pipelines/score_sde_ve/pipeline_score_sde_ve.py
|
| 70 |
+
mydiffusers/pipelines/stable_diffusion/__init__.py
|
| 71 |
+
mydiffusers/pipelines/stable_diffusion/pipeline_cycle_diffusion.py
|
| 72 |
+
mydiffusers/pipelines/stable_diffusion/pipeline_flax_stable_diffusion.py
|
| 73 |
+
mydiffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion.py
|
| 74 |
+
mydiffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_img2img.py
|
| 75 |
+
mydiffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_inpaint.py
|
| 76 |
+
mydiffusers/pipelines/stable_diffusion/pipeline_onnx_stable_diffusion_inpaint_legacy.py
|
| 77 |
+
mydiffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py
|
| 78 |
+
mydiffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_depth2img.py
|
| 79 |
+
mydiffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_image_variation.py
|
| 80 |
+
mydiffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py
|
| 81 |
+
mydiffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py
|
| 82 |
+
mydiffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint_legacy.py
|
| 83 |
+
mydiffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_k_diffusion.py
|
| 84 |
+
mydiffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_upscale.py
|
| 85 |
+
mydiffusers/pipelines/stable_diffusion/safety_checker.py
|
| 86 |
+
mydiffusers/pipelines/stable_diffusion/safety_checker_flax.py
|
| 87 |
+
mydiffusers/pipelines/stable_diffusion_safe/__init__.py
|
| 88 |
+
mydiffusers/pipelines/stable_diffusion_safe/pipeline_stable_diffusion_safe.py
|
| 89 |
+
mydiffusers/pipelines/stable_diffusion_safe/safety_checker.py
|
| 90 |
+
mydiffusers/pipelines/stochastic_karras_ve/__init__.py
|
| 91 |
+
mydiffusers/pipelines/stochastic_karras_ve/pipeline_stochastic_karras_ve.py
|
| 92 |
+
mydiffusers/pipelines/versatile_diffusion/__init__.py
|
| 93 |
+
mydiffusers/pipelines/versatile_diffusion/modeling_text_unet.py
|
| 94 |
+
mydiffusers/pipelines/versatile_diffusion/pipeline_versatile_diffusion.py
|
| 95 |
+
mydiffusers/pipelines/versatile_diffusion/pipeline_versatile_diffusion_dual_guided.py
|
| 96 |
+
mydiffusers/pipelines/versatile_diffusion/pipeline_versatile_diffusion_image_variation.py
|
| 97 |
+
mydiffusers/pipelines/versatile_diffusion/pipeline_versatile_diffusion_text_to_image.py
|
| 98 |
+
mydiffusers/pipelines/vq_diffusion/__init__.py
|
| 99 |
+
mydiffusers/pipelines/vq_diffusion/pipeline_vq_diffusion.py
|
| 100 |
+
mydiffusers/schedulers/__init__.py
|
| 101 |
+
mydiffusers/schedulers/scheduling_ddim.py
|
| 102 |
+
mydiffusers/schedulers/scheduling_ddim_flax.py
|
| 103 |
+
mydiffusers/schedulers/scheduling_ddpm.py
|
| 104 |
+
mydiffusers/schedulers/scheduling_ddpm_flax.py
|
| 105 |
+
mydiffusers/schedulers/scheduling_dpmsolver_multistep.py
|
| 106 |
+
mydiffusers/schedulers/scheduling_dpmsolver_multistep_flax.py
|
| 107 |
+
mydiffusers/schedulers/scheduling_dpmsolver_singlestep.py
|
| 108 |
+
mydiffusers/schedulers/scheduling_euler_ancestral_discrete.py
|
| 109 |
+
mydiffusers/schedulers/scheduling_euler_discrete.py
|
| 110 |
+
mydiffusers/schedulers/scheduling_heun_discrete.py
|
| 111 |
+
mydiffusers/schedulers/scheduling_ipndm.py
|
| 112 |
+
mydiffusers/schedulers/scheduling_k_dpm_2_ancestral_discrete.py
|
| 113 |
+
mydiffusers/schedulers/scheduling_k_dpm_2_discrete.py
|
| 114 |
+
mydiffusers/schedulers/scheduling_karras_ve.py
|
| 115 |
+
mydiffusers/schedulers/scheduling_karras_ve_flax.py
|
| 116 |
+
mydiffusers/schedulers/scheduling_lms_discrete.py
|
| 117 |
+
mydiffusers/schedulers/scheduling_lms_discrete_flax.py
|
| 118 |
+
mydiffusers/schedulers/scheduling_pndm.py
|
| 119 |
+
mydiffusers/schedulers/scheduling_pndm_flax.py
|
| 120 |
+
mydiffusers/schedulers/scheduling_repaint.py
|
| 121 |
+
mydiffusers/schedulers/scheduling_sde_ve.py
|
| 122 |
+
mydiffusers/schedulers/scheduling_sde_ve_flax.py
|
| 123 |
+
mydiffusers/schedulers/scheduling_sde_vp.py
|
| 124 |
+
mydiffusers/schedulers/scheduling_utils.py
|
| 125 |
+
mydiffusers/schedulers/scheduling_utils_flax.py
|
| 126 |
+
mydiffusers/schedulers/scheduling_vq_diffusion.py
|
| 127 |
+
mydiffusers/utils/__init__.py
|
| 128 |
+
mydiffusers/utils/deprecation_utils.py
|
| 129 |
+
mydiffusers/utils/dummy_flax_and_transformers_objects.py
|
| 130 |
+
mydiffusers/utils/dummy_flax_objects.py
|
| 131 |
+
mydiffusers/utils/dummy_pt_objects.py
|
| 132 |
+
mydiffusers/utils/dummy_torch_and_librosa_objects.py
|
| 133 |
+
mydiffusers/utils/dummy_torch_and_scipy_objects.py
|
| 134 |
+
mydiffusers/utils/dummy_torch_and_transformers_and_k_diffusion_objects.py
|
| 135 |
+
mydiffusers/utils/dummy_torch_and_transformers_and_onnx_objects.py
|
| 136 |
+
mydiffusers/utils/dummy_torch_and_transformers_objects.py
|
| 137 |
+
mydiffusers/utils/import_utils.py
|
| 138 |
+
mydiffusers/utils/logging.py
|
| 139 |
+
mydiffusers/utils/outputs.py
|
| 140 |
+
mydiffusers/utils/pil_utils.py
|
| 141 |
+
mydiffusers/utils/testing_utils.py
|
pix2video-main/mydiffusers/mydiffusers.egg-info/dependency_links.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
|
pix2video-main/mydiffusers/mydiffusers.egg-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
mydiffusers
|
pix2video-main/mydiffusers/mydiffusers/schedulers/__pycache__/__init__.cpython-313.pyc
ADDED
|
Binary file (2.76 kB). View file
|
|
|
pix2video-main/mydiffusers/mydiffusers/schedulers/__pycache__/__init__.cpython-38.pyc
ADDED
|
Binary file (2.43 kB). View file
|
|
|
pix2video-main/mydiffusers/mydiffusers/schedulers/__pycache__/scheduling_ddim.cpython-313.pyc
ADDED
|
Binary file (18.4 kB). View file
|
|
|
pix2video-main/mydiffusers/mydiffusers/schedulers/__pycache__/scheduling_ddim.cpython-38.pyc
ADDED
|
Binary file (12.7 kB). View file
|
|
|
pix2video-main/mydiffusers/mydiffusers/schedulers/__pycache__/scheduling_ddpm.cpython-313.pyc
ADDED
|
Binary file (18.2 kB). View file
|
|
|