1. 程式人生 > 實用技巧 >tasker_如何通過Tasker Automation將Android裝置用作行車記錄儀

tasker_如何通過Tasker Automation將Android裝置用作行車記錄儀

tasker

tasker

3531901577_308a9419c6_o2

Have you ever wanted to get more out of your Android convergence device? How about using it as a hassle free video recorder for your car trips? HTG explains how you can accomplish this with just “off the shelf” components.

您是否曾經想從Android融合裝置中獲得更多收益? 將它用作汽車旅行的無憂錄影機怎麼樣? HTG解釋瞭如何通過“現成的”元件來完成此任務。

Image by Ernest, dinglisch, rubberbigpepper, Svet Ivantchev & Aviad (a.k.a. Hotfortech).

圖片由ErnestdinglischrubberbigpepperSvet IvantchevAviad(又名Hotfortech)提供

我為什麼要這樣做? (Why would I do this?)

Many people have asked me, why do you record your trips? Why is that interesting? And what do you do with all of this data?

很多人問我,你為什麼要記錄旅行? 為什麼這麼有趣? 您如何處理所有這些資料?

My answer is that it started because there was a famous local story(Israel), where a cop pulled over a driver and gave him a ticket for “not stopping at a stop sign” when he did…

我的回答是開始,因為有一個當地著名故事(以色列) ,一個警察拉了個司機,給了他一張“不停在停車標誌上”的罰單……

But the real upshot of doing this, is that the audio in the car is captured. That means that everything that’s being said in the vehicle is recorded. All those precious family moments are captured for posterity.

但是,這樣做的真正目的是捕獲汽車中的音訊。 這意味著車輛中所說的一切都會被記錄下來。 所有這些珍貴的家庭時光都被捕獲以供後代使用。

But leaving all of the above aside, there is always the possibility that you would capture something like:

但是,將以上所有內容放在一邊,總有可能您會捕獲到類似以下內容的內容:

Or even (9gag):

甚至( 9gag ):

awr7Zjy_460sa

As for what I do with all of that data? I keep it, because I personally would like to have more memories stored than less. I am willing to invest the required resources in doing so (future article), but that is a personal choice.

至於我如何處理所有這些資料? 我保留它,因為我個人希望儲存的記憶體多於少。 我願意為此投入必要的資源(未來文章),但這是個人選擇。

為什麼不使用智慧手機而不是專用裝置? (Why would or wouldn’t I use my Smartphone instead of a dedicated device?)

It’s not that we at HTG are dismissing the merits of a dedicated device, but If you’re like us (a geek at your core), you want your convergence device. You don’t want multiple devices and have your data dispersed between them, forcing you to manually synchronize them. Needless to say, this manual procedure gets real old real fast, and if you use your Smartphone, you can take advantage of many applications specifically written to alleviate this issue.

並不是說我們在HTG消除了專用裝置的優點,但是如果您像我們一樣(核心怪胎),則希望使用融合裝置。 您不希望有多個裝置,並且您的資料分散在它們之間,從而迫使您手動對其進行同步。 不用說,此手動過程很快就會變老,而且,如果您使用智慧手機,則可以利用專門編寫的許多應用程式來緩解此問題。

With the above said, if you’re going to be using everything your device has to offer, such as shooting 1080p video, GPS, BT and with the screen on (mostly), for a prolonged period of time, you may encounter some hurdles:

