Java – ffmpeg for screenshots?
•
Java
So I have an applet that captures the screen and makes sound from the microphone of the computer,
How to use ffmpeg to multiplex frame by frame and then send the multiplexed output to wowza media server?
If it can't be done with ffmpeg, can you provide any suggestions?
Solution
Which OS? Under Linux, you may need to consider http://kde-apps.org/content/show.php/FDesktopRecorder?content=147844
The core of the script is:
Record screen:
ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 30 -s $(xwininfo -root | \ grep 'geometry' | awk '{print $2;}') -i :0.0 -acodec flac -vcodec libx264 \ -vpre lossless_ultrafast -threads 0 -y output.mkv
Record a window:
#!/bin/sh INFO=$(xwininfo -frame) WIN_GEO=$(echo $INFO | \ grep -oEe 'geometry [0-9]+x[0-9]+' | \ grep -oEe '[0-9]+x[0-9]+')WIN_XY=$(echo $INFO | \ grep -oEe 'Corners:\s+\+[0-9]+\+[0-9]+' | grep -oEe '[0-9]+\+[0-9]+' | \ sed -e 's/\+/,/' ) ffmpeg -f alsa -ac 2 -i pulse -f x11grab -r 30 \ -s $WIN_GEO -i :0.0+$WIN_XY -acodec flac -vcodec libx264 \ -vpre lossless_ultrafast -threads 0 -y output-single.mkv
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码