Posts

Using ffmpeg to convert video file

Image
Using FFmpeg to convert video file Table of Contents 1 Some basic concept about digital video file 2 what is FFmpeg? 3 how FFmpeg works inside? 4 convert MOV file format into mp4 format 5 what's more 1 Some basic concept about digital video file There are many kinds of Video file format including MOV, mp4, Flv, AVI, which act as the containers in which video data is stored. And Video data is encoded by codecs. In other words, Video file format is just a container, and Video codecs are used to encode or compress the video data. The anatomy of video file including following parts: A container type: AVI, MOV, mp4, FLV… The video and audio signal: the data stored in the container. Codec: Codec refer to the software that is used to encode and decode the video signal The characteristics of a video signal: Frame size: the pixel dimension of the frame The Aspect ratio: the ratio of width to height Frame rate: the rate of frames per second Bitrate: th...

Chain of Responsibility design pattern

Chain Of Responsibility design pattern Table of Contents 1 What is it? 2 Practice this pattern in C 1 What is it? According to Gof95, Chain of Responsibility belong to Behavioral Patterns. The definition of this pattern in Gof95 is: Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it. 2 Practice this pattern in C In wikipadia , it gives an example code to illustrate this pattern in java code. And I translate those code into C. I upload the source code into the github. chain of responsibility in C

fs-mode for emacs (Linux filesystem management in emacs)

fs-mode for emacs fs-mode for emacs Table of Contents 1 What is fs-mode? 2 How to install it? 3 How to use it? 4 Use root-cmd.el to execute commands which needs root privilege. 1 What is fs-mode? fs-mode is an Linux file system management mode in emacs. It can manage your file system, you can mount or umount file system. It also support mount ecryptfs file system.( I put my little secret into ecryptfs file systems. ) 2 How to install it? I upload the source code to github, download it from following link. https://github.com/suzp1984/fs-mode add following code into emacs's init file. ;; change the directory according to your needs (add-to-list 'load-path "directory/to/install/" ) ( require ' fs-mode-autoload ) 3 How to use it? Use M-x list-fs to enter the fs-mode. and there are following key shortcuts bindings. m - mount a file system. u - umount a file system. q - quit the fs-mode. 4 Use root-c...

Configure emacs's auto-insert module

Configure emacs's auto-insert module Configure emacs's auto-insert module Table of Contents 1 how to use auto-insert? 2 Configure auto-insert-alist 1 how to use auto-insert? auto-insert mode is very useful, which can be used to declare the license in the header of the source code and some personal information, for example, who create this file and when? auto-insert will insert declaration according the variable named auto-insert-alist. It first search this variable and find the item match the file type, then extract the action to finish the auto insert. If you build an new elisp file buffer, and execute auto-insert command, it will insert the fantastic declaration with GPL license. But this command performs sucks in other mode like c-mode or python-mode. So you must configure variable auto-insert-alist by your self. 2 Configure auto-insert-alist I upload the source code into github, download according following a...

Using Emacs as Presentation tool

Using Emacs as presentation tool Using Emacs as Presentation tool Emacs is not just a editor, I found some hackers even use it to do presentations. So I collected some ways that emacs can become an presentation tool. Table of Contents 1 This article is not about… 2 epresent.el 3 Sacha Chua's source code. 4 Improved epresent.el 1 This article is not about… First, I must make a clearly announcement about what this article is not about. This article is not about how to make a pdf file style presentation using emacs as a editor, and using anther tools like a pdf viewer to play this slides. This article is about how to using emacs as an presentation style slides player. 2 epresent.el Epresent is an simple presentation mode for org-mode. How to use it? load eprsent.el into emacs open a org file (present.org). M-x epresent-run press "t" to view the top level of presentation navigate the presentation with 'n', ...

Pulseaudio-mode for emacs

Pulseaudio-mode for emacs Pulseaudio-mode for emacs Table of Contents 1 Get Source code 2 How to install it? 3 How to use it? 1 Get Source code You can download source code from my github repository . or you can clone the repository directly by git. git clone https://github.com/suzp1984/pulseaudio-mode.git 2 How to install it? First, get the source code according to above section. Add following line into your emacs's init file ;; replace following parameter into actual directory path. (add-to-list 'load-path "directory path to pulseaudio-autoload.el" ) ( require ' pulseaudio-autoload ) 3 How to use it? Start pulseaudio modules management by M-x list-pulseaudio-modules Start pulseaudio sinks management by M-x list-pulseaudio-sinks … x. Maybe add more function to make it more like a powerful pulseaudio control panel.

One way to record a program's Audio output

Image
One way to record a program's Audio output Table of Contents 1 PulseAudio Audio Server Introduction 2 Record a program's Audio output. 1 PulseAudio Audio Server Introduction Linux Audio System can be divided into 3 layers. Alsa/Oss package provide a bottom layer to driver sound card. PulseAudio/Jack/ESD package provide middle ware layer named Audio Server. Multimedia applications written by the API provided by Audio Server. PulseAudio is focused on desktop and mobile audio needs. It doesn't try to address low latency, but does provide seamless device switching, network routing, global per-application volume control and lots great stuff. 2 Record a program's Audio output. Following is the step by step tutorial to record an Audio output. Load a null-sink pactl load-module module-null-sink sink_name =steam Load combine-sink module-combine-sink is used to combine slaves sinks to build virtual sinks. # First use "pactl list ...