convertion from old video

ffmpeg -i VTS_01_1.VOB -vf yadif -c:v libx264 -crf 23 -preset medium -c:a aac -strict -2 -b:a 128k -ar 44100 -ac 2 01.mp4

to concat prepare a list.txt file as follow:

file <path of video 1>
file <path of video 2>
file <path of video 3>
file <path of video 4>

after start concat with

ffmpeg -f concat -safe 0 -i list.txt -c copy video_output.mp4

 

 

OBS Studio on Mageia 7 with nvenc

obtain ffmpeg nv codec headers:

git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git
cd nv-codec-headers

edit Makefile to use /usr as PREFIX and lib64 as LIBDIR instead /usr/local and lib, after build and install with:

make
sudo make install

now install dependencies:

urpmi libgsm-devel \
libcdio-paranoia-devel \
libmp3lame-devel \
libnut-devel \
libv4l-devel \
libpulseaudio-devel \
libsndio-devel \
texi2html \
yasm \
libopencl-devel \
libaom-devel \
libcelt0-devel \
libdav1d-devel \
libdirac-devel \
frei0r-devel \
libjack-devel \
libass-devel \
libdc1394-devel \
libjpeg-devel \
libmodplug-devel \
libopenjpeg2-devel \
opencv-devel \
libschroedinger-devel \
libsdl2.0-devel \
libspeex-devel \
libtwolame-devel \
libxavs-devel\
libfdk-aac-devel

after get package from http://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia/distrib/7/SRPMS/core/release|updates and edit spec file to add –enable-nvenc after remove sdl in BuildRequires and rebuild

rpmbuild -ba --define 'distro_section tainted' --with plf --with fdkaac ffmpeg.spec

remove tained packages already installed with:

rpm -e --nodeps ffmpeg-4.1.4 \
lib64avcodec58-4.1.4 \
lib64avfilter7-4.1.4 \
lib64avformat58-4.1.4 \
lib64avresample4-4.1.4 \
lib64avutil56-4.1.4 \
lib64ffmpeg-devel-4.1.4 \
lib64postproc55-4.1.4 \
lib64swresample3-4.1.4 \
lib64swscaler5-4.1.4

after install packages without static-devel, debugsource and debuginfo packages

 

 

 

in Mageia 6 instead you need only to:

# ln -s /usr/lib64/nvidia-current/bin/nvidia-modprobe /usr/bin/nvidia-modprobe
# ln -s /usr/lib64/nvidia-current/bin/nvidia-smi /usr/bin/nvidia-smi

 

Encoding MTS files with NvENC

#!/bin/bash

# merge more mts file in one and encode it
# to obtain 1600x900 x264/aac file

# detect anctual folder
actualdir="`pwd`"

# check for folder path
if [ -z "$1" ]; then
    echo -e "Nessun argomento trovato !!!\nDevi specificare la path della cartella degli MTS da unire\n"
    exit 1
fi

# move into mts folder path
cd "$1"
FILES=`ls -1 *.MTS`
FILESVAR=""

# concat of MTS files name
for i in $FILES ; do
  FILESVAR="$FILESVAR$i|"
done

# encoding command generation
ffmpeg \
  -threads 4 \
  -i "concat:$FILESVAR" \
  -i /file/path/for/watermark.png \
  -filter_complex "[0:v]yadif, scale=-1:900[b];[b][1:v]overlay=x=(main_w-overlay_w-16):y=(main_h-overlay_h-16)" \
  -vcodec h264_nvenc \
  -preset:v llhq \
  -profile:v high \
  -level:v 5 \
  -rc:v ll_2pass_quality \
  -qmin:v 28 \
  -qmax:v 52 \
  -acodec aac \
  -ab 320k \
  -cutoff 22050 \
  -sn out.mkv




# return in first folder
cd $actualdir

 

kodi buffering

file
android = android/data/org.xbmc.kodi/files/.kodi/userdata/advancedsettings.xml
linux = ~/.kodi/userdata/advancedsettings.xml

<advancedsettings>
  <network>
    <buffermode>1</buffermode>
    <cachemembuffersize>20971520</cachemembuffersize>
    <readbufferfactor>4.0</readbufferfactor>
  </network>
</advancedsettings>

see also http://kodi.wiki/view/HOW-TO:Modify_the_video_cache

from any to xvid mp3

script to conver audio into mp3 constant bitrate 128

#! /bin/bash
mencoder "$1" -idx
-ovc copy
-oac mp3lame -lameopts cbr:mode=2:br=128
-o "$1-mp3.avi"

script to conver audio into mp3 constant bitrate 128 and video into xvid constant birtare 1500 with weight fixed to 720px

#! /bin/bash
mencoder "$1"
-oac mp3lame -lameopts cbr:br=128
-ovc xvid -xvidencopts pass=2:bitrate=1500
-vf scale=720:-10,harddup
-idx
-o "$1-xvidmp3.avi"

 

from .ts to XviD/x264

.ts to mkv (copy audio and video)
$ mencoder input.ts -oac mp3lame -lameopts cbr:br=128 -ovc xvid -xvidencopts aspect=4/3:pass=2:bitrate=1500 -o output.avi

 

#!/bin/bash
# merge more mts file

cd "$1"
FILES=`ls -1 *.MTS`
MERGECMD="mencoder -of lavf -lavfopts format=mp4 -vf harddup -oac copy -ovc copy "

for i in $FILES ; do
    if [ ! -f "$i.mp4" ];
    then
        mencoder "$i"
            -demuxer lavf
            -oac copy
            -ovc copy
            -of lavf=mp4
            -o "$i.mp4"
    fi
    MERGECMD="$MERGECMD $i.mp4 "
done

MERGECMD="$MERGECMD -o FULLMOVIE.mp4"
$MERGECMD