multi track recorder
Michael Gruner
michael.gruner at ridgerun.com
Tue Apr 9 17:46:52 UTC 2024
I don't have a pi handy, but the pipeline will look something like:
gst-launch-1.0 -e \
videotestsrc pattern=0 ! x264enc ! h264parse ! queue ! mux. \
videotestsrc pattern=1 ! x264enc ! h264parse ! queue ! mux. \
videotestsrc pattern=2 ! x264enc ! h264parse ! queue ! mux. \
videotestsrc pattern=3 ! x264enc ! h264parse ! queue ! mux. \
videotestsrc pattern=4 ! x264enc ! h264parse ! queue ! mux. \
audiotestsrc wave=0 ! avenc_aac ! aacparse ! queue ! mux. \
audiotestsrc wave=1 ! avenc_aac ! aacparse ! queue ! mux. \
audiotestsrc wave=2 ! avenc_aac ! aacparse ! queue ! mux. \
audiotestsrc wave=3 ! avenc_aac ! aacparse ! queue ! mux. \
audiotestsrc wave=4 ! avenc_aac ! aacparse ! queue ! mux. \
audiotestsrc wave=5 ! avenc_aac ! aacparse ! queue ! mux. \
mp4mux name=mux ! filesink location=multichannel.mp4
Remember to replace the codecs by HW accelerated ones in the board. You may also need some videoconverts/audioconverts between the source and the codecs.
If then you run gst-discoverer-1.0 or ffprobe, you'll see all the streams:
gst-discoverer-1.0 multichannel.mp4
Analyzing file://.../multichannel.mp4
Done discovering file://.../multichannel.mp4
Properties:
Duration: 0:01:00.666666666
Seekable: yes
Live: no
container #0: Quicktime
video #1: H.264 (High 4:4:4 Profile)
Stream ID: 5d5147a411fca6ac5b9d25e15cb88b581ab3dad0e4fab3dc143cd0501c3f984f/001
Width: 320
Height: 240
Depth: 24
Frame rate: 30/1
Pixel aspect ratio: 1/1
Interlaced: false
Bitrate: 1488272
Max bitrate: 2097152
video #2: H.264 (High 4:4:4 Profile)
Stream ID: 5d5147a411fca6ac5b9d25e15cb88b581ab3dad0e4fab3dc143cd0501c3f984f/002
Width: 320
Height: 240
Depth: 24
Frame rate: 30/1
Pixel aspect ratio: 1/1
Interlaced: false
Bitrate: 2055385
Max bitrate: 2097152
....
audio #10: MPEG-4 AAC
Stream ID: 5d5147a411fca6ac5b9d25e15cb88b581ab3dad0e4fab3dc143cd0501c3f984f/010
Language: <unknown>
Channels: 1 (unknown layout)
Sample rate: 44100
Depth: 32
Bitrate: 1423
Max bitrate: 7235
audio #11: MPEG-4 AAC
Stream ID: 5d5147a411fca6ac5b9d25e15cb88b581ab3dad0e4fab3dc143cd0501c3f984f/011
Language: <unknown>
Channels: 1 (unknown layout)
Sample rate: 44100
Depth: 32
Bitrate: 69165
Max bitrate: 80275
> On 9 Apr 2024, at 11:32, Carl Karsten via gstreamer-devel <gstreamer-devel at lists.freedesktop.org> wrote:
>
> I would like to record 5 video streams and 6 audio streams to 1 file.
>
> this will all run on a pi4 (or maybe 5)
> 2 pi cameras libcamerasrc ... v4l2h264enc (can the gpu encode 2 streams?)
> 1 usb cam
> 2 tcpserversrc (coming from another pi gst.... tcpclientsink)
>
> audio is 4 usb audio devices
>
> I suspect the 2 tcp sources should use GstNet.NetClientClock
>
> I think the only thing I need help with is muxing all the streams into
> one so if someone can give me a gst-launch with 5+6 testsrc's I'll
> take a shot at swapping them for the real sources.
>
>
> --
> Carl K
More information about the gstreamer-devel
mailing list