2013年3月29日 星期五

太極拳進度20130328

本週延續上週,還是「推戰車」。在練習之前,先複習了「鳥申」、「二炁陰陽盪逍遙」,特別又糾正「肘底捶」。
重點如下:
「盪逍遙」是軸線不要跑掉,手不要用力,不要用上身轉,肩不可動,用腳底帶動旋轉,注意下手。
「鳥申」的胯鬆下去,身體不要浮起。腳尖不要用力向上勾,而是要去找到炁向下,腳向上的頻率和感覺。
「肘底捶」第三動,手盪下來像熊經的手,不要「死板板」地旋。右手心對心窩,然後,手腳隨著胯送上。
「推戰車」最重要的是上身一定要正,鬆下去,力量接到湧泉後,身體隨著左胯向前平移,胯不可浮起,timing 很重要。不要想著要把對方打出去,這樣子身體就會僵硬,不鬆就是捱打的架子。

2013年3月22日 星期五

太極拳進度20130322

現在拳架越改越細,今天講的是,用腳底帶動,走直線,屁股不要先動。糾正了「倒攆猴」、「單鞭下式」、「退步跨虎、轉身擺蓮」這三式,加強練習「推手單練」。
倒攆猴,當重心向後移的時候,注意不能斜著走,這樣子屁股會凸出,轉的時候就無法將重心維持住,也就不能由腳底發動啦。
單鞭下式注意,膝蓋對腳尖,移位。當向下時,屁股不要凸出。手向後,身體往下鬆,否則,身體就會往前傾。這一式真的不好練。
總而言之,重點在於如鬆胯,由腳底帶動。
「推戰車」,練的是「勁」要能從腳底發出,想要發得出去,timing 很重要。不能等到對方的力量都來了之後,才想要移位,這是已經來不及了。而是當對方的力量來的時候,往下鬆,接到了就移位。我現在是鬆下後,看著後面遠遠的地方,平移向前,勁自然由腳底發出。

ffmpeg 使用心得

ffmpeg 使用心得

為了要將影片轉成 ipod touch 3代,可用的格式,特別學習 ffmpeg,試了好幾天,終於找出來滿意的方法,特此記錄下來,免得忘了。

轉檔時的指令

ffmpeg -i $1 -s 720x406 -vpre ipod -ac 2 -sn -y -vf subtitles=$1.srt $1.m4v

其中

-i $1 是要轉檔的檔名

-s 720x406 是轉檔後的解析度,406 = 720 * 720 / 1280,(原始檔的解析度為 1280x720)。這個一定要去計算,不然,在電視上看,畫面比例會不對,字幕可能出不來。

-vpre ipod 是為了 ipod 特別找出來的 preset,設定如後。

--ac 2 是轉成立體聲,不然 ipod touch 沒辦法播放。

--sn 不顯示原始檔中的字幕。因為,我要用另外的字幕檔。

--vf subtitles 為字幕檔。

preset設定

preset 可以放在 ~/.ffmpeg,檔名為 arg.ffpreset,例如,我設定了一個專門轉到 ipod touch 的 preset 檔,命名為 ipod.ffpreset。

strict=-2

vcodec=libx264
vprofile=baseline
level=30
maxrate=10000000
bufsize=10000000

#preset=fast
preset=slower

crf=19
bf=0
refs=1

ab=192k

調整字幕時間

這個很少用到,在 linux 中,就找到 aegisub 是可用的,那就拿來用了,沒有什麼特別的考慮。

提取 mkv 內嵌字幕

為了要把 mkv 中的字幕,轉成繁體。使用以下三道指令即可:

ffmpeg -i $1.mkv -vn -an -scodec copy $1.ssa
opencc -i $1.ssa -o o.ssa
ffmpeg -i $1 -s 720x406 -vpre ipod -ac 2 -sn -y -vf ass=$1.ssa $1.m4v

參考資料

ffmpeg help

Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Getting help:
    -h      -- print basic options
    -h long -- print more options
    -h full -- print all options (including all format and codec specific options, very long)
    See man ffmpeg for detailed description of the options.

Print help / information / capabilities:
-L                  show license
-h topic            show help
-? topic            show help
-help topic         show help
--help topic        show help
-version            show version
-formats            show available formats
-codecs             show available codecs
-decoders           show available decoders
-encoders           show available encoders
-bsfs               show available bit stream filters
-protocols          show available protocols
-filters            show available filters
-pix_fmts           show available pixel formats
-layouts            show standard channel layouts
-sample_fmts        show available audio sample formats

