• <small id='bdrRE'></small><noframes id='bdrRE'>

        <legend id='bdrRE'><style id='bdrRE'><dir id='bdrRE'><q id='bdrRE'></q></dir></style></legend>
      1. <tfoot id='bdrRE'></tfoot>
        • <bdo id='bdrRE'></bdo><ul id='bdrRE'></ul>

        <i id='bdrRE'><tr id='bdrRE'><dt id='bdrRE'><q id='bdrRE'><span id='bdrRE'><b id='bdrRE'><form id='bdrRE'><ins id='bdrRE'></ins><ul id='bdrRE'></ul><sub id='bdrRE'></sub></form><legend id='bdrRE'></legend><bdo id='bdrRE'><pre id='bdrRE'><center id='bdrRE'></center></pre></bdo></b><th id='bdrRE'></th></span></q></dt></tr></i><div id='bdrRE'><tfoot id='bdrRE'></tfoot><dl id='bdrRE'><fieldset id='bdrRE'></fieldset></dl></div>

        ffmpeg 从cropdetect 中获取值

        时间:2023-09-20

        <small id='OGH1J'></small><noframes id='OGH1J'>

      2. <i id='OGH1J'><tr id='OGH1J'><dt id='OGH1J'><q id='OGH1J'><span id='OGH1J'><b id='OGH1J'><form id='OGH1J'><ins id='OGH1J'></ins><ul id='OGH1J'></ul><sub id='OGH1J'></sub></form><legend id='OGH1J'></legend><bdo id='OGH1J'><pre id='OGH1J'><center id='OGH1J'></center></pre></bdo></b><th id='OGH1J'></th></span></q></dt></tr></i><div id='OGH1J'><tfoot id='OGH1J'></tfoot><dl id='OGH1J'><fieldset id='OGH1J'></fieldset></dl></div>

        • <bdo id='OGH1J'></bdo><ul id='OGH1J'></ul>

            <tfoot id='OGH1J'></tfoot>

                    <tbody id='OGH1J'></tbody>

                  <legend id='OGH1J'><style id='OGH1J'><dir id='OGH1J'><q id='OGH1J'></q></dir></style></legend>
                  本文介绍了ffmpeg 从cropdetect 中获取值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  是否可以在一行中运行cropdetect 和crop 并从视频中获取拇指?

                  Its possible to run cropdetect and crop in one line and get thumbs from video?

                  像这样

                  ffmpeg -ss 1 -i 0.flv -vf cropdetect=24:16:0,crop=w:h:x:y -vcodec mjpeg -vframes 1 -an -f rawvideo -s 240x180 0.jpg
                  

                  或者可能需要在 2 行中运行,首先运行cropdetect,然后运行crop 并从视频生成拇指,但这样我需要从cropdetect 中获取价值?

                  Or maybe need to run in 2 line, first run cropdetect and than run crop and generate thumbs from video, but in this way i need to get value from cropdetect?

                  推荐答案

                  cropdetect 输出到控制台,因此您可以解析输出,然后将其用作变量:

                  cropdetect outputs to the console, so you can parse the output and then use it as a variable:

                  ffmpeg -i input -t 1 -vf cropdetect -f null - 2>&1 | awk '/crop/ { print $NF }' | tail -1
                  

                  这将导致类似:

                  crop=640:480:0:50
                  

                  然后运行您的实际裁剪命令:

                  Then run your actual crop command:

                  ffmpeg -i input -vf $cropvalue,scale=240:-1 -vframes 1 -qscale:v 2 output.jpg
                  

                  • -vcodec mjpeg-an-f rawvideo 是多余的

                    使用-qscale:v控制jpg输出质量.合理的范围是 2-5(较低的值表示较高的质量).

                    Use -qscale:v to control jpg output quality. A sane range is 2-5 (a lower value is a higher quality).

                    使用 scale 过滤器而不是-s;特别是如果您已经在使用过滤器.此外,scale 过滤器将允许您设置特定的宽度或高度,并且使用 -1 它将自动提供正确的值以保留方面.否则,如果您尝试强制使用特定大小,则可能会导致输出被压扁或拉伸.

                    Use the scale filter instead of -s; especially if you're already using filters. Also the scale filter will allow you to set a specific width or height and with -1 it will automatically provide the correct value to preserve aspect. Otherwise if you try to force a specific size you can risk a squished or stretched output.

                    显然我不是 PHP 编码员,但这至少应该给你一个想法.

                    Obviously I'm not a PHP coder, but this should give you an idea at least.

                    这篇关于ffmpeg 从cropdetect 中获取值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:FFMPEG :在视频上添加固定大小的图像,而不管视频 下一篇:我收到错误“使用了已弃用的像素格式,请确保

                  相关文章

                  最新文章

                • <i id='AMU0v'><tr id='AMU0v'><dt id='AMU0v'><q id='AMU0v'><span id='AMU0v'><b id='AMU0v'><form id='AMU0v'><ins id='AMU0v'></ins><ul id='AMU0v'></ul><sub id='AMU0v'></sub></form><legend id='AMU0v'></legend><bdo id='AMU0v'><pre id='AMU0v'><center id='AMU0v'></center></pre></bdo></b><th id='AMU0v'></th></span></q></dt></tr></i><div id='AMU0v'><tfoot id='AMU0v'></tfoot><dl id='AMU0v'><fieldset id='AMU0v'></fieldset></dl></div>
                  <tfoot id='AMU0v'></tfoot>

                  • <bdo id='AMU0v'></bdo><ul id='AMU0v'></ul>
                • <small id='AMU0v'></small><noframes id='AMU0v'>

                    <legend id='AMU0v'><style id='AMU0v'><dir id='AMU0v'><q id='AMU0v'></q></dir></style></legend>