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.

Submit package home:jnweiger / dvswitch-git to package Multimedia / dvswitch-git

dvswitch-git.changes Changed
x
 
1
@@ -1,4 +1,23 @@
2
 -------------------------------------------------------------------
3
+Wed Apr  9 00:26:55 UTC 2014 - jnweiger@gmail.com
4
+
5
+- dvswitch-0.9-susedevel-fae6162.tar.gz is 20140408git_jw01
6
+- no longer using local contrib scripts. Pulling them from the tar ball now.
7
+  (but updated them nevertheless, in case we want to try a vanilla upstream tar again)
8
+- fixed dvsource-title to work with ffmpeg-2.2
9
+- fixed dvswitch to properly initialize AVFrame structures.
10
+- feature: dvsink-files now prints remaining space and time.
11
+- feature: safe frame is off per default.
12
+- feature: also install demo images for dvsource-title with dvswitch-client package
13
+
14
+-------------------------------------------------------------------
15
+Mon Mar 31 21:45:47 UTC 2014 - jnweiger@gmail.com
16
+
17
+- dvswitch-0.9-susedevel-f9bc756.tar.gz is 20140331git_jw01
18
+- revert_wouter.diff 'upstreamed' kindof.
19
+- building directly in Packman/Multimedia now.
20
+
21
+-------------------------------------------------------------------
22
 Fri Nov 15 00:41:14 UTC 2013 - jw@suse.de
23
 
24
 - oops, should not have pulled upstream, wouters last commit was half done.
25
dvswitch-git.spec Changed
114
 
1
@@ -16,13 +16,15 @@
2
 #
3
 
4
 ### output file from gitfetch.sh here:
5
-%define tarname dvswitch-0.9-susedevel-8b96437
6
+# % define tarname dvswitch-0.9-susedevel-8b96437
7
+# % define tarname dvswitch-0.9-susedevel-f9bc756
8
+%define tarname dvswitch-0.9-susedevel-fae6162
9
 
10
-### this one is vanilla, it needs the patches:
11
+### this one is vanilla, it needs the patches and the extra sources:
12
 # % define tarname dvswitch-0.9-1-da15ba4.tar.gz 
13
 
14
 Name:           dvswitch-git
15
-Version:        20131114git_jw01
16
+Version:        20140408git_jw01
17
 Release:        0
18
 License:        GPL-2.0+
19
 Summary:        Video mixer for firewire devices
20
@@ -35,6 +37,7 @@
21
 Source4:   gitfetch.sh
22
 Source5:   CarlFK-dvsmon-e00779c.tar.gz
23
 Source101: etc_dvswitchrc
24
+## unused sources. They are included in the susedevel branch of github.com/jnweiger/dvswitch
25
 Source102: dvsource-webcam.pl
26
 Source103: dvtrim.pl
27
 Source104: dv2webm.sh
28
@@ -46,6 +49,8 @@
29
 Source110: dvrecord.sh
30
 Source111: dv-upload.sh
31
 Source112: dvsource-firewire2switch
32
+## end of unused sources.
33
+## unused patches. They are included in the susedevel branch of github.com/jnweiger/dvswitch
34
 Patch1:        dvsource-command.diff
35
 Patch2:        retry_connect_option.diff
36
 Patch3:        stopped_status.diff
37
@@ -57,6 +62,7 @@
38
 Patch10:   title_hup.diff
39
 Patch11:   mfade_area.diff
40
 Patch100:  revert_wouter.diff
41
+## end of unused patches.
42
 BuildRequires:  cmake pkg-config gcc-c++
43
 BuildRequires:  fdupes
44
 BuildRequires:  glibc alsa-devel gtkmm2-devel ffmpeg-devel
45
@@ -170,8 +176,8 @@
46
 # % patch10 -p1
47
 # # mfade_area.diff
48
 # % patch11 -p1
49
-# revert_wouter.diff
50
-%patch100 -p1
51
+# revert_wouter.diff needed with 8b96437, but already applied with f9bc756
52
+# % patch100 -p1
53
 
