{"id":1902,"date":"2024-12-16T20:07:57","date_gmt":"2024-12-16T11:07:57","guid":{"rendered":"https:\/\/rfsec.ddns.net\/db\/?p=1902"},"modified":"2025-01-21T20:56:43","modified_gmt":"2025-01-21T11:56:43","slug":"%e6%b5%81%e6%98%9f%e7%be%a4%e3%81%ae%e7%94%bb%e5%83%8f%e5%87%a6%e7%90%86","status":"publish","type":"post","link":"https:\/\/rfsec.ddns.net\/db\/?p=1902","title":{"rendered":"\u6d41\u661f\u7fa4\u306e\u753b\u50cf\u51e6\u7406"},"content":{"rendered":"\n<p>\u6bd4\u8f03\u660e\u5408\u6210\u753b\u50cf\u306e\u4f5c\u6210<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>comp.sh\n---------------------------------------------\n#!\/bin\/bash\nF=$1\n# \u73fe\u5728\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306eJPEG\u30d5\u30a1\u30a4\u30eb\u3092\u53d6\u5f97\nimages=($F*.jpg)\n# \u51fa\u529b\u30d5\u30a1\u30a4\u30eb\u540d\noutput=&quot;$F.jpg&quot;\n\n# \u5165\u529b\u30d5\u30a1\u30a4\u30eb\u304c1\u3064\u3082\u306a\u3044\u5834\u5408\u306f\u30a8\u30e9\u30fc\u7d42\u4e86\nif [ ${#images[@]} -lt 2 ]; then\n    echo &quot;\u30a8\u30e9\u30fc: \u6bd4\u8f03\u660e\u5408\u6210\u306b\u306f2\u679a\u4ee5\u4e0a\u306e\u753b\u50cf\u304c\u5fc5\u8981\u3067\u3059\u3002&quot;\n    exit 1\nfi\n\n# FFmpeg\u30b3\u30de\u30f3\u30c9\u7528\u306e\u5165\u529b\u3068\u30d5\u30a3\u30eb\u30bf\u30c1\u30a7\u30fc\u30f3\u3092\u69cb\u7bc9\ninputs=&quot;&quot;\nfilter_complex=&quot;&quot;\nfor i in &quot;${!images[@]}&quot;; do\n    inputs=&quot;$inputs -i ${images[i]}&quot;\n    if [ $i -eq 0 ]; then\n        filter_complex=&quot;[0:v]&quot;\n    else\n        filter_complex=&quot;${filter_complex}[${i}:v]blend=all_mode=lighten&quot;\n        if [ $i -ne $((${#images[@]} - 1)) ]; then\n            filter_complex=&quot;${filter_complex}[tmp$i];[tmp$i]&quot;\n        fi\n    fi\ndone\n\n# \u6700\u7d42\u7684\u306a\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\nffmpeg $inputs -filter_complex &quot;${filter_complex}&quot; -y &quot;$output&quot;\n\necho &quot;\u6bd4\u8f03\u660e\u5408\u6210\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f: $output&quot;<\/code><\/pre><\/div>\n\n\n\n<p>\u8907\u6570\u306emp4\u52d5\u753b\u3092\u7d50\u5408\u3059\u308b\u305f\u3081\u306e\u30ea\u30b9\u3092\u751f\u6210<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>mcomp.sh\n----------------------------------------\n#!\/bin\/bash\nF=$1\n# \u73fe\u5728\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u5185\u306eJPEG\u30d5\u30a1\u30a4\u30eb\u3092\u53d6\u5f97\nimages=($F*.jpg)\n# \u51fa\u529b\u30d5\u30a1\u30a4\u30eb\u540d\noutput=&quot;$F.jpg&quot;\n\n# \u5165\u529b\u30d5\u30a1\u30a4\u30eb\u304c1\u3064\u3082\u306a\u3044\u5834\u5408\u306f\u30a8\u30e9\u30fc\u7d42\u4e86\nif [ ${#images[@]} -lt 2 ]; then\n    echo &quot;\u30a8\u30e9\u30fc: \u6bd4\u8f03\u660e\u5408\u6210\u306b\u306f2\u679a\u4ee5\u4e0a\u306e\u753b\u50cf\u304c\u5fc5\u8981\u3067\u3059\u3002&quot;\n    exit 1\nfi\n\n# FFmpeg\u30b3\u30de\u30f3\u30c9\u7528\u306e\u5165\u529b\u3068\u30d5\u30a3\u30eb\u30bf\u30c1\u30a7\u30fc\u30f3\u3092\u69cb\u7bc9\ninputs=&quot;&quot;\nfilter_complex=&quot;&quot;\nfor i in &quot;${!images[@]}&quot;; do\n    inputs=&quot;$inputs -i ${images[i]}&quot;\n    tmp=`echo ${images[i]} | sed s\/jpg\/mp4\/`\n    echo &quot;file $tmp -vframes 10 -c:v copy &quot;<\/code><\/pre><\/div>\n\n\n\n<p>\u30ea\u30b9\u30c8\u306e\u4e00\u4f8b(mcomp.sh\u306e\u51fa\u529b)<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>file ATOM-A_006_059_20241214_044836.mp4 -vframes 10 -c:v copy\nfile ATOM-A_004_049_20241214_050034.mp4 -vframes 10 -c:v copy\nfile ATOM-A_024_078_20241214_185304.mp4 -vframes 10 -c:v copy\nfile ATOM-A_010_045_20241214_202037.mp4 -vframes 10 -c:v copy\nfile ATOM-A_006_052_20241214_223628.mp4 -vframes 10 -c:v copy\nfile ATOM-A_011_057_20241214_223659.mp4 -vframes 10 -c:v copy\nfile ATOM-A_007_061_20241214_224544.mp4 -vframes 10 -c:v copy\nfile ATOM-A_005_043_20241214_224728.mp4 -vframes 10 -c:v copy\n.....................<\/code><\/pre><\/div>\n\n\n\n<p>mp4\u52d5\u753b\u306e\u7d50\u5408<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-plain\"><code>video.sh  $1\u306b\u306f\u3001ATOM-A | ATOM-B\n---------------------------------\n#!\/bin\/bash\n\nTGT=$1\nOUT=$1.mp4\npath=\/var\/www\/html\/meteor\n$path\/mcomp.sh $TGT | sed &#39;1d&#39; - &gt;$1.txt\nffmpeg -f concat -safe 0 -i $1.txt -c copy $OUT<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u6bd4\u8f03\u660e\u5408\u6210\u753b\u50cf\u306e\u4f5c\u6210 \u8907\u6570\u306emp4\u52d5\u753b\u3092\u7d50\u5408\u3059\u308b\u305f\u3081\u306e\u30ea\u30b9\u3092\u751f\u6210 \u30ea\u30b9\u30c8\u306e\u4e00\u4f8b(mcomp.sh\u306e\u51fa\u529b) mp4\u52d5\u753b\u306e\u7d50\u5408<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[20],"tags":[],"class_list":["post-1902","post","type-post","status-publish","format-standard","hentry","category-20"],"featured_image_src":null,"author_info":{"display_name":"mars","author_link":"https:\/\/rfsec.ddns.net\/db\/?author=1"},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/posts\/1902","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1902"}],"version-history":[{"count":1,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/posts\/1902\/revisions"}],"predecessor-version":[{"id":1903,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=\/wp\/v2\/posts\/1902\/revisions\/1903"}],"wp:attachment":[{"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1902"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1902"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rfsec.ddns.net\/db\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}