k8yvis (napisa): |
Nemam cd, tj. imam al nije profesional... Mislila da se da skinut odnekud... Samo equations ne cijeli office |
k8yvis (napisa): |
Ok, budem si našla nekaj... Još uvijek mi stoji opcija za trial, kad ćemo već legalno... Fala Alene!!! |
rafaelm (napisa): |
Može preporuka za besplatnifirewall i/ili antivirus za WinXP ? |
Kod: |
{broj}{broj2}Neki_text |
program.cpp | |||
Description: |
|
Download |
|
Filename: | program.cpp | ||
Filesize: | 1.06 KB | ||
Downloaded: | 210 Time(s) |
Kod: |
#!/usr/bin/env perl
use strict; my $debug = 0; my $fname = 0; if (@ARGV) { $fname = shift @ARGV; } else { print STDERR "File: "; chomp($fname = <STDIN>); } my $lineNum = 0; unless (-e $fname) { if ($fname eq "?") { print STDERR "Syntax:\n"; print STDERR " move_srt - program will ask you for the filename and two time points\n"; print STDERR " move_srt filename - program will ask you for two time points\n"; print STDERR " move_srt filename s [sf] - move by s seconds and extend by sf factor (default: sf=1)\n"; print STDERR " move_srt filename sub1 mov1 sub2 mov2 - use two time points (subn/movn = time in subtitle/movie)\n"; print STDERR "Output: STDOUT\n"; exit(1); } print STDERR "Error: File '$fname' doesn't exist!\n\a"; exit(1); } sub timeToMs { my $time = shift; chomp($time); unless ($time =~ /^((\d{1,2}):)?(\d{1,2}):(\d{1,2})(,(\d{1,3}))?$/) { print STDERR "Error: Invalid format in line $lineNum!\n"; exit(1); } return 1000 * (60 * (60 * $2 + $3) + $4) + $6; } my ($secs, $stretch); if (@ARGV == 1 || @ARGV == 2) { $secs = shift @ARGV; $stretch = (@ARGV ? shift @ARGV : 1); } elsif (@ARGV == 4 || @ARGV == 0) { my ($sub1, $mov1, $sub2, $mov2); if (@ARGV == 0) { print STDERR "Point 1:\n"; print STDERR " Subtitle time: "; $sub1 = <STDIN>; $sub1 = timeToMs($sub1); print STDERR " Movie time: "; $mov1 = <STDIN>; $mov1 = timeToMs($mov1); print STDERR "Point 2:\n"; print STDERR " Subtitle time: "; $sub2 = <STDIN>; $sub2 = timeToMs($sub2); print STDERR " Movie time: "; $mov2 = <STDIN>; $mov2 = timeToMs($mov2); } else { ($sub1, $mov1, $sub2, $mov2) = map{ timeToMs($_) } @ARGV; } $secs = ($mov2 * $sub1 - $mov1 * $sub2) / (1000 * ($sub1 - $sub2)); $stretch = ($mov1 - $mov2) / ($sub1 - $sub2); } else { print STDERR "Error: Invalid number of arguments!\n"; exit(1); } sub fixTime { my $time = 60 * (60 * $_[0] + $_[1]) + $_[2]; $time = $time * $stretch + $secs; ($_[0], $_[1], $_[2]) = ($time / 3600, ($time / 60) % 60, $time % 60); } print STDERR "\nInput file: $fname\n"; open(IN, $fname); $fname =~ s/\.([^.]+)$/.moved.$1/i; print STDERR "Output file: $fname\n"; print STDERR "Delay: $secs secs\n"; print STDERR "Stretch factor: $stretch\n"; while (<IN>) { ++$lineNum; if (my @times = /^(\d{2}):(\d{2}):(\d{2}),(\d{3})\s-->\s(\d{2}):(\d{2}):(\d{2}),(\d{3})/) { chomp; print STDERR sprintf "%.2d:%.2d:%.2d,%.3d --> %.2d:%.2d:%.2d,%.3d", @times if $debug; fixTime(@times[0..3]); fixTime(@times[4..7]); printf "%.2d:%.2d:%.2d,%.3d --> %.2d:%.2d:%.2d,%.3d\n", @times; print STDERR sprintf " ====> %.2d:%.2d:%.2d,%.3d --> %.2d:%.2d:%.2d,%.3d\n", @times if $debug; } else { print; } } close(IN); print STDERR "\nDone!\n"; |
Kod: |
#!/usr/bin/env perl
use strict; my $debug = 0; my $fname = 0; if (@ARGV) { $fname = shift @ARGV; } else { print STDERR "File: "; chomp($fname = <STDIN>); } unless (-e $fname) { if ($fname eq "?") { print STDERR "Syntax:\n"; print STDERR " move_sub filename f [sf] - move by f frames and extend by sf factor (default: sf=1)\n"; print STDERR "Output: STDOUT\n"; exit(1); } print STDERR "Error: File '$fname' doesn't exist!\n\a"; exit(1); } my ($frames, $stretch); if (@ARGV == 1 || @ARGV == 2) { $frames = shift @ARGV; $stretch = (@ARGV ? shift @ARGV : 1); } else { print STDERR "Error: Invalid number of arguments!\n"; exit(1); } print STDERR "\nInput file: $fname\n"; open(IN, $fname); $fname =~ s/\.([^.]+)$/.moved.$1/i; print STDERR "Output file: $fname\n"; print STDERR "Delay: $frames frames\n"; print STDERR "Stretch factor: $stretch\n"; my (@f, @orig); while (<IN>) { chomp; if (@orig = @f = /^\{(\d+)\}\{(\d+)\}(.*)/) { print STDERR sprintf "%d --> %d", @f[0,1] if $debug; @f[0,1] = map { sprintf("%.f", $frames + $stretch * $_); } @f[0,1]; printf "{%d}{%d}%s\n", @f; print STDERR sprintf " ====> %d --> %d\n", @f[0,1] if $debug; } else { print "$_\n"; } } close(IN); print STDERR "Delta: ", @f[1] - @orig[1], "\n"; print STDERR "Done!\n\n"; |
goranm (napisa): |
(ako zanemarimo da se ne mogu sejvati nanovo sinkronizirani titlovi) |
bnikola (napisa): |
Glary utilities. Mislim da ga nitko jos nije spomenuo. Lagan programcic za optimizaciju win i brisanje nepotrebnih gluposti... |
vsego (napisa): |
Obrise ti Windowse? |
output generated using printer-friendly topic mod. Vremenska zona: GMT + 01:00.