Global options (affect whole program instead of just one file:
-loglevel loglevel  set libav* logging level
-v loglevel         set libav* logging level
-report             generate a report
-max_alloc bytes    set maximum size of a single allocated block
-y                  overwrite output files
-n                  do not overwrite output files
-stats              print progress report during encoding
-bits_per_raw_sample number  set the number of bits per raw sample
-croptop size       Removed, use the crop filter instead
-cropbottom size    Removed, use the crop filter instead
-cropleft size      Removed, use the crop filter instead
-cropright size     Removed, use the crop filter instead
-padtop size        Removed, use the pad filter instead
-padbottom size     Removed, use the pad filter instead
-padleft size       Removed, use the pad filter instead
-padright size      Removed, use the pad filter instead
-padcolor color     Removed, use the pad filter instead
-vol volume         change audio volume (256=normal)

Per-file main options:
-f fmt              force format
-c codec            codec name
-codec codec        codec name
-pre preset         preset name
-map_metadata outfile[,metadata]:infile[,metadata]  set metadata information of outfile from infile
-t duration         record or transcode "duration" seconds of audio/video
-fs limit_size      set the limit file size in bytes
-ss time_off        set the start time offset
-timestamp time     set the recording timestamp ('now' to set the current time)
-metadata string=string  add metadata
-target type        specify target file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd", "ntsc-svcd", ...)
-frames number      set the number of frames to record
-filter filter_list  set stream filterchain
-reinit_filter      reinit filtergraph on input parameter changes

Video options:
-vframes number     set the number of video frames to record
-r rate             set frame rate (Hz value, fraction or abbreviation)
-s size             set frame size (WxH or abbreviation)
-aspect aspect      set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)
-bits_per_raw_sample number  set the number of bits per raw sample
-croptop size       Removed, use the crop filter instead
-cropbottom size    Removed, use the crop filter instead
-cropleft size      Removed, use the crop filter instead
-cropright size     Removed, use the crop filter instead
-padtop size        Removed, use the pad filter instead
-padbottom size     Removed, use the pad filter instead
-padleft size       Removed, use the pad filter instead
-padright size      Removed, use the pad filter instead
-padcolor color     Removed, use the pad filter instead
-vn                 disable video
-vcodec codec       force video codec ('copy' to copy stream)
-timecode hh:mm:ss[:;.]ff  set initial TimeCode value.
-pass n             select the pass number (1 to 3)
-vf filter list     video filters
-b bitrate          video bitrate (please use -b:v)
-dn                 disable data

Audio options:
-aframes number     set the number of audio frames to record
-aq quality         set audio quality (codec-specific)
-ar rate            set audio sampling rate (in Hz)
-ac channels        set number of audio channels
-an                 disable audio
-acodec codec       force audio codec ('copy' to copy stream)
-vol volume         change audio volume (256=normal)
-af filter list     audio filters

Subtitle options:
-s size             set frame size (WxH or abbreviation)
-sn                 disable subtitle
-scodec codec       force subtitle codec ('copy' to copy stream)
-stag fourcc/tag    force subtitle tag/fourcc
-fix_sub_duration   fix subtitles duration
-spre preset        set the subtitle options to the indicated preset

參考指令

假設video.avi有一個視頻軌、兩個音頻軌,取其中的視頻軌和第二個音頻軌加sub.ass做成video.mkv而不重新編碼:

ffmpeg -i video.avi -i sub.ass -map 0:0 -map 0:2 -map 1 -c:a copy -c:v copy -c:s copy video.mkv

如果要重新編碼(字幕合成到視頻圖像):

ffmpeg -i video.avi -map 0:0 -map 0:2 -c:a copy -c:v <視頻編碼庫,比如libx264> -vf ass=sub.ass video.mkv

2013年3月8日 星期五

太極拳進度20130308

掤:先練「潑水」。手是由後腳輕輕的送上,肩不可動。
左右分腳:重點在胯,留在原位,不要踢腳,身體纔不會浮起。
摟膝拗步:身體不要先轉,發勁時,遇到阻力,往實腳的湧泉鬆下,手不要折到,不要「貪」。
發勁這玩意還真不好練,碰到阻力就想去「抗」,鬆不下去。看來還要花一點時間。
回家的時候,一路上都看到中華對日本的電視轉播。
到了九局上,又被日本跑回一分,變成了 3 比 3。九局下,中華隊沒有得分,進入延長賽。十局上,又被日本得了 1 分,現在是 3:4,中華隊進攻。
聽到歡呼聲,應該是第七棒張建銘擊出右外野安打,一人出局,一、二壘有人。
很多年沒有看到臺灣為棒球加油的盛況,希望臺灣的棒球能夠復活。
聽到哀嚎聲了,第八棒陳鏞基擊出內野滾地球,造成雙殺,三人出局。
可惜了。