發表文章

目前顯示的是 6月, 2021的文章

How to find the mouse position on the xfce4 desktop?

圖片
 How to find the mouse position on the xfce4 desktop? in the xfce4 desktop, using Whisker Menu to search the Accessibility Whisker Menu >> Accessibility check the "Show location of pointer on keypress"  then click the Close button. if xfce4-find-cursor was a command not found, then install xfce4-settings first:  apt-get install xfce4-settings open terminal : type : xfce4-find-cursor + Enter then you will find your mouse on the screen have animation

FFmpeg has three concatenation methods: how to using FFmpeg to concate video without re-encode

圖片
  FFmpeg has three concatenation methods: 1.  concat video filter Use this method if your inputs do not have the same parameters (width, height, etc), or are not the same formats/codecs, or if you want to perform any filtering. Note that this method performs a re-encode of all inputs. If you want to avoid the re-encode, you could re-encode just the inputs that don't match so they share the same codec and other parameters, then use the concat demuxer to avoid re-encoding everything. ffmpeg -i opening.mkv -i episode.mkv -i ending.mkv \ -filter_complex "[0:v] [0:a] [1:v] [1:a] [2:v] [2:a] \ concat=n=3:v=1:a=1 [v] [a]" \ -map "[v]" -map "[a]" output.mkv 2.  concat demuxer Use this method when you want to avoid a re-encode and your format does not support file-level concatenation (most files used by general users do not support file-level concatenation). $ cat mylist.txt file '/path/to/file1' file '/path/to/file2' file '/path/to/fil...

【Python】Python - Python 函數。Python Functions.

圖片
  【Python】Python - Python 函數。Python Functions. 函數是個程式碼區塊,這個程式碼區塊僅在被呼叫時執行。你可以傳遞參數給函數。函數會回傳結果資料回來。 建立一個函數 Python的函數使用 def  keyword去定義: 範例 def  my_function():    print ( "Hello from a function" ) 呼叫一個函數 要呼叫函數,使用函數名稱及參數即可: 範例 def  my_function():    print ( "Hello from a function" ) my_function() 上面輸出: Hello from a function 參數 傳遞入函數的資料稱為參數。 參數的設定在函數名稱後面括弧裡面。你可以增加許多你需要的參數,只要將那些參數使用逗號分隔開來。 下面的範例為函數傳遞一個參數fname。當函數被呼叫,會傳遞名字入函數,這個名字參數可以在函數內使用,範例為列印完整的姓名。 範例 def  my_function( fname ):    print (fname +  " Refsnes" ) my_function( "Emil" ) my_function( "Tobias" ) my_function( "Linus" ) 上面輸出: Emil Refsnes Tobias  Refsnes Linus  Refsnes 參數(Arguments)在Python文件中通常縮寫為args。 參數(Parameters or Arguments)? 參數為傳遞資訊入函數的部分。 來自一個函數的觀點: A parameter為在函數定義的中括弧內的變數。 An argument為一個值,當函數被呼叫時會送入函數的值。 Arguments的數量 預設值,函數呼叫時的參數數量必須正確的。表示如果函數需要2個參數,則必須要呼叫函數包含2個參數,不可多也不可少。 範例 函數需要2個參數,則送入2個參數: def  my_function(fname, lname):    print (...

How to compile FFmpeg with Cuda hardware accelerator?

圖片
 How to compile FFmpeg with Cuda hardware accelerator. STEPS: 1. system required: you must have a nvidia gpu. based on  https://developer.nvidia.com/nvidia-video-codec-sdk/download . System Requirements for Video Codec SDK 11 NVIDIA Windows display driver 456.71 or newer NVIDIA Linux display driver 455.28 or newer so, if you want to install Video Codec SDK 11, then you should install CUDA-toolkit 11.3. if you don't know how to install cuda-toolkit, you can check this article . 2. Compiling for Linux Compiling for Linux FFmpeg with NVIDIA GPU acceleration is supported on all Linux platforms. To compile FFmpeg on Linux, do the following: Clone ffnvcodec git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git Install ffnvcodec cd nv-codec-headers && sudo make install && cd ~ Clone FFmpeg's public GIT repository. git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg/ Install necessary packages. sudo apt-get install build-essential yasm cmake ...

How to set the static IP address on Ubuntu and pppoe when system boot

圖片
How to set the static IP address on Ubuntu: $ sudo nano /etc/network/interfaces then in nano editor add the following texts:  # The loopback network interface auto lo iface lo inet loopback auto dsl-provider iface dsl-provider inet ppp pre-up /bin/ip link set eth0 up # line maintained by pppoeconf provider dsl-provider auto  eth0 #iface eth0 inet manual # setting static ip... iface eth0 inet static         # ip address...         address 10.176.0.88         # network mask...         netmask 255.255.255.0         network 10.176.0.0         broadcast 10.176.0.255         # default gatway...         gatway 10.176.0.1 then ctrl+O & ctrl+x save and return to the command line: restart the network: $ sudo /etc/init.d/networking restart if you need start pppoe when system booted, using the commands : Press Ct...