File: record-mixed-av.sh

package info (click to toggle)
voctomix-outcasts 0.9.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 212 kB
  • sloc: python: 688; sh: 156; makefile: 18
file content (49 lines) | stat: -rwxr-xr-x 1,644 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
# Copyright: 2015,2016    Carl F. Karsten <carl@nextdayvideo.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.

# $1 - destination dir. default: ~/Videos
# files will be $dest_dir/$date/$time.gs.ts
# (.gs to keep these apart from the files created by record-timestamp.sh)

# NB: does not chunk files.  keeps saving untill the process is killed.

# TODO: https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good/html/gst-plugins-good-plugins-splitmuxsink.html

# splitmuxsink — Muxer wrapper for splitting output stream by size or time

dest_dir=${1:-~/Videos}/$(date +%Y-%m-%d)

mkdir -p $dest_dir

gst-launch-1.0 \
    tcpclientsrc host=localhost port=11000 !\
    \
    matroskademux name=demux \
    \
    demux. !\
        queue !\
        videoconvert !\
        avenc_mpeg2video bitrate=5000000 max-key-interval=0 !\
        queue !\
        mux. \
    \
    demux. !\
        queue !\
        audioconvert !\
        avenc_mp2 bitrate=192000 !\
        queue !\
        mux. \
    \
    mpegtsmux name=mux !\
        filesink location="$dest_dir/$(date +%H_%M_%S).gs.ts"