gpt4 book ai didi

split - TCL 脚本无法在 Windows 7 平台上使用多个摄像头

转载 作者:行者123 更新时间:2023-12-04 23:15:09 24 4
gpt4 key购买 nike

我的 TCL 脚本适用于单相机。 TCL 脚本如下:

proc liveStreaming {} {

#open the config file.
set f [open "C:/main/video_config.txt" r]

#To retrive the values from the config file.
while {![eof $f]} {
set part [split [gets $f] "="]
set props([string trimright [lindex $part 0]]) [string trimleft [lindex $part 1]]
}
close $f

#camera selection to live streaming.
set camera "video"
append cctv $camera "=" $props(cctv)

#ffmpeg command to capture live streaming in background
exec ffmpeg -f dshow -s 1280x720 -i $cctv c:/test/sample.avi >& c:/test/temp.txt &

}
liveStreaming

//above code is to capture video using ffmpeg and tcl.

我的文本文件“video_config”如下:
cctv=Logitech HD Webcam C525

因为,我希望它与多个摄像头一起运行:文本文件应如下所示:
cctv=Integrated Webcam,Logitech HD Webcam C525

问题是“,”(逗号),我的 TCL 脚本无法预测逗号(,)。任何人都可以为我提供可以预测昏迷的正确 TCL 脚本,以便我的 TCL 脚本可以与多个摄像头一起使用。

错误报告 :

ffmpeg version N-89127-g8f4702a93f Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx
libavutil 56. 0.100 / 56. 0.100
libavcodec 58. 3.103 / 58. 3.103
libavformat 58. 2.100 / 58. 2.100
libavdevice 58. 0.100 / 58. 0.100
libavfilter 7. 2.100 / 7. 2.100
libswscale 5. 0.101 / 5. 0.101
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100
[dshow @ 05944ac0] Could not find video device with name [Integrated Webcam,Logitech HD Webcam C525] among source devices of type video.
video=Integrated Webcam,Logitech HD Webcam C525: I/O error

最佳答案

您可以通过另一个 split 来实现此目的, 使用 foreach环形:

proc liveStreaming {} {

#open the config file.
set f [open "C:/main/video_config.txt" r]

#To retrive the values from the config file.
while {![eof $f]} {
set part [split [gets $f] "="]
set props([string trimright [lindex $part 0]]) [string trimleft [lindex $part 1]]
}
close $f

#camera selection to live streaming.

# let cams be the list of available cameras
set cams [split $props(cctv) "," ]
set idx 0

# for each camera in cameras list
foreach cam cams {
set cctv "video=$cam"

#ffmpeg command to capture live streaming in background
exec ffmpeg -f dshow -s 1280x720 -i $cctv "c:/test/sample-$idx.avi" >& "c:/test/temp-$idx.txt" &

# create a new index (to prevent two cameras to create the same file)
incr idx
}
}
liveStreaming

关于split - TCL 脚本无法在 Windows 7 平台上使用多个摄像头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47432845/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com