Compare commits

...

5 commits

Author SHA1 Message Date
DataHoarder 76b26189af a 2023-08-03 01:52:18 +02:00
DataHoarder 12ebd54c61 wip: clip 2023-08-03 01:52:18 +02:00
DataHoarder 56cf40c28a wip: clip 2023-08-03 01:52:18 +02:00
DataHoarder 22c2fca7be WiP: gradients and others 2023-08-03 01:52:18 +02:00
DataHoarder fd89b9b5f6 Add samples via LFS 2023-08-03 01:52:17 +02:00
201 changed files with 1275 additions and 147 deletions

1
.gitattributes vendored Normal file
View file

@ -0,0 +1 @@
samples/* filter=lfs diff=lfs merge=lfs -text

55
audio.php Normal file
View file

@ -0,0 +1,55 @@
<?php
use swf2ass\ass\ASSEventTime;
require_once __DIR__ . "/vendor/autoload.php";
$width = 512;
$height = 512;
$ar = $width / $height;
$frameRate = 30;
$frameDurationMs = (1 / $frameRate) * 1000;
echo <<<ASSHEADER
[Script Info]
; Script generated by swf2ass
; https://git.gammaspectra.live/WeebDataHoarder/swf2ass
ScriptType: v4.00+
WrapStyle: 0
ScaledBorderAndShadow: yes
YCbCr Matrix: PC.709
PlayResX: {$width}
PlayResY: {$height}
[Aegisub Project Garbage]
Last Style Storage: f
Video File: ?dummy:{$frameRate}:10000:{$width}:{$height}:160:160:160:c
Video AR Value: {$ar}
[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: f,Arial,20,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,0,0,7,0,0,0,1
[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
ASSHEADER;
$frameDuration = 1;
for($frame = 0; $frame < 6523; $frame += $frameDuration){
$line = new \swf2ass\ass\ASSLine();
$line->layer = [$frame];
$line->objectId = 0;
$line->start = $frame;
$line->end = $frame + $frameDuration - 1;
$line->name = "{$line->start}->{$line->end}";
$line->style = "f";
$assEventTime = new ASSEventTime($line->start, $line->end - $line->start + 1, $frameDurationMs);
$l = trim(file_get_contents("/tmp/tmp6_pqjbve/" . str_pad("$frame.ass", 10, "0", STR_PAD_LEFT)));
$l = str_replace("pos(0,0)", "pos(0,416)", $l);
$l = $line->encode($frameDurationMs) . "{\\blur0.5}" . $l;
echo $l . "\n";
}

12
composer.lock generated
View file

@ -51,16 +51,16 @@
},
{
"name": "markrogoyski/math-php",
"version": "v2.5.0",
"version": "v2.6.0",
"source": {
"type": "git",
"url": "https://github.com/markrogoyski/math-php.git",
"reference": "ca71ca97dc136e7bb9e9e1fe05782f343a5692d4"
"reference": "85d7d7fe205a6df2b20f956720e25341f3b1462a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/markrogoyski/math-php/zipball/ca71ca97dc136e7bb9e9e1fe05782f343a5692d4",
"reference": "ca71ca97dc136e7bb9e9e1fe05782f343a5692d4",
"url": "https://api.github.com/repos/markrogoyski/math-php/zipball/85d7d7fe205a6df2b20f956720e25341f3b1462a",
"reference": "85d7d7fe205a6df2b20f956720e25341f3b1462a",
"shasum": ""
},
"require": {
@ -120,9 +120,9 @@
],
"support": {
"issues": "https://github.com/markrogoyski/math-php/issues",
"source": "https://github.com/markrogoyski/math-php/tree/v2.5.0"
"source": "https://github.com/markrogoyski/math-php/tree/v2.6.0"
},
"time": "2021-11-22T05:14:07+00:00"
"time": "2022-04-10T05:15:37+00:00"
}
],
"packages-dev": [],

14
conv.sh Executable file
View file

@ -0,0 +1,14 @@
#!/bin/bash
basename=$(basename "$1")
php swf2ass.php "$1" "out.ass"
#rm -rf samples/out
#./samples/ffdec/ffdec.sh -export sound samples/out "$1"
#ffmpeg -y -f lavfi -i "color=size=$(grep PlayResX out.ass | head -n 1 | awk '{ print $2 }')x$(grep PlayResY out.ass | head -n 1 | awk '{ print $2 }'):rate=$(grep '?dummy' out.ass | head -n 1 | awk -F: '{ print $3 }'):color=black" -i "$(find samples/out/ -type f -printf '%s %p\n' | sort -n -r | head -n 1 | awk '{print $2}')" -map 0:v -map 1:a -c:v libx264 -crf 0 -tune stillimage -preset placebo -profile:v high -x264-params keyint=240 -c:a copy -shortest out.mkv
ffmpeg -y -f lavfi -i "color=size=$(grep PlayResX out.ass | head -n 1 | awk '{ print $2 }')x$(grep PlayResY out.ass | head -n 1 | awk '{ print $2 }'):rate=$(grep '?dummy' out.ass | head -n 1 | awk -F: '{ print $3 }'):color=black" -i "out.ass.mp3" -map 0:v -map 1:a -c:v libx264 -crf 0 -tune stillimage -preset placebo -x264-params keyint=240 -c:a copy -shortest out.mkv
mkvmerge --title "$basename" -o out.swf2ass.mkv out.mkv --language 0:zxx --track-name 0:"bogus video" --forced-track 0:1 --default-track 0:1 --compression 0:zlib --language 0:zxx --track-name 0:"Vector from $basename" out.ass

View file

@ -9,6 +9,7 @@ namespace MartinezRueda;
*/
class Contour
{
/** @var Point[] */
public $points = [];
protected $holes = [];

View file

@ -7,6 +7,7 @@ namespace MartinezRueda;
*/
class Polygon
{
/** @var Contour[] */
public $contours = [];
/**

View file

@ -15,21 +15,21 @@ function outputFrame($frame, $endFrame, $frameDurationMs) {
$shape = $path->commands;
$line->tags = [
new \swf2ass\ass\borderTag(0),
new \swf2ass\ass\borderTag(new \swf2ass\Vector2(0, 0)),
new \swf2ass\ass\shadowTag(0),
\swf2ass\ass\fillColorTag::fromStyleRecord($path->style)
];
if($shape->getRecords()[0] instanceof \swf2ass\MoveRecord){
/*if($shape->getRecords()[0] instanceof \swf2ass\MoveRecord){
$shape = (new \swf2ass\MatrixTransform(null, null, $shape->getRecords()[0]->to->multiply(-1)))->applyToShape($shape);
}
$line->tags[] = new \swf2ass\ass\positionTag($shape->getRecords()[0]->getStart()->divide(-\swf2ass\Constants::TWIP_SIZE), $shape->getRecords()[0]->getStart()->divide(-\swf2ass\Constants::TWIP_SIZE), $endFrame, $endFrame);
}*/
$line->tags[] = new \swf2ass\ass\positionTag(new \swf2ass\Vector2(0, 0), new \swf2ass\Vector2(0, 0), 1, 1);
$line->tags[] = new \swf2ass\ass\drawTag($shape, 1);
echo $line->encode($frameDurationMs) . PHP_EOL;
}
}
$fps = 30000 / 1001;//30;
$colorN = 64;
$fps = 30;//30000 / 1001;//30;
$colorN = 2;
$pframeColorDistance = 16;
if (is_dir($argv[1])) {
@ -43,7 +43,7 @@ sort($frames);
$frameBuffer = null;
$quantizedFrameBuffer = $frameBuffer;
$dynamicPalette = true;
$dynamicPalette = false;
$palette = [];
for ($i = 0; $i < $colorN; ++$i) {
$palette[] = new \swf2ass\Color((int)round($i * (255 / ($colorN - 1))), (int)round($i * (255 / ($colorN - 1))), (int)round($i * (255 / ($colorN - 1))));
@ -51,7 +51,7 @@ for ($i = 0; $i < $colorN; ++$i) {
$frameNumber = 1;
$endFrame = 100;
$endFrame = 6522;
$lastFrameNumber = null;
$currentFrames = [];

BIN
samples/18_haha_to_old.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/2chdaiou.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/404925_shitgoindown.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/Bad Apple.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/Bugs Bunny.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/Caramelldansen_vectorised.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/HandumZZ.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/IOSYS - Neko Miko Reimu.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/IOSYS_foe.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/IOSYS_itteyoshi2005.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/IOSYS_toho5_TabooTearsYouUp.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/IOSYS_toho7_HakureiJinja.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/IOSYS_toho_cirno_onsen_PV.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/KimNikuMan.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/KoreaZZ.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/Lucky_Rozen.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/Marceline's help.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/Miku Hatsune Lucid Dream Paradise.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/Milk And Cookies.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/Prominence_short_web.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/Soramimi_Cake_Finished.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/Stealing Time (vector).swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/Thwomps_ The Movie.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/UrinaraFantasy.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/VectorLeek.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/Z_Handum.swf (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
samples/billmurray.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/cg_138.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/cirno's_arithmetic_school.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/cirno's_arithmetic_school_2011.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_0x40_hues.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_4chan4evar.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_4chan_shippuuden.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_56k.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_Anime_Theater.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_Blazing_Heart.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_Feenaloituma.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_Flandre_Chase.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_Fragrance_of_Oriental_Sunflower.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_IOSYS_Border_of_Death.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_IOSYS_CirnoENG.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_IOSYS_foe_translated.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_IOSYS_toho11_KyuukyokuYakinikuRestaurant.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_IOSYS_toho12_Doll_Play.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_IOSYS_toho5_FutatsuNoTsubasa.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_IOSYS_toho5_TabooTearsYouUp.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_IOSYS_toho5_Usatei.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_IOSYS_toho7_EirinShinryoujo.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_IOSYS_toho7_HakureiJinja.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_IOSYS_toho_cirno_onsen_PV.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_Id_hit_it_noo.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_LOLTANloituma.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_Lucky_Rozen.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_Marisa.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_Marisa_stole_the_precious_thing.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_Mikami_and_L_are_not_happy.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_Miracle_Hina_Extended.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_Rei_box.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_Roses_Are_Red.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_Shoo_Fly.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_Sparta.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_Stealing_Time.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_Super_Mario_Hyadain.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_The_Story_of_Khale_2.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_Touhou_Chirumiru_ENG.swf (Stored with Git LFS) Normal file

Binary file not shown.

BIN
samples/dagobah_Touhou_LS_crossover_kae_duka_low.swf (Stored with Git LFS) Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show more