Welcome DJI Spark Pilot!
Jump in and join our free Spark community today!
Sign up

Can you please share best practices handling these video files?

forczekattila

Member
Join
Nov 14, 2017
Messages
9
Age
47
I am still just learning to fly and video with my Spark, but I already see how challenging it will be to manage these many files of cache (with the voice), original videos and photos.

My current method feels not right, it is too troublesome. When I finish flying, I usually go home, charge batteries, because I need the batteries also for turning on the drone, for fetching the original video files to my Android phone. I can use the tools provided by DJI Go 4 app, to edit and share these videos. Download of files is slow and unstable, need to start it again and again. But if I copy the files from the SD card to my PC, there I only have the original video without a sound or a reference to the cached file. I like the simple video editing tool built into the DJI Go 4 App, but getting the files to be able to edit them is not convenient. And the big files bring the other challenge of freeing up storage space on both my phone on the SD card of the drone.

I would think to the good solution as an automatic process, connecting to my home WiFi, load and match all my file to the shared folder on my NAS, maybe do some preprocessing like match the audio with the corresponding video, and name the files with a pattern from date and time, mark the files with relevant metadata like time, GPS, settings. Having a nice backup of the files to some cloud storage would be an extra.

Please share your experience or links to good tutorials about this topic.
 
Take spark card out, plug into reader on PC, copy, done. If cache is desired connect phone to PC and copy cache.
 
Thanks for your reply Kilrah, but it still sounds very manual, and needs a lot further processing. Also, over time, organising these files will need additional manual work. I was looking for something more automated.
 
Let me give an update, maybe someone is interested:
- Auto sync cached video (which includes the audio) with Android app called FolderSync, which can be set up to be scheduled, and triggered by my home WiFi, and phone being plugged to the charger. So it can move files to the shared folder on my NAS.
- On the desktop (Win 10), I can do the same with SyncToy, when plugging in the SD card of DonGo (name of my Spark) for moving the hi-res videos.
- On the NAS I can run batch for merging the audio and the video.
Here is a sample line of code:
ffmpeg -i DJI_0040.MP4 -itsoffset 1.0 -i 2017_11_22_19_36_35.mp4 -c:v copy -c:a aac -strict experimental DJI_0040_Audio.MP4

Challenges I am still facing:
- The audio and the video is not in sync from the starting of the file, and the delay is not consistent. (In the above example it is 1 sec)
- Matching the two video files from a batch is not easy. Usually the timestamp of the files match, but not always. There is an info file besides the cache video giving the file ID, but need more coding to fit this logic into the ffmpeg script.

Hope this may give some ideas, and feel free to add yours.
 
Looks like nobody listens, but anyway, here I share my result with the community:
The below script does the job. It is renaming to datetime, merging audio and video, makes an audio-only file, and a downsized version for sharing.
So I can save it in a process.bat file, and schedule it on my NAS to work on this nightly.
I am happy with the result, let me know if you like it.

FOR /R "N:\DonGo\100MEDIA\" %%Z IN (*.MP4) DO @( FOR /F "Tokens=1-6 delims=:-\/. " %%A IN ("%%~tZ") DO @(
copy "%%~dpnxZ" "N:\DonGo\Processing\%%~A%%~B%%~C_%%~D%%~E_Original.mp4"
move "%%~dpnxZ" "N:\DonGo\Processed"
))
FOR /R "N:\DonGo\DJI_RECORD\" %%Z IN (*.MP4) DO @( FOR /F "Tokens=1-6 delims=:-\/. " %%A IN ("%%~tZ") DO @(
copy "%%~dpnxZ" "N:\DonGo\Processing\%%~A%%~B%%~C_%%~D%%~E_Cache.mp4"
move "%%~dpnxZ" "N:\DonGo\Processed"
))
FOR /R "N:\DonGo\Processing\" %%Z IN (*_Original.MP4) DO @( FOR /F "Tokens=1-6 delims=:-\/. " %%A IN ("%%~tZ") DO @(
N:\DonGo\ffmpeg -i "N:\DonGo\Processing\%%~A%%~B%%~C_%%~D%%~E_Original.mp4" -itsoffset 1.0 -i "N:\DonGo\Processing\%%~A%%~B%%~C_%%~D%%~E_Cache.mp4" -c:v copy -c:a aac -strict experimental "N:\DonGo\Processing\%%~A%%~B%%~C_%%~D%%~E_AV1080.mp4"
N:\DonGo\ffmpeg -i "N:\DonGo\Processing\%%~A%%~B%%~C_%%~D%%~E_Cache.mp4" -vn -ar 44100 -ac 2 -ab 192k -f mp3 "N:\DonGo\Processing\%%~A%%~B%%~C_%%~D%%~E_Audio.mp3"
N:\DonGo\ffmpeg -i "N:\DonGo\Processing\%%~A%%~B%%~C_%%~D%%~E_AV1080.mp4" -vf scale=1280:720 "N:\DonGo\Processing\%%~A%%~B%%~C_%%~D%%~E_AV720.mp4"
move "N:\DonGo\Processing\%%~A%%~B%%~C_%%~D%%~E_Original.mp4" "N:\DonGo\Processed"
move "N:\DonGo\Processing\%%~A%%~B%%~C_%%~D%%~E_Cache.mp4" "N:\DonGo\Processed"
move "N:\DonGo\Processing\%%~A%%~B%%~C_%%~D%%~E_AV1080.mp4" "N:\DonGo\Processed"
move "N:\DonGo\Processing\%%~A%%~B%%~C_%%~D%%~E_AV720.mp4" "N:\DonGo\Processed"
move "N:\DonGo\Processing\%%~A%%~B%%~C_%%~D%%~E_Audio.mp3" "N:\DonGo\Processed"
))
 
