Skip to content

Instantly share code, notes, and snippets.

@nico-lab
nico-lab / ffmpeg_cut_and_concat.bat
Last active March 16, 2018 21:10
comskip_vdr_to_ffmpeg_cut_and_concat
@echo off
set VIDEO="video.ts"
set MEDIAINFO="MediaInfo.exe"
set FFMPEG="ffmpeg.exe"
%FFMPEG% -analyzeduration 100M -probesize 100M -i %VIDEO% -acodec copy -vn %VIDEO%.aac
set time1=%1
set sec0=%time1:~-5,-3%
@echo off
set VIDEO="video.ts"
set MEDIAINFO="MediaInfo.exe"
set FFMPEG="ffmpeg.exe"
%FFMPEG% -analyzeduration 100M -probesize 100M -i %VIDEO% -acodec copy -vn %VIDEO%.aac
set time1=%1
set sec0=%time1:~-5,-3%
@nico-lab
nico-lab / png_min.bat
Created February 18, 2015 13:08
ffmpeg で PNG 最適
echo off
set FFMPEG="H:\ffmpeg.exe"
for %%a in (%*) do %FFMPEG% -i %%a -filter_complex palettegen -y %%a_tmp.png && %FFMPEG% -i %%a -i %%a_tmp.png -filter_complex paletteuse -y %%a_min.png && del %%a_tmp.png
@nico-lab
nico-lab / pipe_gif_anime.bat
Last active October 11, 2015 13:21
ffmpeg でフレーム数を指定してアニメGIFを作る
echo off
set FFMPEG="H:\ffmpeg.exe"
set GIFSICLE="H:\gifsicle.exe"
%FFMPEG% -i %1 -filter_complex scale=320:-1,trim=start_frame=%2:end_frame=%3,palettegen -y %1_tmp.png
%FFMPEG% -i %1 -i %1_tmp.png -filter_complex scale=320:-1,unsharp=3:3:0.5,trim=start_frame=%2:end_frame=%3,paletteuse -f gif - | %GIFSICLE% -V -U -O3 - -o %1_opt.gif
del %1_tmp.png
pause
@nico-lab
nico-lab / nicolive_alerts.php
Last active August 29, 2015 14:20
ニコ生アラートコメントサーバ接続する
<?php
// みゆっき氏に感謝
// https://gist.github.com/miyukki/2520787
/* ニコ生アラートコメントサーバ接続先一覧
twr01.live.nicovideo.jp:2525/1000000000
twr01.live.nicovideo.jp:2526/1000000002
twr01.live.nicovideo.jp:2527/1000000004
twr01.live.nicovideo.jp:2528/1000000006
twr01.live.nicovideo.jp:2529/1000000008
@nico-lab
nico-lab / opencv cmake
Last active April 15, 2019 11:10
ffmpeg で使う opencv をコンパイルする
$ git clone https://github.com/opencv/opencv
$ cd opencv
$ mkdir build
$ cd build
$ cmake -G "MSYS Makefiles" .. -DCMAKE_INSTALL_PREFIX=/mingw/i686-w64-mingw32 -DCMAKE_BUILD_TYPE="Release" \
-DWITH_IPP=OFF -DWITH_TBB=ON -DBUILD_opencv_flann=OFF -DBUILD_opencv_photo=OFF -DBUILD_opencv_highgui=OFF\
-DBUILD_opencv_ml=OFF -DBUILD_opencv_objdetect=OFF -DBUILD_opencv_video=OFF -DBUILD_opencv_imgcodecs=OFF
$ make && make install
@nico-lab
nico-lab / opencv.pc
Last active February 22, 2017 11:22
ffmpeg 用の opencv.pc
prefix=/mingw/i686-w64-mingw32
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir_old=${prefix}/include/opencv
includedir_new=${prefix}/include
Name: OpenCV
Description: Open Source Computer Vision Library
Version: 2.4.13.2
Libs: ${exec_prefix}/lib/libopencv_core2413.dll ${exec_prefix}/lib/libopencv_imgproc2413.dll
@nico-lab
nico-lab / swf
Created June 18, 2015 15:10
swfファイルの投稿はできなくなりました
<?xml version="1.0" encoding="utf-8"?>
<response>
<error>
<code>PARAMERROR</code>
<description>swfファイルの投稿はできなくなりました: http://blog.nicovideo.jp/niconews/ni053541.html</description>
</error>
<status>fail</status>
</response>
@nico-lab
nico-lab / ffmpeg で指定した場所にフィルタを当てる
Last active December 25, 2019 11:59
ffmpeg で指定した場所にフィルタを当てる
ffplay -f lavfi -i smptebars \
-vf "split[0][1];[0]colorkey=0x00bc00,\
lutrgb=val:val:val:if(val\,0\,1)*255,noise=alls=80:allf=t+u[0a];[1][0a]overlay"
ffmpeg -f lavfi -i smptebars \
-vf "split[0][1];[0]colorkey=0x00bc00,\
lutrgb=val:val:val:if(val\,0\,1)*255,noise=alls=80:allf=t+u[0a];\
[1][0a]overlay=format=rgb" -vframes 1 0x00bc00.png
@nico-lab
nico-lab / ffmpeg で指定した場所以外にフィルタを当てる
Last active December 25, 2019 09:09
ffmpeg で指定した場所以外にフィルタを当てる
ffplay -f lavfi -i smptebars \
-vf "split[0][1];[0]colorkey=0x00bc00,\
lutrgb=val:val:val:if(val\,0\,1)*255[0a];[1]noise=alls=80:allf=t+u[1a];[1a][0a]overlay"