Select to view content in your preferred language

Reduce video files with iOS shortcuts

908
0
04-15-2024 05:51 AM
JoshuaClifford1
Esri Contributor
4 0 908

If you’re using an iOS device to collect data with ArcGIS Field Maps, you may run into an error when attaching large video files to the form. To avoid this problem, you can set up an iOS shortcut to reduce the file size of your video.  

Shortcuts on iOS trigger a series of actions that are used to complete a task, such as reducing a video. After creating the shortcut, you can access it from the home screen of your device and from the Share Sheet in iOS, which can be helpful for exporting videos from other apps (e.g., Go Pro’s QUIKC app). 

JoshuaClifford1_0-1712934301392.png

Shortcut on home screen and Share Sheet

In this step-by-step tutorial, you’ll learn how to create a shortcut that reduces the file size of a video and saves it as a new item on your device. We’ve published a public version of this shortcut if you’d like to use it as you follow along.  

Note: The screenshots for this post were taken using an iPhone. If you’re using an iPad, the screens will look different. 

Step 1—Tap on the Shortcuts app on your device’s home screen. 

JoshuaClifford1_1-1712934462941.png

Alt text: Shortcuts app

Step 2Once you’re in the app, tap the Add  button to start creating a new shortcut. 

JoshuaClifford1_4-1712934601344.png

Alt text: Add button

A builder appears where you can configure and create your shortcut. 

JoshuaClifford1_5-1712934822213.png

New shortcut 

Step 3Change the title of the shortcut by tapping the drop-down menu next to New Shortcut and then tapping Rename. Rename the shortcut to something easily identifiable, such as Reduce Video. 

JoshuaClifford1_6-1712934935984.png

Rename shortcut

Step 4—Tap the Info icon at the bottom of the screen. 

Step 5—On the Details tab that appears, enable the Show in Share Sheet toggle button so the shortcut appears on the Share Sheet for other apps.

JoshuaClifford1_7-1712935047828.png

Shortcut details

Step 6—Tap Add to home Screen. 

Here, you can customize how the shortcut appears on the home screen.

JoshuaClifford1_8-1712935178001.png

Customize shortcut appearance

Step 7—Return to the Shortcuts app. 

Now, you’ll add a series of actions that, when triggered, will reduce the file size of a video. The actions will account for two scenarios: 

  • Reducing file size when the shortcut is tapped on the share sheet 
  • Reducing file size when the shortcut is tapped on the home screen 

The first action is added by default since you enabled the Show in Share Sheet toggle button. 

JoshuaClifford1_9-1712935276521.png

Default Share Sheet action

Step 8—Tap Images and 18 more and tap Clear to unselect every option. Then enable the Media toggle button. 

JoshuaClifford1_10-1712935429048.png

Unselect everything but Media

This ensures the shortcut will only appear in the Share Sheet when media is being shared (such as videos). 

Step 9—In the Search bar, search for and add an If statement to the shortcut.

JoshuaClifford1_11-1712935581272.png

Add If statement to the shortcut

Step 10—Define the If statement as follows: 

  • In the If box, tap Condition and select has any value. 
  • Underneath the If box, search for and add the Get Item from List action, then drag it below the If box. Tap List on the action and select Shortcut Input. 
  • Underneath the Otherwise box, search for and add the Select photos action, then drag it below the Otherwise box. Next to Include, tap All and select Videos. 

Before the shortcut reduces the video size, it will use this statement to determine whether the video is coming from a file’s share sheet, or if the user is selecting a video after tapping the shortcut on the home screen (and then prompts the user to select a video). The statement should look like the following image: 

JoshuaClifford1_12-1712935697128.png

Alt text: Completed If statement

Step 11—Search for and add the Encode Media action. 

Select Media and select If Result (which I’ve renamed to Selected Video), so the shortcut encodes the video selected by the user.

JoshuaClifford1_13-1712935754227.png

Encode Selected Video

Step 12—Next to Size, tap Passthrough and select Ask Each Time so users are prompted to select the new size of the video each item they use the shortcut. 

JoshuaClifford1_14-1712936179733.png

Ask for size each time

Once configured, the Encode action should look like the following:

JoshuaClifford1_15-1712936250694.png

Configured Encode action

Step 13—Search for and add the Save to Photo Album action and change the action’s Input to Encoded Media. 

Step 14—Search for and add the Photos Open Collection action and change Collection to Recents. 

The final two actions will save the reduced video file to your recents album and then open that album to the file’s location. 

JoshuaClifford1_16-1712936333844.png

Save and open the video

Step 15—Review your shortcut. 

Review the shortcut to make sure your actions are configured properly. We've published a complete version of the shortcut you can use as reference (must be opened on an iOS device). 

Step 16—Test your shortcut. 

Once you’ve reviewed the shortcut, give it a try! Tap the Reduce Video shortcut from the home screen or share sheet, select the file size to reduce it to, and view the result in your recents photo album.