Advertisement
zcutlip

Mythtv HDPVR color fixer

Aug 21st, 2012
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.64 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. #A hack to "fix" the HDPVR color saturation issue in MythTV
  4. #Run this as a "Recording Started" event.
  5.  
  6. #Sleep a bit to let recording get started.
  7. sleep 2;
  8.  
  9. #is kernel < 3.4? This is supposedly fixed in kernel >= 3.4
  10. fixed_ver=3.4
  11. kern_ver=$(uname -r | cut -f 1-2 -d .)
  12.  
  13. if [ $(expr $kern_ver \< $fixed_ver) -ne 1 ];
  14. then
  15.         exit 0
  16. fi
  17.  
  18. color_fix() {
  19.         device=$1
  20.         /usr/bin/v4l2-ctl --device=$device --set-ctrl brightness=0x80 --set-ctrl contrast=0x40 --set-ctrl hue=0xf --set-ctrl saturation=0x40 --set-ctrl sharpness=0x80  || exit $?
  21. }
  22.  
  23. for device in /dev/hdpvr*; do
  24.         color_fix $device;
  25. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement