首页 > 其他分享 >SciTech-AV-Video-DVP(Digital Video Processing)-CV/CG-ffmpeg-libavfilter:数字过滤器-

SciTech-AV-Video-DVP(Digital Video Processing)-CV/CG-ffmpeg-libavfilter:数字过滤器-

时间:2024-10-17 19:33:41浏览次数:1  
标签:ffmpeg libavfilter crop filter Video split filters input output

This document describes filters, sources, and sinks provided by the libavfilter library.

Filtergraph Syntax

  • Filters in the same linear chain are separated by commas,
  • distinct linear chains of filters are separated by semicolons.
  • The points where the linear chains join are labelled by names enclosed in square brackets.
  • Some filters take in input a list of parameters:
    • they are specified after the filter name and an equal sign,
    • they are separated from each other by a colon.

Filtering Introduction

Filtering in FFmpeg is enabled through the libavfilter library.

In libavfilter, a filter can have multiple inputs and multiple outputs.
To illustrate the sorts of things that are possible, we consider the following filtergraph.

Example of filtergraph:

                [main]
input --> split ---------------------> overlay --> output
            |                             ^
            |[tmp]                  [flip]|
            +-----> crop --> vflip -------+

This filtergraph splits the input stream in two streams, then,
sends one stream through the crop filter and the vflip filter,
before merging it back with the other stream by overlaying it on top.

You can use the following command to achieve this:

ffmpeg -i INPUT -vf "split [main][tmp]; [tmp] crop=iw:ih/2:0:0, vflip [flip]; [main][flip] overlay=0:H/2" OUTPUT

The result will be that the top half of the video is mirrored onto the bottom half of the output video.
In our example,

  • crop,vflip are in one linear chain,
  • split and overlay are separately in another.
  • the split filter generates two outputs that are associated to the labels [main] and [tmp].
  • the stream sent to the second output of split, labelled as [tmp], is processed through the crop filter.
  • the crop filter crops away the lower half part of the video, and then vertically flipped.
  • The overlay filter takes in input the first unchanged output of the split filter (which was labelled as [main]), and overlay on its lower half the output generated by the crop, vflip filterchain.

There exist so-called source filters that do not have an audio/video input, and sink filters that will not have audio/video output.

标签:ffmpeg,libavfilter,crop,filter,Video,split,filters,input,output
From: https://www.cnblogs.com/abaelhe/p/18472935

相关文章

  • How to Download YouTube Videos for Free
     However,therearetimeswhenyoumaywanttodownloadYouTubevideosforofflineviewing,suchaswhenyou'retravelingwithoutareliableinternetconnectionorwanttosaveafavoritevideoforlater.Inthisarticle,wewillexploresomemethod......
  • FFmpeg开发笔记(五十七)使用Media3的Transformer加工视频文件
    ​继音视频播放器ExoPlayer之后,谷歌又推出了音视频转换器Transformer,要在音视频加工领域施展拳脚。根据Android开发者官网介绍:JetpackMedia3是Android媒体库的新家,可让App呈现丰富的视听体验。Media3提供了一个简单的架构,能够基于设备功能开展自定义与可靠性优化,可以解决媒体部分......
  • 【uniapp】video在公众号自动播放事件及使用object-fit使内容填充不留黑边
     视频组件官网:https://uniapp.dcloud.net.cn/component/video.html使用object-fit使内容填充不留黑边object-fitcontain当视频大小与video容器大小不一致时,视频的表现形式。contain:包含,fill:填充,cover:覆盖 在template中添加<template><view......
  • CogVideoX:Text-to-Video Diffusion Models with An Expert Transformer
    研究背景背景介绍:这篇文章的研究背景是文本到视频模型的快速发展,特别是Transformer架构和扩散模型的应用。早期尝试预训练和扩展Transformer生成视频已经显示出巨大潜力,如CogVideo和Phenaki。扩散模型在多模态生成方面也取得了显著进展,包括视频生成。研究内容:该问题的......
  • FFmpeg开发笔记(五十六)使用Media3的Exoplayer播放网络视频
    ​Android早期的MediaPlayer控件对于网络视频的兼容性很差,所以后来单独推出了Exoplayer库增强支持网络视频,在《AndroidStudio开发实战:从零基础到App上线(第3版)》一书第14章的“14.3.3 新型播放器ExoPlayer”就详细介绍了Exoplayer库的详细用法。现在Android官方再次升级Exop......
  • 揭秘 FineVideo 数据集构建的背后的秘密
    开放视频数据集稀缺,因此减缓了开源视频AI的发展。为此,我们构建了FineVideo,这是一个包含43,000个视频的数据集,总时长为3,400小时,并带有丰富的描述、叙事细节、场景分割和问答对。FineVideo包含高度多样化的视频和元数据集合,使其成为训练模型理解视频内容、训练扩散模型从......
  • 有效应对‘因ffmpeg.dll缺失导致代码无法执行’的电脑故障解决方案
    当电脑出现“由于找不到ffmpeg.dll,无法继续执行代码”的错误提示时,这通常意味着某个应用程序或进程在尝试调用ffmpeg.dll这一关键动态链接库(DLL)文件时未能成功找到它。ffmpeg.dll是FFmpeg项目的一部分,该项目提供了一套用于录制、转换数字音视频,以及将其转化为流的开源库。为......
  • FFmpeg开发笔记(五十五)寒冬里的安卓程序员可进阶修炼的几种姿势
    ​喊了多年的互联网寒冬,今年的寒风格外凛冽,还在坚守安卓开发的朋友着实不容易。因为能转行的早就转了,能转岗的也早就转了,那么安卓程序员比较迷茫的就是,我该学什么安卓技术才好呢?还是直接扔了安卓再去搞别的技术吗?下面探讨下安卓程序员还能在哪些方面进阶修炼,主要有以下三个方向......
  • 【论文解读】KVQ: Kwai Video Quality Assessment for Short-form Videos
    原文链接:https://arxiv.org/pdf/2402.07220级别:IEEE/CVF机构:快手作者:YitingLu时间:2024可下载地址:KVQ:KwaiVideoQualityAssessmentforShort-formVideos摘要UGC(用户生成内容)短视频平台,如快手(Kwai)和抖音(TikTok),已经成为一种新兴且不可替代的主流媒体形式。......
  • 使用ffmpeg修复本地视频文件(mp4)播放时进度条无法拖动的问题
    右击视频文件查看属性,在详细信息页查看视频时长,显示为空,推测进度条无法拖动的原因是时间轴损坏于是采用了以下解决办法将视频分离出来,命名为video.mp4ffmpeg-i视频名称.mp4-map0:v-vcodeccopy-bsf:vh264_mp4toannexbvideo.mp4将音频分离出来,命名为audio.wavffm......