54
 grep Manual src/*.c
55
 
56
@@ -184,28 +190,30 @@
57
 make
58
 
59
 %check
60
-perl -c %{SOURCE102}
61
-perl -c %{SOURCE103}
62
-perl -c %{SOURCE105}
63
-perl -c %{SOURCE106}
64
-perl -c %{SOURCE107}
65
-perl -c %{SOURCE108}
66
-perl -c %{SOURCE109}
67
+# these are all unused. pulled below directly from the tar
68
+# perl -c % {SOURCE102}
69
+# perl -c % {SOURCE103}
70
+# perl -c % {SOURCE105}
71
+# perl -c % {SOURCE106}
72
+# perl -c % {SOURCE107}
73
+# perl -c % {SOURCE108}
74
+# perl -c % {SOURCE109}
75
 
76
 %install
77
 %makeinstall
78
 install  -m 0644 %{SOURCE101} ./etc_dvswitchrc
79
-install -Dm 0755 %{SOURCE102} %{buildroot}%{_bindir}/dvsource-webcam
80
-install -Dm 0755 %{SOURCE103} %{buildroot}%{_bindir}/dvtrim
81
-install -Dm 0755 %{SOURCE104} %{buildroot}%{_bindir}/dv2webm
82
-install -Dm 0755 %{SOURCE105} %{buildroot}%{_bindir}/dvsink-bambuser
83
-install -Dm 0755 %{SOURCE106} %{buildroot}%{_bindir}/dvsource-title
84
-install -Dm 0755 %{SOURCE107} %{buildroot}%{_bindir}/dvsink-icecast
85
-install -Dm 0755 %{SOURCE108} %{buildroot}%{_bindir}/dvsink-fullscreen
86
-install -Dm 0755 %{SOURCE109} %{buildroot}%{_bindir}/dvsource-firewire-next
87
-install -Dm 0755 %{SOURCE110} %{buildroot}%{_bindir}/dvrecord
88
-install -Dm 0755 %{SOURCE111} %{buildroot}%{_bindir}/dv-upload
89
-install -Dm 0755 %{SOURCE112} %{buildroot}%{_bindir}/dvsource-firewire2switch
90
+install -Dm 0644 contrib/*.jpg .
91
+install -Dm 0755 contrib/scripts/dvsource-webcam.pl    %{buildroot}%{_bindir}/dvsource-webcam
92
+install -Dm 0755 contrib/scripts/dvtrim.pl     %{buildroot}%{_bindir}/dvtrim
93
+install -Dm 0755 contrib/scripts/dv2webm.sh        %{buildroot}%{_bindir}/dv2webm
94
+install -Dm 0755 contrib/scripts/dvsink-bambuser.pl    %{buildroot}%{_bindir}/dvsink-bambuser
95
+install -Dm 0755 contrib/scripts/dvsource-title.pl %{buildroot}%{_bindir}/dvsource-title
96
+install -Dm 0755 contrib/scripts/dvsink-icecast.pl %{buildroot}%{_bindir}/dvsink-icecast
97
+install -Dm 0755 contrib/scripts/dvsink-fullscreen.pl  %{buildroot}%{_bindir}/dvsink-fullscreen
98
+install -Dm 0755 contrib/scripts/dvsource-firewire-next.pl %{buildroot}%{_bindir}/dvsource-firewire-next
99
+install -Dm 0755 contrib/scripts/dvrecord.sh       %{buildroot}%{_bindir}/dvrecord
100
+install -Dm 0755 contrib/scripts/dv-upload.sh      %{buildroot}%{_bindir}/dv-upload
101
+install -Dm 0755 contrib/dv2switch/dvsource-firewire2switch %{buildroot}%{_bindir}/dvsource-firewire2switch
102
 
103
 false && install -Dm 0644 %{SOURCE1} %{buildroot}%{_mandir}/man1/dvswitch.1
104
 false && %fdupes %{buildroot}%{_datadir}
105
@@ -232,7 +240,7 @@
106
 
107
 %files client
108
 %defattr(-,root,root,-)
109
-%doc COPYING doc/examples/* doc/README etc_dvswitchrc
110
+%doc COPYING doc/examples/* doc/README etc_dvswitchrc *.jpg
111
 %exclude %{_bindir}/dvswitch
112
 %exclude %{_bindir}/dvsink-fullscreen
113
 %{_bindir}/*
114
dv2webm.sh Changed
163
 
1
@@ -1,19 +1,153 @@
2
 #! /bin/sh
3
 ##
4
 ## FIXME: -deinterlace is deprecated, use -filter:v yadif instead
5
-## FIXME: make -ss a command line option.
6
-## FIXME: allow multiple input files here. 
7
+## 2013-08-17, v0.3, jw    -- added --bitrate option.
8
+## 2013-11-19, v0.4, jw    -- added --cwd option to strip the full path.
9
+## 2014-04-08, v0.5, jw -- pumped up the default bitrate according to tests by darix.
10
 
11
-infile=$1
12
-outfile=${infile%.dv}.webm
13
+
14
+version=0.5
15
 startsecs=0.0
16
-test -n "$2" && startsecs=$2
17
+bitrate="b:v 500k"
18
+duration=
19
+cwd=
20
+
21
+
22
+ARGS=`getopt -o "s:o:t:h" -l "start:,output:,duration:,help" -n "dv2webm V$version" -- "$@"`
23
+eval set -- "$ARGS"
24
+while true;
25
+do
26
+    case "$1" in
27
+   -h|--help)
28
+       usage
29
+       exit 0;;
30
+   -s|--startsecs)
31
+       startsecs="$2"
32
+       shift 2;;
33
+   -o|--output)
34
+       outfile="$2"
35
+       shift 2;;
36
+   -t|--duration)
37
+       duration="-t $2"
38
+       shift 2;;
39
+   --)
40
+       shift
41
+       break;;
42
+    esac
43
+done
44
+
45
+
46
+infile=$1
47
+shift
48
+if [[ "$outfile" == "" ]]; then
49
+  outfile=${infile%.dv}
50
+  # check if a timestamp YYYY-MM-DD is present, if not add one.
51
+  if ! [[ "$outfile" =~ 20[0-9]{2} ]]; then
52
+    outfile="$outfile-$(date +'%Y-%m-%d')"
53
+  fi
54
+  outfile="$outfile.webm"
55
+  echo "writing output to $outfile"
56
+fi
57
+
58
+usage () 
59
+{
60
+echo "      
61
+      dv2webm Version $version
62
+
63
+      Usage: $0 [OPTIONS] INFILE.dv [... INFILE.dv]
64
+      
65
+      Options:
66
+        -b,--bitrate NNNk
67
+       Encode at the specified bitrate. 
68
+       Default: ffmpeg's choice, often 400k.
69
+   -c,--cwd
70
+       Drop output files in current working directory.
71
+       Default: same path where input is.
72
+       This is exclusive to -o .
73
+        -s,--startsecs N.N
74
+        -s,--startsecs HH:MM:SS[.XXX]
75
+           Skip number of seconds from the start.
76
+                Default: '$startsecs' .
77
+        -t,--duration N.N
78
+        -t,--duration HH:MM:SS[.XXX]
79
+           Stop after N.N seconds of video were produced.
80
+       Default: stop when input ends.
81
+        -o,--output  FILE.webm
82
+           Define the output file name. Default: Derive from 
83
+       input file name (first input file name, if multiple).
84
+        -h,--help
85
+       Display this help.
86
+
87
+      INFILE.dv ...
88
+        One or multiple input files in dv format. The files will be concatenated
89
+   in the given order, then a startsecs skip will be applied if any.
90
+"
91
+}
92
+
93
+
94
+ARGS=`getopt -o "s:o:t:b:hc" -l "start:,output:,duration:,bitrate:,help,cwd" -n "dv2webm V$version" -- "$@"`
95
+eval set -- "$ARGS"
96
+while true;
97
+do
98
+    case "$1" in
99
+   -h|--help)
100
+       usage
101
+       exit 0;;
102
+   -s|--startsecs)
103
+       startsecs="$2"
104
+       shift 2;;
105
+   -c|--cwd)
106
+       cwd=1
107
+       shift 1;;
108
+   -o|--output)
109
+       outfile="$2"
110
+       shift 2;;
111
+   -t|--duration)
112
+       duration="-t $2"
113
+       shift 2;;
114
+   -b|--bitrate)
115
+       bitrate="-b:v $2"
116
+       shift 2;;
117
+   --)
118
+       shift
119
+       break;;
120
+    esac
121
+done
122
+
123
+
124
+infile=$1
125
+shift
126
+if [[ "$outfile" == "" ]]; then
127
+  if [[ "$cwd" == "" ]]; then
128
+    outfile=${infile%.dv}
129
+  else
130
+    outfile=$(basename $infile .dv)
131
+  fi
132
+  # check if a timestamp YYYY-MM-DD is present, if not add one.
133
+  if ! [[ "$outfile" =~ 20[0-9]{2} ]]; then
134
+    outfile="$outfile-$(date +'%Y-%m-%d')"
135
+  fi
136
+  outfile="$outfile.webm"
137
+  echo "writing output to $outfile"
138
+fi
139
 
140
 if [ ! -f "$infile" ]; then
141
   echo "input .dv file '$infile' not found"
142
-  echo "Usage: $0 INFILE.dv [START_POSITION_SECS]"
143
+  usage
144
   exit
145
 fi
146
-echo ffmpeg -ss $startsecs -i "$infile" -deinterlace -threads auto "$outfile"
147
+
148
+need_concat=0
149
+for i in $*; do
150
+ need_concat=1
151
+ infile="$infile|$i"
152
+done;
153
+
154
+if [[ $need_concat ]]; then
155
+  infile="concat:$infile"
156
+fi
157
+
158
+echo ffmpeg -ss $startsecs -i "$infile" -deinterlace -threads auto $duration $bitrate "$outfile"
159
 sleep 3
160
-ffmpeg -ss $startsecs -i "$infile" -deinterlace -threads auto "$outfile"
161
+ffmpeg -ss $startsecs -i "$infile" -deinterlace -threads auto $duration $bitrate "$outfile"
162
+
163
dvsink-bambuser.pl Changed
99
 
1
@@ -2,10 +2,12 @@
2
 # dvsink-bambuser.pl is a userfriendly wrapper for dvsink-command.
3
 # It creates a live stream suitable for bambuser.com
4
 #
5
-# (C) 2012, jw@suse.de, distribute under GPL-2.0+ or ask.
6
+# (C) 2013, jw@suse.de, distribute under GPL-2.0+ or ask.
7
 # 2012-09-30 -- V0.1 initial draft.
8
 # 2012-10-21 -- V0.2 broken config file support added
9
 # 2012-10-25 -- V0.3 fixed config file support
10
+# 2013-10-21 -- V0.4 Added --record option. Beware of dropouts.
11
+# 2013-10-21 -- V0.5 Added ping test and verbose hint to find bad config easier.
12
 #
13
 ## Requires: ffmpeg
14
 
15
@@ -16,7 +18,7 @@
16
 use Getopt::Long qw(:config no_ignore_case);
17
 use Pod::Usage;
18
 
19
-my $version = '0.3';
20
+my $version = '0.5';
21
 my $a_chan = undef;
22
 my $a_name = undef;
23
 my $retry_connect = 0;
24
@@ -32,10 +34,12 @@
25
 my $channel_url     = 'http://bambuser.com/channel/opensusetv';
26
 my $channel_admin   = 'Juergen Weigert <jw@suse.de> #opensuse-video@irc.freenode.org';
27
 my $config_file = undef;
28
+my $recording = undef;
29
 
30
 GetOptions(
31
    "retry|R"   => \$retry_connect,
32
    "verbose|v" => \$verbose,
33
+   "record|r=s"    => \$recording,
34
    "port|p=s"  => \$port,
35
    "host|h=s"  => \$host,
36
    "config|c=s"    => sub { $ENV{ICECAST_CONF_FILE} = $_[1]; },
37
@@ -73,6 +77,13 @@
38
    Specify the network address on which DVswitch is listening.  The
39
    host address may be specified by name or as an IPv4 or IPv6 literal.
40
 
41
+ -r, --recording=FILE_FORMAT
42
+        Stop sending to bambuser, when record button is not pressed; and
43
+        use dvsink_tee instead of dvsink_command to also record what is 
44
+   beeing sent.  If the FILE_FORMAT does not contain '%' characters,
45
+   '_%F_%H%M%S' is appended.  A '_%04d.dv' suffix is also added.
46
+   Default: always send, never record to file.
47
+
48
  --320 --480 --640 --720
49
    Select a specific output size and bandwidth. 
50
    Default: '$ffmpeg_opt'
51
@@ -93,24 +104,44 @@
52
 
53
 The channel at $channel_url 
54
 is run by $channel_admin
55
-
56
 }) if $help;
57
    
58
 $ffmpeg_opt = getconfig('ffmpeg_opt') || $ffmpeg_opt_def;
59
 my $url = shift || getconfig('bambuser_rtmp_url') || die "please provide a URL like $ffmpeg_rtmp\n";
60
 $ffmpeg_rtmp = $url;
61
 
62
+my $hostname = $1 if $url =~ m{//([^:/]+)};
63
+if ($hostname)
64
+  {
65
+    # try pinging first, makes debugging easier.
66
+    print "+ ping -n 1 -w 3 $hostname\n";
67
+    system("ping -n 1 -w 3 $hostname");
68
+  } 
69
+
70
 my $ff_verbose = ($verbose > 1) ? 'verbose' : 'quiet';
71
 
72
 my $ffmpeg = sprintf $ffmpeg_fmt, $ff_verbose, $ffmpeg_opt, $ffmpeg_rtmp;
73
 
74
 my $cmd = 'dvsink-command';
75
+$cmd = 'dvsink-tee' if $recording;
76
 $cmd .= ' --retry' if $retry_connect;
77
 $cmd .= " --port=$port" if defined $port;
78
 $cmd .= " --host=$host" if defined $host;
79
 
80
-print "+ $cmd -- $ffmpeg\n" if $verbose;
81
-system "$cmd -- $ffmpeg" and die "failed to run '$cmd'\n";
82
+if ($recording)
83
+  {
84
+    unless ($recording =~ m{%})
85
+      {
86
+        $recording .= '_%F_%H%M%S';
87
+      }
88
+    print "+ $cmd -c '$ffmpeg' $recording\n" if $verbose;
89
+    system "$cmd -c '$ffmpeg' $recording" and die "failed to run '$cmd'\n";
90
+  }
91
+else
92
+  {
93
+    print "+ $cmd -- $ffmpeg\n" if $verbose;
94
+    system "$cmd -- $ffmpeg" and die "failed to run '$cmd'\n";
95
+  }
96
 exit 0;
97
 
98
 sub getconfig
99
dvsource-title.pl Changed
32
 
1
@@ -10,6 +10,7 @@
2
 # (C) 2012, jw@suse.de, distribute under GPL-2.0+ or ask.
3
 # 2012-10-10 -- V0.1 initial draft.
4
 # 2012-10-16 -- V0.2 added support for directories
5
+# 2014-04-07 -- V0.3 /dev/zero no longer works. Need to place a real file.
6
 #############
7
 
8
 ## Requires: perl, ffmpeg
9
@@ -23,7 +24,7 @@
10
 use Pod::Usage;
11
 use POSIX ":sys_wait_h";
12
 
13
-my $version = '0.2';
14
+my $version = '0.3';
15
 my $retry_connect = 0;
16
 my $host = undef;
17
 my $port = undef;
18
@@ -100,8 +101,12 @@
19
 my $last_touch = $stat->mtime;
20
 my $last_size = $stat->size;
21
 
22
+my $silence_blocks = int(1 + 2 * 8 * $loop_sec);
23
+my $silence_wav = "_title_silence_${silence_blocks}k.wav";
24
+system "dd if=/dev/zero of=$silence_wav bs=1024 count=$silence_blocks";
25
+
26
 my $ff_ver = $verbose ? 'info' : 'error';
27
-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'";
28
+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'";
29
 
30
 my @cmd = ( $ENV{DVSOURCE_FILE} || 'dvsource-file' );
31
 
32
dvswitch-0.9-susedevel-26c32ce.tar.gz Deleted
dvswitch-0.9-susedevel-8b96437.tar.gz Deleted
dvswitch-0.9-susedevel-fae6162.tar.gz Added
Refresh
Refresh
Request History
Jürgen Weigert's avatar

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.


Stefan Seyfried's avatar

seife accepted request almost 11 years ago

let's assume you know what you are doing :-P