有了以上所述,如果您要長時間使用裝置提供的所有功能,例如拍攝1080p視訊,GPS,BT並在螢幕上(大多數情況下)開啟螢幕,則可能會遇到一些障礙:

  • Battery consumption – If you don’t have a device like the S4 that can actually charge while doing all of the above, you might find that even connecting your device to a power source isn’t enough and you’ll finish the road trip with less power than you started, even though you were plugged into a charger. Personally, I’ve been doing this since I got my S2, and as long as you connect the phone to a decent power plug that can drive the 1000mAh of power the device can draw for charging, you shouldn’t have an issue. At one time, I’ve even used a first generation Galaxy tab with a 4100mAh battery for 40 minutes a day without connecting it to power at all, and had a sufficient amount of juice to finish the day.

    電池消耗–如果您沒有像S4這樣的裝置可以在執行上述所有操作時實際充電,則可能會發現,即使將裝置連線到電源也不夠用,並且您將通過以下方式完成旅途:即使您已插入充電器,耗電量也比開始時少。 就我個人而言,自從我獲得S2以來,我就一直在這樣做。只要將手機連線到可以驅動裝置可充電的1000mAh電源的體面電源插頭,就不會有問題。 一次,我什至沒有使用第一代帶有4100mAh電池的Galaxy Tab一天40分鐘,而根本沒有接通電源並且有足夠的汁液來完成一天的工作。

  • Heat – Using/pushing your device to this work regimen may be a tad more than the manufacturer planned for, and considering that the device will be mounted above the dashboard (so it has a line of sight to the road), where it is usually more exposed to the sun… May A) Make it very hot when you arrive at your destination, and some people wouldn’t like that feeling in their pocket and B) May shorten its life span. Personally, I think that is what the 2 year warranty you get with the Galaxy devices is for… but as always, that is a personal choice.

    熱量–將裝置使用/推入該工作方案可能要比製造商計劃的要多一點,並考慮到該裝置將安裝在儀表板上方(因此它在道路上的視線範圍內),通常在更多地暴露在陽光下……可能A)到達目的地時會變得很熱,有些人不喜歡口袋裡的那種感覺,並且B)可能會縮短其壽命。 就個人而言,我認為這是您使用Galaxy裝置享受2年保修的目的……但一如既往,這是個人選擇。

  • Device slowdown – Because you now have this background workload, you may find that if you want to use something in addition to the above, like a navigation program (for example Waze), the device reacts more slowly than it would without it. In addition, depending on your device’s grade and resources, this may lead to the Android system deciding that your RAM is too low and close apps “for you”. If your device is really low in CPU power and RAM, these may become deal breakers. Again, personally, I’ve been using this since my S2, and I’ve found that the slowdown is bearable.

    裝置變慢–由於您現在有這個後臺工作量,因此您可能會發現,如果要使用上述功能之外的其他功能(例如導航程式(例如Waze )),裝置的React將比沒有裝置時React更慢。 此外,根據您裝置的等級和資源,這可能導致Android系統決定您的RAM太低,並“為您”關閉應用程式。 如果您的裝置的CPU和RAM確實很低,則可能會破壞交易。 同樣,就我個人而言,自S2起我就一直在使用它,並且發現速度下降是可以忍受的。

As everything in life, it is a trade-off. It is only you who can decide for yourself if its worth it or not.

作為生活中的一切,這是一種折衷。 只有您自己決定是否值得。

我需要什麼? (What do I need?)

You will only need a couple of things that are easily obtainable.

您只需要幾個容易獲得的東西。

A video recording program

錄影節目

While there are countless programs on the market to do this, since I did the round up to find one way back in my S2 days, I haven’t come across anything better then VideoReg. Yes, it is a paid app, but its features IMHO are unmatched by any other free app. Beyond the common features: recording the video at full HD resolution, shooting a picture by a proximity sensor trigger, setting the amount of temporary data allocation, overlaying GPS information, etc., this app (unlike other apps) records the GPS information as a standard subtitle file that you can play with any subtitle supporting application. It can also overlay the video you’re shooting to the “desktop” so you don’t have to be in the app to see what it is recording. Last but by no means least is that it can also receive Tasker triggers to perform specific actions like start/stop recording, which makes it the ideal candidate for what we are trying to accomplish.

