this shell script dont  work well for capture video that is plaing in the browser , can you fix it      
# Maximiza la ventana de Firefox
wmctrl -r Firefox -b add,maximized_vert,maximized_horz

# Obtiene la información de la ventana de reproducción de vídeo de Firefox
wininfo=$(xwininfo -frame -name "Mozilla Firefox")

# Obtiene las coordenadas y dimensiones de la ventana
x=$(echo $wininfo | grep "Absolute upper-left X" | awk '{print $4}')
y=$(echo $wininfo | grep "Absolute upper-left Y" | awk '{print $4}')
width=$(echo $wininfo | grep "Width" | awk '{print $2}')
height=$(echo $wininfo | grep "Height" | awk '{print $2}')

# Inicia la grabación de pantalla con ffmpeg
ffmpeg -f x11grab -y -r 30 -s "${width}x${height}" -i ":0.0+${x},${y}" -vcodec libx264 \
-preset ultrafast -crf 0 -threads 0 output.mkv

echo "¡NAME_1! NAME_2 video se ha grabado correctamente."

vlc output.mkv

 Provide two versions of response separated with exactly 6 asterisk symbols: ******.
user