Browse Categories All Posts
Categories
K
Kai
Post Timeline
This PC
Timeline
Recycle Bin
fmpeg convert all files in foler

fmpeg convert all files in foler

 for i in *.avi; do ffmpeg -i "$i" "${i%.*}.mp4"; done

for i in *.gif; do ffmpeg -i "$i" "${i%.*}.mp4"; done


repair ffmpeg

ffmpeg -fflags +genpts -i input.mkv -c copy repaired.mkv

 

 fflags

‘discardcorrupt’

Discard corrupted packets. 


 


bash substring

bash substring

NAME=${MYVAR%:*}  # retain the part before the colon

NAME=${NAME##*/} # retain the part after the last slash

 
${MYVAR#pattern}     # delete shortest match of pattern from the beginning
${MYVAR##pattern}    # delete longest match of pattern from the beginning
${MYVAR%pattern}     # delete shortest match of pattern from the end
${MYVAR%%pattern}    # delete longest match of pattern from the end 
 
   

So # means match from the beginning (think of a comment line) and % means from the end. One instance means shortest and two instances means longest.

 

${MYVAR:3}   # Remove the first three chars (leaving 4..end)
${MYVAR::3}  # Return the first three characters
${MYVAR:3:5} # The next five characters after removing the first 3 (chars 4-9) 
 
${MYVAR/search/replace}
https://naive-many.com/bk3.VG0EPH3EpevCb/mMVUJlZgDD0-3yMZj_Ai3IM-TrUizVLGT/cVyIMuD/cNx/NSTccq