{"id":13694829,"url":"https://github.com/li24361/sorryJava","last_synced_at":"2025-05-03T04:31:02.251Z","repository":{"id":49390630,"uuid":"124711416","full_name":"li24361/sorryJava","owner":"li24361","description":"给动图加字幕的sorry项目的java版本 ","archived":false,"fork":false,"pushed_at":"2024-08-26T16:15:24.000Z","size":3760,"stargazers_count":310,"open_issues_count":4,"forks_count":97,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-12T21:39:21.538Z","etag":null,"topics":["centos7","ffmepg","java"],"latest_commit_sha":null,"homepage":"https://txtxtx.com.cn","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/li24361.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-03-11T00:56:51.000Z","updated_at":"2024-08-29T15:11:54.000Z","dependencies_parsed_at":"2024-01-14T19:12:17.606Z","dependency_job_id":"c56bef31-3901-4fd9-9d9f-5df57e620d4b","html_url":"https://github.com/li24361/sorryJava","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/li24361%2FsorryJava","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/li24361%2FsorryJava/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/li24361%2FsorryJava/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/li24361%2FsorryJava/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/li24361","download_url":"https://codeload.github.com/li24361/sorryJava/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252144539,"owners_count":21701427,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["centos7","ffmepg","java"],"created_at":"2024-08-02T17:01:44.288Z","updated_at":"2025-05-03T04:30:59.899Z","avatar_url":"https://github.com/li24361.png","language":"Java","readme":"思路是参考[sorry](https://github.com/xtyxtyx/sorry)，原作是ruby写的，我就撸了个java 轮子，加了一点新功能，可以生成小一点的图片\n\n优化点：\n* 重构首页，方便移动端和PC端访问\n* 首页素材全部CDN，加快加载速度\n* 增加精简模式，可以生成几百k的用来做表情\n* 将文件剥离出程序，可以动态切换\n\n\n[Demo点击查看](http://txtxtx.com.cn)\n\n# sorryJava\nsorry的java版本 操作演示\n\n![](https://github.com/li24361/sorryJava/blob/master/sorry-min.gif)\n\n\n# 安装步骤\n\n### docker (推荐)\n首先安装 docker,不会的安装请自行百度\n\n\nclone代码\n\t\n\tgit clone https://github.com/li24361/sorryJava.git\n\t\n后,进入到sorry-java目录下执行\n\n    docker build -t sorry-java:v1.4 .\n    docker run --rm -itd --name sorryjava -e QCLOUD_ENABLE=false  -p 8888:8888 sorry-java:v1.4\n\n 访问 http://localhost;8888   \n\n### centos \n\n如果没有自己的服务器，可以去[腾讯云](https://cloud.tencent.com/redirect.php?redirect=1005\u0026cps_key=886212e8dd391ab808f37dd99caa8afb)\n里面个人可以免费申请7天的服务器，如果你是学生，会有更大的惊喜。现在[双十一搞活动](https://cloud.tencent.com/act/double11/reserve?fromSource=gwzcw.3000744.3000744.3000744\u0026utm_medium=cpc\u0026utm_id=gwzcw.3000744.3000744.3000744\u0026from=console\u0026cps_key=886212e8dd391ab808f37dd99caa8afb\u0026spread_hash_key=RfuqSZ)，88一年，很划算。\n选用云服务器后，安装的时候选择7，然后按照下面步骤配好centos环境。\n\n基础环境需要[安装java](https://github.com/li24361/centos_install_common_software_toturial/blob/master/Java.md)\n\ncentOS7下ffmpeg安装\n\n\tyum install epel-release -y\n\trpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro\n\trpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm\n    yum install ffmpeg ffmpeg-devel -y\n\n\ncentOS7安装字体,生成中文字幕需要，否则生成时候会报错\n\n\tyum groupinstall \"fonts\"\n\n在服务器上建立文件夹/opt/site/cache/sorry\n下载[template.mp4](http://cdn.txtxtx.com.cn/template.mp4)跟[template.ftl](http://cdn.txtxtx.com.cn/template.ftl)放进去\n\n\u003cb\u003e以上都是必须的\u003c/b\u003e\n\n\n可以直接下载[sorry-java-1.2.0.jar](http://cdn.txtxtx.com.cn/sorry-java-1.2.0.jar)\n然后服务器上运行\n\tnohup java -jar sorry-java-1.2.0.jar \u0026\n\n访问 http://ip:8888\n\n\n\n### windows\nwindows下执行压制的时候，如果ass的路径是带有盘符的，会报错，可以改成读取相对路径\n自己研究代码的时候，windows下面需要安装jdk\u0026maven\u0026git\u0026ffmpeg\n\n记得将ffmpeg 配置到Path下 添加E:\\ffmpeg\\bin; 这里要换成你的路径\n\n\n修改application.properties,换成自己电脑的文件夹，例如D:/\n\n\tcache.template.tempPath=/opt/site/cache/\n\n在自己的文件夹下建立sorry文件夹\n下载[template.mp4](http://cdn.txtxtx.com.cn/template.mp4)跟[template.ftl](http://cdn.txtxtx.com.cn/template.ftl)放进去\n\n拉取源码\n\n\tgit clone https://github.com/li24361/sorryJava.git\n\t\n导入ide\n\t\n打包并运行\n\t\n\tmvn package -DskipTests\n\tjava -jar sorry-java-1.2.0.jar\n\t\n访问 http://ip:8888\n\t\n### macos\n通过brew安装ffmpeg\n  \n\tbrew install ffmpeg\n\n在mac系统终端命令行里直接执行ffmpeg没有问题，但用java调用就生成gif报错。\n原因是ffmpeg在linux的shell命令行下当然能执行（如果ffmpeg在/usr/bin下），但java调用的时候并不是shell模式，所以不能直接执行\n\n解决办法：\n请用完整的ffmpeg路径，另外需要使用shell命令执行。代码示例如下：\n\n\tProcess exec = Runtime.getRuntime().exec(new String[]{\"sh\", \"-c\", cmd}); exec.waitFor();\n以上cmd变量第一个字符（参数）必须是ffmpeg的系统安装路径，\n\n获得此路径：\n\twhich ffmpeg\n\n\n\n有问题欢迎提issue\n\n\n\n","funding_links":[],"categories":["Java"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fli24361%2FsorryJava","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fli24361%2FsorryJava","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fli24361%2FsorryJava/lists"}