ffs, ffmpeg.png



  • I finally just figured out what ffmpeg's doing when it's supposed to be capturing certain types of mouse cursors (the cursors with inverting pixels in them, as far as I could tell; the other ones are captured fine), but captures a transparent square instead. I'd noticed it before, but never figured out how to fix it. For example, the I-beam text select cursor:

    0_1477945447746_Untitled.png

    That square isn't colored, it's transparent. It produced a .png with transparent pixels there.

    So anyway, today I was fiddling around with capturing the desktop and writing to a .mp4 file using libx264, and it suddenly occurred to me that the mouse cursor was showing up just fine in that output format, when it produced the transparent square in the .png format. And then, it gradually began to dawn on me... could it be... NO! But yes: 30 seconds in GIMP revealed the ugly truth...


  • Impossible Mission Players - A

    TIL you can use ffmpeg to capture the screen....



  • @Tsaukpaetra that is correct, you can. But how you can use it to capture the screen probably depends on the OS, the version, and what was compiled into it.

    Originally when I wanted to record from the screen, it took a while to find something that worked, and I ended up getting a third-party dshow device driver that installed an input device I could use to record from the screen. Then today I discovered I could use -f gdigrab -i desktop, and that worked in a more recent version of ffmpeg, but not in the older version I'd been using before.



  • @anotherusername Rather than manually untransparent the pixels, couldn't you simply remove the alpha channel from the layer?


  • sockdevs

    @Medinoc said in ffs, ffmpeg.png:

    @anotherusername Rather than manually untransparent the pixels, couldn't you simply remove the alpha channel from the layer?

    which is super easy to do if you have imagemagick.

    convert source.png -alpha off dest.png
    

    yeah ffmpeg should do that for you but..... it doesn't. :-P



  • @Medinoc said in ffs, ffmpeg.png:

    @anotherusername Rather than manually untransparent the pixels, couldn't you simply remove the alpha channel from the layer?

    No. When you "Remove Alpha Channel" on a layer, GIMP recalculates the color of each partially-transparent pixel as if it were on top of a solid background color pixel.

    I could, after transferring the layer's alpha channel to the mask, have simply selected the layer's pixel map (not its mask), copied it, and pasted it as a new image. Or I could've simply filled the layer's mask with black using the fill tool, but that wouldn't have been as much fun to demonstrate.



  • @accalia said in ffs, ffmpeg.png:

    yeah ffmpeg should do that for you but..... it doesn't. :P

    But it's open source so just fix it yourself!!!!



  • @anonymous234 I'm just going to use ImageMagick... I'm already using a batch file to invoke ffmpeg with the parameters, so I'll just have it run that to process the resulting .png files after ffmpeg terminates.

    mogrify -alpha off *.png
    

    did the trick.

    (Thanks, @accalia.)


  • Winner of the 2016 Presidential Election

    @Tsaukpaetra said in ffs, ffmpeg.png:

    TIL you can use ffmpeg to capture the screen....

    No idea what gnome-shell uses internally, but I simply press Control+Shift+Alt+R and it produces a .webm file.



  • @asdf It's javascript, it's not node, and the API documentation is atrocious. That's about what I know, and none of what you wanted to know.



  • @asdf and then how do you crop it to just the part of the desktop that you want to show? Or how do you convert it to .mp4?


  • Impossible Mission Players - A

    @anotherusername said in ffs, ffmpeg.png:

    @asdf and then how do you crop it to just the part of the desktop that you want to show? Or how do you convert it to .mp4?

    I don't doubt ffmpeg has some compiled filters that take integer values to crop the video with...



  • @Tsaukpaetra ffmpeg does, absolutely. I was asking about his Ctrl+Shift+Alt+R command.

    I wouldn't be surprised if it used ffmpeg internally, as a matter of fact. But I don't generally want to capture the whole entire desktop, which is what it sounds like it'll do when he uses that feature.


  • Winner of the 2016 Presidential Election

    @anotherusername said in ffs, ffmpeg.png:

    But I don't generally want to capture the whole entire desktop, which is what it sounds like it'll do when he uses that feature.

    Yep, that's what it does. Not sure if there's a way to tell GNOME to capture only part of the screen or if you need to edit the video afterwards.



  • @asdf with ffmpeg you can just use -filter:v "crop=w:h:x:y".

    And I'll bet you that GNOME uses ffmpeg, and that it has a list of the ffmpeg parameters that it uses, buried in some config file somewhere. Probably in an disused lavatory behind a sign that says "beware of the leopard".


  • Discourse touched me in a no-no place

    @anotherusername said in ffs, ffmpeg.png:

    And I'll bet you that GNOME uses ffmpeg, and that it has a list of the ffmpeg parameters that it uses, buried in some config file somewhere. Probably in an disused lavatory behind a sign that says "beware of the leopard".

    All the best configuration options are behind that sort of sign.



  • @anotherusername said in ffs, ffmpeg.png:

    buried in some config file somewhere

    Pffft. Config files are so last century. They'll be in gconf.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.