Crontab 執行結果的換行字元 - BBS
By Candice
at 2008-08-22T01:22
at 2008-08-22T01:22
Table of Contents
我使用 crontab 定時執行 ffmpeg 來作影像轉檔
執行完以後 cron 會把執行的輸出寄到信箱裡
不過可能 ffmpeg 在執行時會不斷更新進度訊息用到了 \r
所以在輸出的結果裡就會把這部份的訊息全部串成一大行,變得難以閱讀
目前我是可以在讀信時用 pipe 指令轉給 tr '\r' '\n'|less
這樣看起來會比較好些
不過我之前也有在 linux 中使用 crontab 執行 ffmpeg
我沒有特別設定什麼東西,輸出的結果就是可讀的
我猜可能是有什麼環境變數不同導致的,但不知道有什麼
環境變數或指令可以設定的?
FreeBSD的輸出: (+是 mutt將一行分成多行的特殊符號, ^M 應該是 \r)
Input #0, asf, from '/tmp/input.WMV':
Duration: 00:01:59.18, start: 3.000000, bitrate: 3182 kb/s
Stream #0.0: Audio: wmav2, 44100 Hz, stereo, 128 kb/s
Stream #0.1: Video: wmv3, yuv420p, 640x480, 3000 kb/s, 29.97 tb(r)
Output #0, flv, to '/tmp/output.flv':
Stream #0.0: Video: flv, yuv420p, 640x480, q=2-31, 200 kb/s, 29.97 tb(c)
Stream #0.1: Audio: libmp3lame, 44100 Hz, stereo, 64 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Stream #0.0 -> #0.1
Press [q] to stop encoding
frame= 29 fps= 0 q=31.0 size= 0kB time=0.97 bitrate= 2.2kbits/s ^Mframe= 59 fps= 57 q=31.0 size= 272kB
+time=0.86 bitrate=2588.0kbits/s ^Mframe= 89 fps= 58 q=31.0 size= 326kB time=1.46 bitrate=1827.0kbits/s ^Mframe= +117 fps= 57 q=31.0 size= 389kB time=2.17 bitrate=1469.2kbits/s ^Mframe= 145 fps= 57 q=24.8 size= 495kB time=3.19
+bitrate=1271.7kbits/s ^Mframe= 174 fps= 57 q=31.0 size= 597kB time=3.97 bitrate=1232.5kbits/s ^Mframe= 204 fps= +57 q=31.0 size= 720kB time=5.09 bitrate=1157.8kbits/s ^Mframe= 234 fps= 57 q=31.0 size= 833kB time=6.17
Linux 的輸出: (正常的輸出)
Input #0, asf, from '/tmp/input.wmv':
Duration: 00:01:18.31, start: 3.000000, bitrate: 3225 kb/s
Stream #0.0: Audio: wmav2, 44100 Hz, stereo, s16, 128 kb/s
Stream #0.1: Video: wmv3, yuv420p, 640x480, 3000 kb/s, 29.97 tb(r)
Output #0, flv, to '/tmp/a.flv':
Stream #0.0: Video: flv, yuv420p, 640x480, q=2-31, 200 kb/s, 29.97
tb(c)
Stream #0.1: Audio: libmp3lame, 44100 Hz, stereo, s16, 64 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Stream #0.0 -> #0.1
Press [q] to stop encoding
frame= 27 fps= 0 q=9.0 size= 0kB time=0.90 bitrate= 2.4kbits/s
frame= 53 fps= 49 q=7.6 size= 69kB time=0.52 bitrate=1080.9kbits/s
frame= 80 fps= 50 q=5.8 size= 97kB time=1.04 bitrate= 763.9kbits/s
frame= 105 fps= 50 q=7.2 size= 140kB time=1.78 bitrate= 647.5kbits/s
frame= 129 fps= 49 q=19.9 size= 183kB time=2.43 bitrate= 618.0kbits/s
--
Tags:
BBS
All Comments
Related Posts
sendmail
By Elizabeth
at 2008-08-21T03:12
at 2008-08-21T03:12
請問Broadcom 5715S 有解決嗎?
By Elvira
at 2008-08-17T05:00
at 2008-08-17T05:00
IDE燒錄機使用 k3b 安裝問題
By Dora
at 2008-08-15T18:13
at 2008-08-15T18:13
新手發問 關於dns無法開啟
By Blanche
at 2008-08-10T17:31
at 2008-08-10T17:31
不正常關機?
By Leila
at 2008-08-10T13:27
at 2008-08-10T13:27