Run samtools on files in the Google Cloud

export GCS_OAUTH_TOKEN=`gcloud auth application-default print-access-token`
samtools view -H gs://bucket/file.bam

Samtools has to be compiled with the https and google cloud support of course.

Syntax highlighting in SE

<!-- language: lang-js -->

    code goes here

Extract sound track without recoding

ffprobe input-video.mp4
ffmpeg -i input-video.mp4 -vn -acodec copy output-audio.aac

Extract time range

ffmpeg -i in.mp4 -ss 10 -t 30 -acodec copy -vcodec copy out.mp4