儘管市場上有無數的程式可以執行此操作,但是由於我在S2時代進行了全面的發現以尋找一種方法,所以我沒有比VideoReg更好的了。 是的,它是一個付費應用程式,但是IMHO的功能是其他任何免費應用程式都無法比擬的。 除了通用功能:以全高清解析度錄製視訊,通過接近感測器觸發器拍攝圖片,設定臨時資料分配量,疊加GPS資訊等,此應用程式(與其他應用程式不同)將GPS資訊記錄為您可以與任何支援字幕的應用程式一起播放的標準字幕檔案。 它還可以將您正在拍攝的視訊疊加到“桌面”上,因此您不必在應用程式中就可以檢視正在錄製的內容。 最後但並非最不重要的一點是,它還可以接收Tasker觸發器以執行諸如開始/停止記錄之類的特定操作,這使其成為我們要完成的目標的理想人選。

I also have it on good authority that the applications’ creator is working on enabling the “dual-camera” feature of the S4 so that not only audio is saved. So go and support its development by getting VideoReg from Google Play.

我也有一個很好的權威,那就是應用程式的建立者正在努力啟用S4的“雙攝像頭”功能,以便不僅儲存音訊。 因此,可以通過從Google Play獲取VideoReg來支援其開發。

videoreg1

An event handler program

事件處理程式

What we are trying to do is to save you from having to tell the Android device that you are in your car. We want to automate this procedure, so all you have to do is mount the device in the car mount and the rest will happen automatically. We will use Tasker to automate this action, but you may use any other automation program of your choosing.

我們正在嘗試做的是使您不必告訴Android裝置您在車裡。 我們要使該過程自動化,因此您所要做的就是將裝置安裝在汽車支架上,其餘的將自動發生。 我們將使用Tasker來自動執行此操作,但是您可以使用選擇的任何其他自動化程式。

You can, and should, get Tasker directly from the applications’ developer site.

您可以並且應該直接從應用程式的開發人員站點獲得Tasker

tasker1

A USB cigarette lighter power plug

USB點菸器電源插頭

Even if your car comes with a USB connector for it’s sound system, you don’t necessarily want to use it mainly do supply power. These sort of systems are usually unable to push the amount of power that the Android device needs. I’ve found that some systems push as low as only 200mAh. Needless to say, that if you want to take advantage of the 2000mAh ability of the new devices like the S4 or even just the 800mAh like the S2, that would not do.

即使您的汽車的音響系統帶有USB聯結器,您也不一定要主要使用它來供電。 這類系統通常無法提高Android裝置所需的電量。 我發現有些系統的電量低至僅200mAh。 不用說,如果您想利用像S4這樣的新裝置2000mAh容量,甚至像S2這樣的只是800mAh的容量,那都不會。

There are numerous options for where to get this sort of an adapter (the below is just an example). If you can get one that has the “2.1A + 1A” (2100mAh + 1000mAh), like the one in the picture, that would be preferable. We would suggest you don’t get anything that doesn’t have a 1 year warranty, as this single tiny thing can destroy your expensive device.

對於從何處獲得這種介面卡有很多選擇(以下僅是示例)。 如果您可以得到如圖所示的具有“ 2.1A + 1A”(2100mAh + 1000mAh)的電池,那將是更好的選擇。 我們建議您不要獲得沒有1年保修的產品,因為這件微小的事情會破壞您昂貴的裝置。

sku_222339_2

A Bluetooth capable car system (optional).

具有藍芽功能的汽車系統(可選)。

In this guide, we will show how to use a Bluetooth connection as the “state” indicator for Tasker (even though it is by no means the only way to do this), for two reasons:

