summaryrefslogtreecommitdiff
path: root/localvideopostprocess
blob: 9a6542533dfb66f5bd15523422589822d3cdbcb4 (plain)
  1. #!/bin/sh
  2. # Copyright © 2012-2014 Jonas Smedegaard <dr@jones.dk>
  3. # Description: post-process fast-recorded multitrack video
  4. #
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 3, or (at your option)
  8. # any later version.
  9. #
  10. # This program is distributed in the hope that it will be useful, but
  11. # WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. # General Public License for more details.
  14. #
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. #
  18. # Depends: libav-tools
  19. #
  20. # TODO: add --help option
  21. # TODO: make codecs, rates etc. configurable
  22. # TODO: include SMTPE channel
  23. # TODO: Check and ask if outfile already exist
  24. # TODO: Add --force option to skip asking for overwriting
  25. set -e
  26. input="${1:-dump.nut}"
  27. output="${2:-dump.mkv}"
  28. #vcodec=huffyuv # more common
  29. #vcodec=ffvhuff # more compact, supports YV12 colorspace
  30. vcodec=ffv1 # most compact, supports RGBA colorspace, too CPU-hungry
  31. acodec=pcm_s16le
  32. #vf="${vf:+$vf }-vf setpts=(RTCTIME-RTCSTART)/(TB*1000000)" # current time
  33. vf="${vf:+$vf }-vf hqdn3d" # high-quality denoise (good for webcams)
  34. #font='/usr/share/fonts/truetype/droid/DroidSans.ttf'
  35. #vf="${vf:+$vf }-vf "drawtext=fontfile=$font: timecode='09\:57\:00\:00': r=25: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1"}"
  36. #vf="${vf:+$vf }-vf "drawtext=fontfile=DroidSans.ttf:'timecode=09\:57\:00\:00':r=25:x=\(w-tw\)/2:y=h-\(2*lh\):fontcolor=white:box=1:boxcolor=0x00000000@1"}"
  37. inargs="-i file:$input"
  38. maps="-map 0"
  39. voutargs="-c:v $vcodec $vf ${outrate:+-r $outrate}"
  40. aoutargs="-c:a $acodec"
  41. echo avconv -threads auto $inargs $maps $voutargs $aoutargs -y "$output"
  42. exec avconv -threads auto $inargs $maps $voutargs $aoutargs -y "$output"