lunes, 9 de octubre de 2017

copy_MKV-Keep-2audio.cmd

SET FFMPEG="C:\dvdz\ffmpeg\ffmpeg.exe"
@ECHO OFF
FOR %%a IN ("*.mkv") DO (
title Copy "%%a"
%FFMPEG% -i "%%a"  -map 0:0 -map 0:1        -map 0:4           -c:v copy  -c:a copy -y  "%%~na".copy.mkv
)
pause

jueves, 28 de septiembre de 2017

mkv_extract_subtitle_3.cmd

mkv_extract_subtitle_3.cmd

for %%x in (*.mkv) do c:\dvdz\mkvtoolnix\mkvextract.exe tracks "%%x"  3:"%%~nx.srt"
pause




mkv_extract_subtitle_4.cmd
for %%x in (*.mkv) do c:\dvdz\mkvtoolnix\mkvextract.exe tracks "%%x"  4:"%%~nx.srt"
pause


chromecast_hd_4m.cmd

SET FFMPEG="C:\dvdz\ffmpeg\ffmpeg.exe"

@ECHO OFF

FOR %%a IN ("*.mkv") DO (

title chrome "%%a"

%FFMPEG% -i "%%a" -c:v libx264 -profile:v high -level 4 -crf 18 -maxrate 4M -bufsize 16M -pix_fmt yuv420p -vf "scale=iw*sar:ih, scale='if(gt(iw,ih),min(1920,iw),-1)':'if(gt(iw,ih),-1,min(1080,ih))'" -x264opts bframes=3:cabac=1 -movflags faststart -c:a copy -y "%%~na".chrome.mkv

)

pause

https://pastebin.com/N9Z4rDpz

jueves, 21 de septiembre de 2017

Convertir videos a 2FPS-29.9FP¨S para Youtube (still images)

paso 1

render2fps.cmd
c:\dvdz\ffmpeg\ffmpeg  -i "1.mp4" -r 4 -crf 0 output2.mp4


paso 2

render29fps.cmd
c:\dvdz\ffmpeg\ffmpeg  -i output2.mp4 -r 29.97 -crf 0   -max_muxing_queue_size 4000 output.mp4

--

opcional rotar 180º (en paso 1)

c:\dvdz\ffmpeg\ffmpeg  -i "1.MP4" -r 2 -crf 0  -vf "hflip,vflip"   output2.mp4


miércoles, 20 de septiembre de 2017

FFMPEG X264 encode



ffmpeg -i MyMovie.mkv -vf scale=-1:720 -c:v libx264 -crf 0 -preset veryslow -c:a copy MyMovie_720p.mkv

ffmpeg -i MyMovie.mkv -vf scale=-1:720 -c:v libx264 -crf 18 -preset veryslow -c:a copy MyMovie_720p.mkv

The range of the quantizer scale is 0-51: where 0 is lossless, 23 is default, and 51 is worst possible. A lower value is a higher quality and a subjectively sane range is 18-28. Consider 18 to be visually lossless or nearly so: it should look the same or nearly the same as the input but it isn't technically lossless.

The range is exponential, so increasing the CRF value +6 is roughly half the bitrate while -6 is roughly twice the bitrate. General usage is to choose the highest CRF value that still provides an acceptable quality. If the output looks good, then try a higher value and if it looks bad then choose a lower value.

miércoles, 11 de enero de 2017

wma2mp3.sh

Convertir archivos WMA en MP3 desde linux

Fuente:

http://andyss.blog.51cto.com/315552/179625


#!/bin/bash
#############################################################
# wma2mp3 v0.12
# by Calum and Void Main
#
# e.g. wma2mp3 myfile.wma
# e.g. wma2mp3 myfile.wma myfile2.wma myfile3.wma
# e.g. wma2mp3 "my file.wma" "my file 2.wma" "my file 3.wma"
# e.g. wma2mp3 *.wma
# e.g. wma2mp3 /directory/containing/wma/files
# e.g. wma2mp3 .
#
# http://voidmain.is-a-geek.net/forums/viewtopic.php?t=407
#
# History:
# 16 May 2003 - v0.1 wma2mp3 script created
# 27 August 2005 - v0.11 -aofile had been deprecated, corrected
# 28 August 2005 - v0.12 Added "IFS=" -Void
#############################################################

# Turn off input field separation so filenames with spaces work
IFS=

#############################################################
# Move the conversion process into a function that can
# be called.
# The "&&" makes it so each step must be successful before
# the next step will be done.
#############################################################

function wma2mp3 () {
    if [ ! -f "$1" ]; then
         echo "File $1 not found!"
    else
         mplayer -ao pcm:file="${1%%.[Ww][Mm][Aa]}.wav" "$1" &&
         lame -h -b 192 "${1%%.[Ww][Mm][Aa]}.wav" "${1%%.[Ww][Mm][Aa]}.mp3" &&
         rm -f "${1%%.[Ww][Mm][Aa]}.wav" ||
         echo "There was a problem with the conversion process!"
    fi
}

#############################################################
# Not enough information to compute
#############################################################
if [ $# -lt 1 ]; then
     echo "Syntax: `basename $0` "
     exit
fi

#############################################################
# Directory was passed so convert all wma files in directory
#############################################################
if [ $# -eq 1 -a -d "$1" ]; then
    for file in $1/*.[Ww][Mm][Aa]
    do
        wma2mp3 "$file"
    done
    exit
fi

#############################################################
# One or more wma files were passed, convert them
#############################################################
for file in $*
do
    wma2mp3 "$file"
done
exit

miércoles, 16 de diciembre de 2015

mp4pack_ALL_crf23.cmd

Reduce tamaño de los  archivos enormes de gopro.

mp4pack_ALL_crf23.cmd

mkdir pack
FOR /F "tokens=*" %%G IN ('dir/b ^"*.mp4^"') DO C:\dvdz\WinFF\ffmpeg.exe -y -i "%%G" -crf 23.0 -vcodec libx264 -acodec copy -coder 1 -flags +loop -cmp chroma -partitions +parti4x4+partp8x8+partb8x8 -me_method hex -subq 6 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 1 -threads 0 "pack\%%G"
pause