如何使用avconv减少CPU消耗并将其通过管道传输到avplay? [英] How to reduce CPU consumption by using avconv and pipe it to avplay?

查看:107
本文介绍了如何使用avconv减少CPU消耗并将其通过管道传输到avplay?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请参阅最终编辑。

我需要捕获第二个监视器并在小窗口中显示在主显示屏中。我不需要质量,但需要性能。

I need to capture the second monitor and show in main display in a small window. I don't need quality, but performance.

因此,(工作)命令捕获第二个1280x1024监视器,并以640x480窗口的速度显示15fps,然后水平翻转,将是(来自 askUbuntu ):

So, the (working) command to capture second monitor of 1280x1024 and show it in a 640x480 window at 15fps and horizonatally flipped, would be (from askUbuntu):

avconv -f x11grab -r 15 -s 1280x1024 -i :0.1 -c:v mpeg4 \
  -b:v 1000k -s 640x480 -vf "hflip" -f avi - | avplay -i -




  • 如何使用无插值进行缩放? / li>
  • 我使用 -c:v mpeg4和 -b:v 1000k来获得良好的图像质量,但是...还有其他格式/比特率可以降低CPU消耗?

  • 我知道水平翻转是一种基本效果,但是有什么方法可以告诉avconv通过使用-vf选项来减少CPU?

  • 当播放窗口中的星星开始显示时,将尊重其15fps。但是然后,它逐渐降低并逐渐冻结……直到我单击窗口。然后,它上升到15fps,然后再次降低。为什么会这样,如何避免呢?我尝试在avconv和avplay上同时使用 nice -n-20,但这没什么区别。

  • 我需要性能,而不是质量,我说节省CPU更为重要...但是我不想看到完整的低压缩伪像视频

    When I say that I need performance, not quality, I say that it's more important to save CPU... but I don't want to see a full-of-low-compression-artifacts video.

    我正在使用Ubuntu-Mate 14.04。

    I'm on Ubuntu-Mate 14.04.

    谢谢!

    最终编辑:命令为:

    avconv -f x11grab -r 30 -s 1280x1024 -i :0.0+1920 -c:v mpeg4 \
    -b:v 1000k -vf "hflip" -vf "scale=640:480" -sws_flags "neighbor" \
    -f avi - | avplay -i -
    

    但是帧速率问题没有解决,它消耗16-18%的CPU。在此问题中,使用gst-launch的Gstreamer选项:它消耗2-4%的CPU。因此,avconvert / avplay选项对我没有用。

    But the framerate issue is not solved and it consumes 16-18% CPU. In this question, there is the Gstreamer option, with gst-launch: it consumes 2-4% CPU. So, the avconvert/avplay option is not usefull for me.

    推荐答案

    尝试使用 framerate x11grab的选项。

    Try with using the framerate option for x11grab.

    这篇关于如何使用avconv减少CPU消耗并将其通过管道传输到avplay?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