Overview
Request 965 (accepted)
- dvswitch-0.9-susedevel-fae6162.tar.gz is 20140408git_jw01
- no longer using local contrib scripts. Pulling them from the tar ball now.
(but updated them nevertheless, in case we want to try a vanilla upstream tar again)
- fixed dvsource-title to work with ffmpeg-2.2
- fixed dvswitch to properly initialize AVFrame structures.
- feature: dvsink-files now prints remaining space and time.
- feature: safe frame is off per default.
- feature: also install demo images for dvsource-title with dvswitch-client package
- dvswitch-0.9-susedevel-f9bc756.tar.gz is 20140331git_jw01
- revert_wouter.diff 'upstreamed' kindof.
- building directly in Packman/Multimedia now.
dvswitch-git.changes
Changed
-------------------------------------------------------------------
+Wed Apr 9 00:26:55 UTC 2014 - jnweiger@gmail.com
+
+- dvswitch-0.9-susedevel-fae6162.tar.gz is 20140408git_jw01
+- no longer using local contrib scripts. Pulling them from the tar ball now.
+ (but updated them nevertheless, in case we want to try a vanilla upstream tar again)
+- fixed dvsource-title to work with ffmpeg-2.2
+- fixed dvswitch to properly initialize AVFrame structures.
+- feature: dvsink-files now prints remaining space and time.
+- feature: safe frame is off per default.
+- feature: also install demo images for dvsource-title with dvswitch-client package
+
+-------------------------------------------------------------------
+Mon Mar 31 21:45:47 UTC 2014 - jnweiger@gmail.com
+
+- dvswitch-0.9-susedevel-f9bc756.tar.gz is 20140331git_jw01
+- revert_wouter.diff 'upstreamed' kindof.
+- building directly in Packman/Multimedia now.
+
+-------------------------------------------------------------------
Fri Nov 15 00:41:14 UTC 2013 - jw@suse.de
- oops, should not have pulled upstream, wouters last commit was half done.
dvswitch-git.spec
Changed
#
### output file from gitfetch.sh here:
-%define tarname dvswitch-0.9-susedevel-8b96437
+# % define tarname dvswitch-0.9-susedevel-8b96437
+# % define tarname dvswitch-0.9-susedevel-f9bc756
+%define tarname dvswitch-0.9-susedevel-fae6162
-### this one is vanilla, it needs the patches:
+### this one is vanilla, it needs the patches and the extra sources:
# % define tarname dvswitch-0.9-1-da15ba4.tar.gz
Name: dvswitch-git
-Version: 20131114git_jw01
+Version: 20140408git_jw01
Release: 0
License: GPL-2.0+
Summary: Video mixer for firewire devices
Source4: gitfetch.sh
Source5: CarlFK-dvsmon-e00779c.tar.gz
Source101: etc_dvswitchrc
+## unused sources. They are included in the susedevel branch of github.com/jnweiger/dvswitch
Source102: dvsource-webcam.pl
Source103: dvtrim.pl
Source104: dv2webm.sh
Source110: dvrecord.sh
Source111: dv-upload.sh
Source112: dvsource-firewire2switch
+## end of unused sources.
+## unused patches. They are included in the susedevel branch of github.com/jnweiger/dvswitch
Patch1: dvsource-command.diff
Patch2: retry_connect_option.diff
Patch3: stopped_status.diff
Patch10: title_hup.diff
Patch11: mfade_area.diff
Patch100: revert_wouter.diff
+## end of unused patches.
BuildRequires: cmake pkg-config gcc-c++
BuildRequires: fdupes
BuildRequires: glibc alsa-devel gtkmm2-devel ffmpeg-devel
# % patch10 -p1
# # mfade_area.diff
# % patch11 -p1
-# revert_wouter.diff
-%patch100 -p1
+# revert_wouter.diff needed with 8b96437, but already applied with f9bc756
+# % patch100 -p1
grep Manual src/*.c
make
%check
-perl -c %{SOURCE102}
-perl -c %{SOURCE103}
-perl -c %{SOURCE105}
-perl -c %{SOURCE106}
-perl -c %{SOURCE107}
-perl -c %{SOURCE108}
-perl -c %{SOURCE109}
+# these are all unused. pulled below directly from the tar
+# perl -c % {SOURCE102}
+# perl -c % {SOURCE103}
+# perl -c % {SOURCE105}
+# perl -c % {SOURCE106}
+# perl -c % {SOURCE107}
+# perl -c % {SOURCE108}
+# perl -c % {SOURCE109}
%install
%makeinstall
install -m 0644 %{SOURCE101} ./etc_dvswitchrc
-install -Dm 0755 %{SOURCE102} %{buildroot}%{_bindir}/dvsource-webcam
-install -Dm 0755 %{SOURCE103} %{buildroot}%{_bindir}/dvtrim
-install -Dm 0755 %{SOURCE104} %{buildroot}%{_bindir}/dv2webm
-install -Dm 0755 %{SOURCE105} %{buildroot}%{_bindir}/dvsink-bambuser
-install -Dm 0755 %{SOURCE106} %{buildroot}%{_bindir}/dvsource-title
-install -Dm 0755 %{SOURCE107} %{buildroot}%{_bindir}/dvsink-icecast
-install -Dm 0755 %{SOURCE108} %{buildroot}%{_bindir}/dvsink-fullscreen
-install -Dm 0755 %{SOURCE109} %{buildroot}%{_bindir}/dvsource-firewire-next
-install -Dm 0755 %{SOURCE110} %{buildroot}%{_bindir}/dvrecord
-install -Dm 0755 %{SOURCE111} %{buildroot}%{_bindir}/dv-upload
-install -Dm 0755 %{SOURCE112} %{buildroot}%{_bindir}/dvsource-firewire2switch
+install -Dm 0644 contrib/*.jpg .
+install -Dm 0755 contrib/scripts/dvsource-webcam.pl %{buildroot}%{_bindir}/dvsource-webcam
+install -Dm 0755 contrib/scripts/dvtrim.pl %{buildroot}%{_bindir}/dvtrim
+install -Dm 0755 contrib/scripts/dv2webm.sh %{buildroot}%{_bindir}/dv2webm
+install -Dm 0755 contrib/scripts/dvsink-bambuser.pl %{buildroot}%{_bindir}/dvsink-bambuser
+install -Dm 0755 contrib/scripts/dvsource-title.pl %{buildroot}%{_bindir}/dvsource-title
+install -Dm 0755 contrib/scripts/dvsink-icecast.pl %{buildroot}%{_bindir}/dvsink-icecast
+install -Dm 0755 contrib/scripts/dvsink-fullscreen.pl %{buildroot}%{_bindir}/dvsink-fullscreen
+install -Dm 0755 contrib/scripts/dvsource-firewire-next.pl %{buildroot}%{_bindir}/dvsource-firewire-next
+install -Dm 0755 contrib/scripts/dvrecord.sh %{buildroot}%{_bindir}/dvrecord
+install -Dm 0755 contrib/scripts/dv-upload.sh %{buildroot}%{_bindir}/dv-upload
+install -Dm 0755 contrib/dv2switch/dvsource-firewire2switch %{buildroot}%{_bindir}/dvsource-firewire2switch
false && install -Dm 0644 %{SOURCE1} %{buildroot}%{_mandir}/man1/dvswitch.1
false && %fdupes %{buildroot}%{_datadir}
%files client
%defattr(-,root,root,-)
-%doc COPYING doc/examples/* doc/README etc_dvswitchrc
+%doc COPYING doc/examples/* doc/README etc_dvswitchrc *.jpg
%exclude %{_bindir}/dvswitch
%exclude %{_bindir}/dvsink-fullscreen
%{_bindir}/*
dv2webm.sh
Changed
#! /bin/sh
##
## FIXME: -deinterlace is deprecated, use -filter:v yadif instead
-## FIXME: make -ss a command line option.
-## FIXME: allow multiple input files here.
+## 2013-08-17, v0.3, jw -- added --bitrate option.
+## 2013-11-19, v0.4, jw -- added --cwd option to strip the full path.
+## 2014-04-08, v0.5, jw -- pumped up the default bitrate according to tests by darix.
-infile=$1
-outfile=${infile%.dv}.webm
+
+version=0.5
startsecs=0.0
-test -n "$2" && startsecs=$2
+bitrate="b:v 500k"
+duration=
+cwd=
+
+
+ARGS=`getopt -o "s:o:t:h" -l "start:,output:,duration:,help" -n "dv2webm V$version" -- "$@"`
+eval set -- "$ARGS"
+while true;
+do
+ case "$1" in
+ -h|--help)
+ usage
+ exit 0;;
+ -s|--startsecs)
+ startsecs="$2"
+ shift 2;;
+ -o|--output)
+ outfile="$2"
+ shift 2;;
+ -t|--duration)
+ duration="-t $2"
+ shift 2;;
+ --)
+ shift
+ break;;
+ esac
+done
+
+
+infile=$1
+shift
+if [[ "$outfile" == "" ]]; then
+ outfile=${infile%.dv}
+ # check if a timestamp YYYY-MM-DD is present, if not add one.
+ if ! [[ "$outfile" =~ 20[0-9]{2} ]]; then
+ outfile="$outfile-$(date +'%Y-%m-%d')"
+ fi
+ outfile="$outfile.webm"
+ echo "writing output to $outfile"
+fi
+
+usage ()
+{
+echo "
+ dv2webm Version $version
+
+ Usage: $0 [OPTIONS] INFILE.dv [... INFILE.dv]
+
+ Options:
+ -b,--bitrate NNNk
+ Encode at the specified bitrate.
+ Default: ffmpeg's choice, often 400k.
+ -c,--cwd
+ Drop output files in current working directory.
+ Default: same path where input is.
+ This is exclusive to -o .
+ -s,--startsecs N.N
+ -s,--startsecs HH:MM:SS[.XXX]
+ Skip number of seconds from the start.
+ Default: '$startsecs' .
+ -t,--duration N.N
+ -t,--duration HH:MM:SS[.XXX]
+ Stop after N.N seconds of video were produced.
+ Default: stop when input ends.
+ -o,--output FILE.webm
+ Define the output file name. Default: Derive from
+ input file name (first input file name, if multiple).
+ -h,--help
+ Display this help.
+
+ INFILE.dv ...
+ One or multiple input files in dv format. The files will be concatenated
+ in the given order, then a startsecs skip will be applied if any.
+"
+}
+
+
+ARGS=`getopt -o "s:o:t:b:hc" -l "start:,output:,duration:,bitrate:,help,cwd" -n "dv2webm V$version" -- "$@"`
+eval set -- "$ARGS"
+while true;
+do
+ case "$1" in
+ -h|--help)
+ usage
+ exit 0;;
+ -s|--startsecs)
+ startsecs="$2"
+ shift 2;;
+ -c|--cwd)
+ cwd=1
+ shift 1;;
+ -o|--output)
+ outfile="$2"
+ shift 2;;
+ -t|--duration)
+ duration="-t $2"
+ shift 2;;
+ -b|--bitrate)
+ bitrate="-b:v $2"
+ shift 2;;
+ --)
+ shift
+ break;;
+ esac
+done
+
+
+infile=$1
+shift
+if [[ "$outfile" == "" ]]; then
+ if [[ "$cwd" == "" ]]; then
+ outfile=${infile%.dv}
+ else
+ outfile=$(basename $infile .dv)
+ fi
+ # check if a timestamp YYYY-MM-DD is present, if not add one.
+ if ! [[ "$outfile" =~ 20[0-9]{2} ]]; then
+ outfile="$outfile-$(date +'%Y-%m-%d')"
+ fi
+ outfile="$outfile.webm"
+ echo "writing output to $outfile"
+fi
if [ ! -f "$infile" ]; then
echo "input .dv file '$infile' not found"
- echo "Usage: $0 INFILE.dv [START_POSITION_SECS]"
+ usage
exit
fi
-echo ffmpeg -ss $startsecs -i "$infile" -deinterlace -threads auto "$outfile"
+
+need_concat=0
+for i in $*; do
+ need_concat=1
+ infile="$infile|$i"
+done;
+
+if [[ $need_concat ]]; then
+ infile="concat:$infile"
+fi
+
+echo ffmpeg -ss $startsecs -i "$infile" -deinterlace -threads auto $duration $bitrate "$outfile"
sleep 3
-ffmpeg -ss $startsecs -i "$infile" -deinterlace -threads auto "$outfile"
+ffmpeg -ss $startsecs -i "$infile" -deinterlace -threads auto $duration $bitrate "$outfile"
+
dvsink-bambuser.pl
Changed
# dvsink-bambuser.pl is a userfriendly wrapper for dvsink-command.
# It creates a live stream suitable for bambuser.com
#
-# (C) 2012, jw@suse.de, distribute under GPL-2.0+ or ask.
+# (C) 2013, jw@suse.de, distribute under GPL-2.0+ or ask.
# 2012-09-30 -- V0.1 initial draft.
# 2012-10-21 -- V0.2 broken config file support added
# 2012-10-25 -- V0.3 fixed config file support
+# 2013-10-21 -- V0.4 Added --record option. Beware of dropouts.
+# 2013-10-21 -- V0.5 Added ping test and verbose hint to find bad config easier.
#
## Requires: ffmpeg
use Getopt::Long qw(:config no_ignore_case);
use Pod::Usage;
-my $version = '0.3';
+my $version = '0.5';
my $a_chan = undef;
my $a_name = undef;
my $retry_connect = 0;
my $channel_url = 'http://bambuser.com/channel/opensusetv';
my $channel_admin = 'Juergen Weigert <jw@suse.de> #opensuse-video@irc.freenode.org';
my $config_file = undef;
+my $recording = undef;
GetOptions(
"retry|R" => \$retry_connect,
"verbose|v" => \$verbose,
+ "record|r=s" => \$recording,
"port|p=s" => \$port,
"host|h=s" => \$host,
"config|c=s" => sub { $ENV{ICECAST_CONF_FILE} = $_[1]; },
Specify the network address on which DVswitch is listening. The
host address may be specified by name or as an IPv4 or IPv6 literal.
+ -r, --recording=FILE_FORMAT
+ Stop sending to bambuser, when record button is not pressed; and
+ use dvsink_tee instead of dvsink_command to also record what is
+ beeing sent. If the FILE_FORMAT does not contain '%' characters,
+ '_%F_%H%M%S' is appended. A '_%04d.dv' suffix is also added.
+ Default: always send, never record to file.
+
--320 --480 --640 --720
Select a specific output size and bandwidth.
Default: '$ffmpeg_opt'
The channel at $channel_url
is run by $channel_admin
-
}) if $help;
$ffmpeg_opt = getconfig('ffmpeg_opt') || $ffmpeg_opt_def;
my $url = shift || getconfig('bambuser_rtmp_url') || die "please provide a URL like $ffmpeg_rtmp\n";
$ffmpeg_rtmp = $url;
+my $hostname = $1 if $url =~ m{//([^:/]+)};
+if ($hostname)
+ {
+ # try pinging first, makes debugging easier.
+ print "+ ping -n 1 -w 3 $hostname\n";
+ system("ping -n 1 -w 3 $hostname");
+ }
+
my $ff_verbose = ($verbose > 1) ? 'verbose' : 'quiet';
my $ffmpeg = sprintf $ffmpeg_fmt, $ff_verbose, $ffmpeg_opt, $ffmpeg_rtmp;
my $cmd = 'dvsink-command';
+$cmd = 'dvsink-tee' if $recording;
$cmd .= ' --retry' if $retry_connect;
$cmd .= " --port=$port" if defined $port;
$cmd .= " --host=$host" if defined $host;
-print "+ $cmd -- $ffmpeg\n" if $verbose;
-system "$cmd -- $ffmpeg" and die "failed to run '$cmd'\n";
+if ($recording)
+ {
+ unless ($recording =~ m{%})
+ {
+ $recording .= '_%F_%H%M%S';
+ }
+ print "+ $cmd -c '$ffmpeg' $recording\n" if $verbose;
+ system "$cmd -c '$ffmpeg' $recording" and die "failed to run '$cmd'\n";
+ }
+else
+ {
+ print "+ $cmd -- $ffmpeg\n" if $verbose;
+ system "$cmd -- $ffmpeg" and die "failed to run '$cmd'\n";
+ }
exit 0;
sub getconfig
dvsource-title.pl
Changed
# (C) 2012, jw@suse.de, distribute under GPL-2.0+ or ask.
# 2012-10-10 -- V0.1 initial draft.
# 2012-10-16 -- V0.2 added support for directories
+# 2014-04-07 -- V0.3 /dev/zero no longer works. Need to place a real file.
#############
## Requires: perl, ffmpeg
use Pod::Usage;
use POSIX ":sys_wait_h";
-my $version = '0.2';
+my $version = '0.3';
my $retry_connect = 0;
my $host = undef;
my $port = undef;
my $last_touch = $stat->mtime;
my $last_size = $stat->size;
+my $silence_blocks = int(1 + 2 * 8 * $loop_sec);
+my $silence_wav = "_title_silence_${silence_blocks}k.wav";
+system "dd if=/dev/zero of=$silence_wav bs=1024 count=$silence_blocks";
+
my $ff_ver = $verbose ? 'info' : 'error';
-my $ffmpeg_fmt = "ffmpeg -v $ff_ver -f s16le -ar 8000 -i /dev/zero -loop 1 -t $loop_sec -i '%s' -target pal-dv '$img.dv'";
+my $ffmpeg_fmt = "ffmpeg -v $ff_ver -f s16le -ar 8000 -i $silence_wav -loop 1 -t $loop_sec -i '%s' -target pal-dv '$img.dv'";
my @cmd = ( $ENV{DVSOURCE_FILE} || 'dvsource-file' );
Request History
jnweiger created request almost 11 years ago
- dvswitch-0.9-susedevel-fae6162.tar.gz is 20140408git_jw01
- no longer using local contrib scripts. Pulling them from the tar ball now.
(but updated them nevertheless, in case we want to try a vanilla upstream tar again)
- fixed dvsource-title to work with ffmpeg-2.2
- fixed dvswitch to properly initialize AVFrame structures.
- feature: dvsink-files now prints remaining space and time.
- feature: safe frame is off per default.
- feature: also install demo images for dvsource-title with dvswitch-client package
- dvswitch-0.9-susedevel-f9bc756.tar.gz is 20140331git_jw01
- revert_wouter.diff 'upstreamed' kindof.
- building directly in Packman/Multimedia now.
seife accepted request almost 11 years ago
let's assume you know what you are doing :-P