Sample Header Ad - 728x90

Screencast script based on FFMPEG

0 votes
1 answer
432 views
I am trying to write my own screencast script based on FFmpeg. I want to be able to draw a rectangle on the screen and force FFmpeg to make a screencast of this area only, for that I would need the coordinates of x,y of the starting point, and the resolution of the selected area. I can draw a rectangular area with scrot -s and I can also get the coordinates with xdotool getmouselocation but I don't know how I can save the location of the scrot start location. I am imagining my script will be something like this: 1. scrot -s - draw a rectangular area on the screen 2. save start_x, start_y locations in a variable 3. ffmpeg -i scrot_screenshot - to get resolution of the selected area 4. ffmpeg -video_size $area_resolution -f x11grab -i :0.0+start_x,start_y screen_capture.mp4 - to create the screencast So I need a solution for 2 only, I can do the rest of the script on my own. I can, of course, use a different than scrot command for drawing the rectangular area of the screen, but so far, I didn't find a suitable replacement. The final goal is to create such a script and I will for sure publish it on my Github account with the respective documentation on how to use it.
Asked by Georgi Stoyanov (860 rep)
Apr 24, 2020, 10:50 AM
Last activity: Apr 25, 2020, 10:29 AM