Hey man, thanks a lot for sharing this! It’s the closest I’ve ever seen to a question that’s been on my mind for a while. I usually download and organize manually from the card and the phone, and no, it’s not the simplest setup.

Now I have to figure out a way to integrate your solution to my setup. You see, I have a Mac, and no NAS (although I can easily attach a drive to my AirPort Extreme, which makes it somewhat NAS-like...)

But most importantly I’d be happy just being able to easily sync the audio from the file with the video from the SD. I’m baffled by there having no official way, and the fact it’s not really discussed much apparently. Before DJIGO recorded audio (on my Mavic Pro), I briefly recorded it with an audio app, then synced it on FCPX manually afterwards. The audio file was longer, and I’d sync the beep with the beginning of the video file and normally that’d work. Now that I don’t do a separate recording and that the files from my Spark have different lengths on the phone and on the SD card, I’m even more confused! Even if I sync image to image, it falls out of sync right away. I might be able to fix it by changing the Mbps setting of the timeline, yet I still haven’t found the appropriate setting.

Does this script above find the sync point? And if so, how?

Also I have boot camp on my Mac with windows 10, maybe I could try your script there (Where do you run scripts on a PC?)

In any case thanks a lot for sharing your results and solution, even when no one seemed to be following at the time!
 
Hey man, thanks a lot for sharing this! It’s the closest I’ve ever seen to a question that’s been on my mind for a while. I usually download and organize manually from the card and the phone, and no, it’s not the simplest setup.

Now I have to figure out a way to integrate your solution to my setup. You see, I have a Mac, and no NAS (although I can easily attach a drive to my AirPort Extreme, which makes it somewhat NAS-like...)

But most importantly I’d be happy just being able to easily sync the audio from the file with the video from the SD. I’m baffled by there having no official way, and the fact it’s not really discussed much apparently. Before DJIGO recorded audio (on my Mavic Pro), I briefly recorded it with an audio app, then synced it on FCPX manually afterwards. The audio file was longer, and I’d sync the beep with the beginning of the video file and normally that’d work. Now that I don’t do a separate recording and that the files from my Spark have different lengths on the phone and on the SD card, I’m even more confused! Even if I sync image to image, it falls out of sync right away. I might be able to fix it by changing the Mbps setting of the timeline, yet I still haven’t found the appropriate setting.

Does this script above find the sync point? And if so, how?

Also I have boot camp on my Mac with windows 10, maybe I could try your script there (Where do you run scripts on a PC?)

In any case thanks a lot for sharing your results and solution, even when no one seemed to be following at the time!
Hi CamNYC,
For me, the script is simply matching the audio, I did not recognize timing difference on the DJI Go-recorded cache file (which includes the audio) with the fHD video recorded in the drone SD card.
Yes, I run it on a Win 10 PC, so mine is also not a real NAS, I just use its file share.
Actually, after having my script in place since a few months, I just forgot about it, but it does the job. My only lesson learned, is that the audio I record is very rarely usable. It is noisy from the rotors, or wind, etc. So in most cases I just edit the results and add music under it.

I am happy to hear my writing gave you some ideas.
 

Members online

No members online now.

Forum statistics

Threads
14,593
Messages
118,799
Members
17,987
Latest member
csdisme