Saturday, March 25, 2023

Removing Hidden Chars from a File

Removing the garbage characters with the Linux/Unix 'tr' command:

To get the binary characters out of your files, there are several approaches, probably the easiest solution involves using the Linux/Unix 'tr' command. To remove non-printable binary characters (garbage) from a Linux/Unix text file do the following:


tr -cd '\11\12\40-\176' < input.c > output.c

----

Thursday, March 09, 2023

Using a Mplayer option to keep the pitch at higher speeds of video or audio.

If you like to listen to an audio or watch a video at higher speed, the sound could get distorted, i.e. with the wrong pitch ("chipmunk mode"). In mplayer when you change the speed using the keys "[" to decrease or "]" to increase; the tempo is not adjusted accordingly. In command line a solution is with the use of  "-af scaletempo" option, example: 

mplayer -af scaletempo videofile.mp4

The speed can be included as 

mplayer -af scaletempo -speed 2 videofile.mp4

or being changed later with  the keys "[" or "]". 

In the case of using a "Mplayer" GUI, like in the case of "SMPlayer", the "-af scaletempo" functionality is already integrated.