在本指南中,我們將展示如何將藍芽連線用作Tasker的“狀態”指示器(儘管絕不是唯一的方式),這有兩個原因:

  • First, using a BT connection makes it so you can get phone calls as well as any other audio function from your car’s sound system (like play music from your device), which is exactly the way you would want your convergence device to work.

    首先,使用BT連線可以使您從汽車的音響系統中獲得電話以及任何其他音訊功能(例如從裝置播放音樂),這正是您希望融合裝置正常工作的方式。
  • Second, the current crop of Android devices aren’t always compatible with car stereo systems that have USB connectivity, as the phones don’t always show up as a regular “mass storage device”, making it so the sound systems are unable to use them.

    其次,當前的Android裝置並不總是與具有USB連線功能的汽車立體聲系統相容,因為電話並不總是顯示為常規的“大容量儲存裝置”,從而使聲音系統無法使用他們。

If you don’t have a BT capable car stereo system, and you don’t want to shell out the $$$ to get one installed, don’t fret, HTG has got you covered. You can get a BT->to->Radio converter and have your phone hook up to it using BT and have it broadcast the BT content to your car stereo as a regular Radio station. I have personally used the JABRA CRUISER, and while I did eventually replace it with a “real” car stereo system after 2 years of use, it did a decent enough job.

如果您沒有支援BT的汽車立體聲系統,又不想掏空$$來安裝一個,請不要擔心,HTG可以滿足您的需求。 您可以獲取BT-> to-> Radio轉換器,並使用BT將電話連線到該轉換器,並使其作為常規廣播電臺將BT內容廣播到您的汽車立體聲系統中。 我個人使用過JABRA CRUISER ,儘管最終使用了2年後最終還是用“真實的”汽車立體聲音響系統代替了它,但它的表現還是不錯的。

Jabra_CRUISER_02_1440X810

Car mount

車載支架

While there is a seemingly endless variety of car mounts available, we suggest you consider the following points:

雖然看似種類繁多的車載支架可用,但我們建議您考慮以下幾點:

  • Don’t get one that is suited for your device exclusively. These mounts, are A) usually unusable if you get/have any sort of protection on your device (like a case or skin), and B) are unusable for the next device you do get.

    不要得到專門適合您的裝置的裝置。 這些安裝座是:A)如果您在裝置上獲得/具有任何型別的保護(例如保護套或面板),通常將不可用;並且B)對於您獲得的下一個裝置將不可用。
  • Do invest more then the bare minimum. While it seems like you can just order one “off of the net” and be done with it, we have found that the “net ordered” crop of holders seem to be “designed for the dump”, and don’t last too long. This leaves you with the inconvenience of having to replace them. That is why we suggest you invest the time and effort to get one that can give you at least a 1 year warranty.

    做更多的投資而不是最低的投資。 雖然看起來您可以訂購一個“網外”產品並完成它,但我們發現,“網購”的持有人作物似乎是“專為傾倒而設計的”,並且使用壽命不會太長。 這給您帶來了不便更換的麻煩。 因此,我們建議您花費時間和精力來獲得至少一年的保修。

A Lens (Optional)

鏡頭(可選)

This may be totally overkill for almost everyone, but just in case you’re into it and you haven’t heard about it, there are lenses for camera phones that can widen the “angle of view”. You would want one of these because it would make more of the road visible in the video, which may be crucial if something is happening outside of the dead ahead center. A set/kit of these goes for $5.50 on eBay.

對於幾乎每個人來說,這可能完全是矯kill過正,但萬一您沉迷其中而又從未聽說過,那可用於照相手機的鏡頭可以擴大“視角”。 您可能要選擇其中之一,因為這樣會使視訊中的道路更加清晰可見,如果在死角中心之外發生了某些事情,這可能至關重要。 這些套件/套件在eBay上售價為$ 5.50。

3in1-Small-font-b-Macro-b-font-Wide-Angle-Fisheye-Camera-digital-Detachable-font-b-Lens

Personally, I use a 180 degree lens (fisheye) for the road, because I like the 160 degree one for regular shooting:

就個人而言,我在道路上使用180度鏡頭(魚眼鏡頭),因為我喜歡在常規拍攝中使用160度鏡頭:

Tasker配置檔案和任務 (The Tasker profiles and tasks)

To make this all happen, you need some Tasker magic. You can either import our simple project or advanced project, or follow the instructions below to create everything from scratch.

