VL C Поток цепочки скриптов - PullRequest
0 голосов
/ 09 марта 2020

Я пытался создать скрипт, который сохраняет поток в mp4 с использованием h264. Часть после --sout была извлечена из GUI в мастере потоков.

Моя проблема: поток не отображается и не сохраняется, и он не получает переменную, которую я установил в качестве имени файла

#!/bin/bash
#date
#date +"%c"
#var=$(date)
#var=`date`

#now=$date
#echo "$now"
date +"%m_%d_%Y"
now=$(date +"%m_%d_%Y")
_now=$(date +"%T_%d_%m_%Y")
_file="vidlecture_$_now.mp4"
vlc -vvv tcp://1.1.1.1:3000 --sout="#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:duplicate{dst=file{dst=$file.mp4,no-overwrite},dst=display}:no-sout-all:sout-keep"

Это ошибка, которую я получаю:

[9f30dbe0] main stream output error: stream chain failed for `transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:duplicate{dst=file{dst=.mp4,no-overwrite},dst=display}:no-sout-all:sout-keep'
[9f20f3f0] main input error: cannot start stream output instance, aborting
[01d3c6e0] main playlist debug: dead input
[01d3c6e0] main playlist debug: changing item without a request (current 0/1)
[01d3c6e0] main playlist debug: nothing to play

РЕДАКТИРОВАТЬ:

Я обновил свой скрипт и ошибку здесь, чтобы отразить комментарий @ Аарона, который помог мне исправить переменную имени файла. Скрипт:

#!/bin/bash
#date
#date +"%c"
#var=$(date)
#var=`date`

#now=$date
#echo "$now"
date +"%m_%d_%Y"
now=$(date +"%m_%d_%Y")
_now=$(date +"%T_%d_%m_%Y")
_file="vidlecture_$_now.mp4"
vlc -vvv tcp://1.1.1.1:3000 --sout="#transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:duplicate{dst=file{dst=$_file.mp4,no-overwrite},dst=display}:no-sout-all:sout-keep"

Ошибка:

[9f30da80] main stream output debug: stream=`sout-keep'
[9f30dc80] main stream out debug: looking for sout stream module matching "sout-keep": 23 candidates
[9f30dc80] main stream out debug: no sout stream modules matched
[9f30dc80] main stream out debug: destroying chain... (name=(null))
[9f30dc80] main stream out debug: destroying chain done
[9f30da80] main stream output error: stream chain failed for `transcode{vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:duplicate{dst=file{dst=vidlecture_11:30:58_09_03_2020.mp4.mp4,no-overwrite},dst=display}:no-sout-all:sout-keep'
[9f20f390] main input error: cannot start stream output instance, aborting

...