為了實現這一切,您需要一些Tasker魔術。 您可以匯入我們的簡單專案高階專案,也可以按照以下說明從頭開始建立所有內容。

The simple project includes all of the below explained profiles and tasks. The advance one adds A) a profile that sets the “Media” and “BT” volumes to the maximum; B) a delay after a phone call has happened before the video recording is resumed; C) the ability to create a toggle widget; and D) severs the connection between the BT toggler and the VideoReg profile, so that you can have a “car mode” profile, because maybe you want the BT connected and have the phone do other “car mode” stuff that is not VideoReg related.

這個簡單的專案包括以下所有已解釋的概要檔案和任務。 進階選項增加了A)一個配置檔案,該配置檔案將“媒體”和“ BT”音量設定為最大; B)電話通話後的延遲才恢復視訊錄製; C)建立切換小部件的能力; 和D)切斷BT切換器和VideoReg配置檔案之間的連線,以便您可以擁有“車載模式”配置檔案,因為也許您想連線BT並讓電話執行與VideoReg不相關的其他“車載模式”工作。

Manual way

手動方式

We need to create a profile that would be the “start/stop recording” on car mode and another that (unless you’re the type of person that simply leaves the BT device running) would trigger the BT device.

我們需要建立一個配置檔案,該配置檔案將是汽車模式下的“開始/停止記錄”,另一個配置檔案(除非您是隻讓BT裝置保持執行狀態的人)會觸發BT裝置。

The V4C profile

V4C配置檔案

To get you started, we will walk you through adding the “BT state” to the profile; you can add more triggers to it on your own.

為使您入門,我們將引導您將“ BT狀態”新增到配置檔案中。 您可以自己新增更多觸發器。

Add a “State”.

新增一個“狀態”。

Tasker01

Select the “Net” category.

選擇“網路”類別。

Tasker02

Select the “Bluetooth Connected” sub category.

選擇“ Bluetooth Connected”子類別。

Tasker03

When asked for the name of the BT connection, make sure that BT is enabled on your device and click on the search icon. Then select the relevant BT connection name for the car’s BT system.

當詢問您BT連線的名稱時,請確保您的裝置上已啟用BT,然後單擊搜尋圖示。 然後為汽車的BT系統選擇相關的BT連線名稱。

Tasker04

Optionally, also select the MAC of the device, so that if another BT device with the same name, goes near you, the profile won’t be triggered.

(可選)還選擇裝置的MAC,這樣,如果另一個同名的BT裝置靠近您,則不會觸發配置檔案。

Tasker05

The end result should look like this:

最終結果應如下所示:

Tasker06

Here, we have changed the default name to be “v4c” (which stands for VideoReg For Car) so it would be shorter in the status bar. We have also added that the profile can only be triggered if there is more than 6% of battery power, so in extreme cases, the phone would not try to kill it self by triggering its most hungry of power hogs.

在這裡,我們將預設名稱更改為“ v4c”(代表VideoReg For Car),因此狀態列中的名稱會更短。 我們還補充說,只有在電池電量超過6%的情況下才能觸發配置檔案,因此在極端情況下,手機不會嘗試通過觸發其最餓的耗電量來殺死自己。

In addition (though this is optional), we have also made it so if a call is in progress, the profile will be disabled. This is because sometimes the way the camera is restarted while there is a phone call in progress is less than ideal and is disruptive to both ends of the call.

另外(儘管這是可選的),但我們也做到了,因此,如果正在進行通話,則將禁用該配置檔案。 這是因為有時在通話過程中重新啟動相機的方式不太理想,並且會打斷通話的兩端。

When asked to create/select the entering task, create one and select the “Misc” category.

當要求建立/選擇輸入任務時,建立一個並選擇“其他”類別。

Tasker07

Select the “Send Intent” action.

選擇“傳送意圖”操作。

Tasker08

In the “Action” text field, put in “rubberbigpepper.VideoReg.StartRecord” (without quotation).

在“操作”文字欄位中,輸入“ rubberbigpepper.VideoReg.StartRecord”(不帶引號)。

Tasker09

Then create an “Exit” task that does the same, only has “rubberbigpepper.VideoReg.StopRecord” in the “Action” field.

然後建立一個執行相同操作的“退出”任務,在“操作”欄位中僅包含“ rubberbigpepper.VideoReg.StopRecord”。

The BT trigger profile (semi-optional)

BT觸發配置檔案(半可選)

This may be unnecessary if you never turn your BT off, but as most of the people we know do, here is how to create a BT toggler that would:

如果您從不關閉BT,這可能是不必要的,但是正如我們所認識的大多數人一樣,這是建立BT切換器的方法,該切換器將:

  • Turn the BT device on if the android system is connected to a power source.

    如果android系統已連線到電源,請開啟BT裝置。
  • Wait for 15 seconds to give the pairing time to take place.

    等待15秒鐘,以便進行配對。
  • If there was a pairing, leave the BT device on, and if not, turn it off.

    如果存在配對,請保持BT裝置處於開啟狀態,否則,請將其關閉。

Add a “State”.

新增一個“狀態”。

Tasker01

Select the “Power” category.

選擇“電源”類別。

Tasker10

Select the “Power” option.

選擇“電源”選項。

Tasker11

Select the “Any” type.

選擇“任何”型別。

Tasker17

The “Save on 3” Profile (optional)

“儲存到3”配置檔案(可選)

This profile was created because in VideoReg you can only choose one action for the proximity sensor. But what if you wanted to both save a photo and a video?

建立此配置檔案的原因是,在VideoReg中,您只能為接近感測器選擇一個動作。 但是,如果您想同時儲存照片視訊怎麼辦?

To answer this question, I’ve set VideoReg to take a photo on proximity trigger, and have Tasker issue a “save video” if the proximity trigger is on for 3 seconds.

為了回答這個問題,我將VideoReg設定為在接近觸發器上拍照,如果接近觸發器開啟3秒鐘,則讓Tasker發出“儲存視訊”。

To create this profile, add a state and then select the “Sensor” category.

要建立此配置檔案,請新增狀態,然後選擇“感測器”類別。

Tasker18

Select the “Proximity Sensor”.

選擇“接近感測器”。

Tasker19

Leave the settings as they are, and continue to create the “Task”.

保持設定不變,然後繼續建立“任務”。

Tasker20

The “Task” should start with a 3 second “wait” and then send an “intent” of “rubberbigpepper.VideoReg.RescueVideo”.

“任務”應以3秒鐘的“等待”開始,然後傳送“意圖”“ rubberbigpepper.VideoReg.RescueVideo”。

Tasker21

Then scroll down to the end of the “Intent” action and add the “IF” condition that this is only to be triggered if the “profile” of “Save at 3” is still active.

然後向下滾動到“ Intent”操作的末尾,並新增“ IF”條件,該條件僅在“ Save at 3”的“ profile”仍處於活動狀態時才被觸發。

Tasker22

The end result should look like:

最終結果應如下所示:

Tasker23

That’s it, you should be all set to connect your device to the car’s power, have it trigger the BT to look for pairing, and once it’s paired to start the road recording.

就是這樣,您應該已經準備就緒,可以將裝置連線到汽車的電源,讓它觸發BT查詢配對,並在配對後開始道路記錄。

In case you’ve missed them, here are the HTG simple profile and HTG advance profile.

如果您錯過了它們,這裡是HTG簡單個人資料HTG高階個人資料



Its a very rare person, someone who’s mistaken for what he truly is…

這是一個非常罕見的人,有人誤會了他的真實身份……

翻譯自: https://www.howtogeek.com/164192/how-to-use-your-android-device-as-a-road-recorder-with-tasker-automation/

tasker