Help to convert DJI Mavic Air video to a supported format

Server Version#: 1.32.6.7557
Player Version#: 10.2.0.448 (83522c5)

Hi - I have a bunch of videos from my drone (a DJI Mavic Air). They’re 4k and have a high bit-rate. I’ve got a Sony KD65A8H tv which runs Android TV. It’s on a wired 100Mbit connection, so I understand the bit-rate may be too high. When I try to watch any of these videos, the spinner just sits there and nothing loads, I try to tell it to convert for me, but still nothing happens. If I open the Plex app on my phone and cast it to the tv, it will play, but it buffers and pauses a lot.

So - I’d like to convert it to something that my TV and bandwidth can handle. I’ve tried letting Plex optimize it, but I have the same issue, it just won’t play. I’ve manually converted the files using ffmpeg, kept them as H264 but moved them from the .MOV container to .mp4, whether I keep it the same size, or halve the size (and bitrate) I just get the same issue, it won’t play at all.

This is the output from ffprobe for my converted file (-crf=28):

codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1001/48000
codec_tag_string=avc1
codec_tag=0x31637661
width=4096
height=2160
coded_width=4096
coded_height=2160
has_b_frames=2
sample_aspect_ratio=1:1
display_aspect_ratio=256:135
pix_fmt=yuv420p
level=51
color_range=unknown
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=left
field_order=unknown
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=24000/1001
avg_frame_rate=24000/1001
time_base=1/24000
start_pts=0
start_time=0.000000
duration_ts=2137135
duration=89.047292
bit_rate=19546914
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=2135
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:language=eng
TAG:handler_name=DJI.AVC

and here is the output for the original file:

codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1001/48000
codec_tag_string=avc1
codec_tag=0x31637661
width=4096
height=2160
coded_width=4096
coded_height=2160
has_b_frames=1
sample_aspect_ratio=1:1
display_aspect_ratio=256:135
pix_fmt=yuv420p
level=51
color_range=tv
color_space=bt709
color_transfer=bt709
color_primaries=bt709
chroma_location=left
field_order=unknown
timecode=N/A
refs=1
is_avc=true
nal_length_size=4
id=N/A
r_frame_rate=24000/1001
avg_frame_rate=24000/1001
time_base=1/24000
start_pts=0
start_time=0.000000
duration_ts=6960954
duration=290.039750
bit_rate=59954543
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=6954
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
TAG:creation_time=2022-01-16T17:02:14.000000Z
TAG:language=eng
TAG:handler_name=DJI.AVC
TAG:encoder=Dji AVC encoder

Any help or advice would be greatly appreciated.

First question I’d ask is have you verified that the videos play on your computer?
I generally use VLC player as that pretty much plays anything I throw at it.

That said, I’m not really a video encoding guru, but you can try using Handbrake to re-encode the video and see if you get a different result as compared to using ffmpeg straight up (Handbrake is essentially a GUI frontend). Figure it wouldn’t hurt to try.

The other thing I am thinking is to look at the Plex logs from the server.
Here is a link on how to get the logs in case you are not aware:
https://support.plex.tv/articles/200250417-plex-media-server-log-files/

Also, make sure DEBUG is set and not VERBOSE as that will provide too much information and is only required if a Plex employee explicitly asks for it. Maybe there is something in the logs that will give a hint as to why the files are not playing.

I would suggest looking at the “Plex Media Server.log” files.
You could upload them here, but some people do not feel comfortable posting them to the forum where anyone with an account can access them.
If you aren’t comfortable posting, you can wait for a Plex team member to step in and ask them if you can PM them the files. A forum member might also being will to have you PM them to look at. You can send them to me if you want, but I cannot guarantee that I would be able to find anything, but I would be willing to take a look.

-Shark2k

I’ve never had a Chinese video gadget that used a normal codec… Even when it’s something standard like h.264 they always change something to make actually using the footage a PITA.

Thanks very much - I had briefly had a look at the server logs in the past, but it seems the request doesn’t reach the server.

So instead I have just enabled the client side logging and you can see an error occurring. The video is called “Test_Video_CRF_28”. I’m not sure why it’s failing on “[MediaDecisionLoadable] Exception while determining media decision”, hopefully some smart person can help!

10-27 14:06:12.415  i: [MediaDecisionEngine] Starting media decision for: Test_Video_CRF_28 (part index 0)
10-27 14:06:12.415  i: [MediaDecisionEngine] Transcode server selected: My Media
10-27 14:06:12.415  i: [MediaDecisionEngine] Analyzing media: 4096x2160 19549kbps (Container: mp4, Video: h264, Audio: None)
10-27 14:06:12.424  i: [video] User maximum h264 profile determined: 52
10-27 14:06:12.424  i: [video] Device recommended h264 profile determined: 52
10-27 14:06:12.484  i: [CurrentItemMetadataBehaviour] Fetched current item, success: true
10-27 14:06:12.497  e: [MediaDecisionLoadable] Exception while determining media decision
10-27 14:06:12.499  e: [ExoPlayer][LoadTask] Unexpected exception loading stream
  java.lang.NullPointerException: Attempt to invoke virtual method 'int com.plexapp.plex.net.t1.v0(java.lang.String)' on a null object reference
      at com.plexapp.plex.net.i1.x(SourceFile:33)
      at com.plexapp.plex.net.i1.D(Unknown Source:0)
      at com.plexapp.plex.net.i1.c(Unknown Source:0)
      at com.plexapp.plex.net.g1.a(Unknown Source:10)
      at com.plexapp.plex.utilities.m0.n(SourceFile:20)
      at com.plexapp.plex.net.i1.i(SourceFile:40)
      at com.plexapp.plex.net.i1.h(SourceFile:31)
      at com.plexapp.plex.net.i1.s(SourceFile:11)
      at com.plexapp.plex.net.i1.w(SourceFile:373)
      at com.plexapp.plex.net.i1.J(SourceFile:17)
      at qn.e.p(SourceFile:58)
      at qn.e.s(SourceFile:169)
      at eh.r.load(SourceFile:23)
      at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(SourceFile:52)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
      at java.lang.Thread.run(Thread.java:764)

10-27 14:06:12.499  e: An exception occurred: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.plexapp.plex.net.t1.v0(java.lang.String)' on a null object reference
10-27 14:06:12.500  e: Stacktrace: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.plexapp.plex.net.t1.v0(java.lang.String)' on a null object reference
	at com.plexapp.plex.net.i1.x(SourceFile:33)
	at com.plexapp.plex.net.i1.D(Unknown Source:0)
	at com.plexapp.plex.net.i1.c(Unknown Source:0)
	at com.plexapp.plex.net.g1.a(Unknown Source:10)
	at com.plexapp.plex.utilities.m0.n(SourceFile:20)
	at com.plexapp.plex.net.i1.i(SourceFile:40)
	at com.plexapp.plex.net.i1.h(SourceFile:31)
	at com.plexapp.plex.net.i1.s(SourceFile:11)
	at com.plexapp.plex.net.i1.w(SourceFile:373)
	at com.plexapp.plex.net.i1.J(SourceFile:17)
	at qn.e.p(SourceFile:58)
	at qn.e.s(SourceFile:169)
	at eh.r.load(SourceFile:23)
	at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(SourceFile:52)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
	at java.lang.Thread.run(Thread.java:764)

10-27 14:06:12.501  i: Creating PlayerActivity.
10-27 14:06:12.501  i: [Activity] Resuming the application, attempting to download item and children.
10-27 14:06:12.504  i: [Boot] PlayerActivity took 3ms to run create behaviours.
10-27 14:06:12.525  i: Resuming PlayerActivity.
10-27 14:06:12.535  i: [PlayerActivity] Creating fragment
10-27 14:06:12.548  i: [Player][DimensionsLayout] Resizing: 100 x 100
10-27 14:06:12.563  i: [DisplayBehaviour] Activity has been changed, searching for available modes.
10-27 14:06:12.568  i: [DisplayBehaviour] Current Mode ID: 1 / {id=1, width=1920, height=1080, fps=60.000004}
10-27 14:06:12.569  i: [DisplayBehaviour] Current mode detected as 1920x1080 @ 60.0000Hz (1).
10-27 14:06:12.572  i: [PictureInPictureBehaviour] Picture-in-picture is available and can be used.
10-27 14:06:12.575  i: [VideoAwakeBehaviour] Keep screen awake has been requested disabled for VideoAwakeBehaviour.
10-27 14:06:12.671  i: [PictureInPictureBehaviour] Picture-in-picture is available and can be used.
10-27 14:06:12.673  i: [PictureInPictureBehaviour] Picture-in-picture is available and can be used.
10-27 14:06:12.683  i: [PictureInPictureBehaviour] Picture-in-picture is available and can be used.
10-27 14:06:12.692  i: [ChaptersSheetHud] Found 0 chapters.
10-27 14:06:12.707  i: [MenuSheetHud] Item changed (and fetched), invalidating settings...
10-27 14:06:12.844  i: [Player][View] Layout has been measured with a size of 1920 x 1080 (1920 x 1080).
10-27 14:06:12.845  i: [Player][DimensionsLayout] Resizing: 1920 x 1012
10-27 14:06:12.875  i: [ExoPlayer][EventLogger] surfaceSize [eventTime=0.60, mediaPos=0.00, window=0, period=0, 1920, 1012]
10-27 14:06:12.891  i: [ASS][Renderer] Surface has been created, connecting to renderer.
10-27 14:06:12.896  i: [ASS][Renderer] Attempting to start renderer from setSurface.
10-27 14:06:12.897  w: [ASS][Renderer] Missing video size, can't start renderer yet.
10-27 14:06:12.904  i: [SystemUIBehaviour] Hiding the system user-interface.
10-27 14:06:58.622  i: [HttpServer] /192.168.1.100:64544 - GET /logging

I never even realised it was Chinese until you mentioned it. It plays fine on my computer, and in the web player and on my mobile phone Plex client - just no joy on the Sony Bravia plex client.

That error is interesting. It looks like Plex thought the video could be direct played, but it didn’t work on the hardware.

You can try forcing a lower quality stream at playback time.

You can try Optimize in the Plex Web UI to have Plex create another version in advance, and then choose that version at playback time.

If you want to convert the video manually in advance, try Handbrake.

Don’t use H.264/AVC for either 4K or 60fps video. It’s very poorly supported by hardware playback devices.

This should be basically universally playable:
H.264/AVC, 1920x1080, 30fps, Main Profile (High should also be safe)
Try CRF20 for very high quality, or CRF24 for OK-and-smaller

For 4K or for 60fps, use H.265/HEVC:
H.265/HEVC, 4k, Main Profile, 30fps - any 4k device
H.265/HEVC, 4k, Main Profile, 60fps - devices with 4k+60fps support
Try CRF24 for very high quality, or CRF28 for OK-and-smaller

The Presets (Veryfast/Medium/Veryslow etc) don’t directly control quality, they control how “clever” the codec can be. Being clever results in smaller files, but also takes looonger. Test with ultrafast or veryfast to make sure it plays; change to medium or slow if you don’t mind the time and want smaller files.

2 Likes

Thank you very much. I’ll try doing an encode using those settings and see how I go. Much appreciated.

It looks like the newest/fanciest/best DJI models do support H.265 for encoding 4K. What a great excuse to upgrade …

You could also try recording in 1920x1080, maybe also 30fps. That might get you files that can be played back directly - but maybe not. As others have mentioned many of these “Action”-cam devices have strange dialects for their encoding.

I’ve actually sold the drone - but wanted to finally sort out why it was so damn difficult to watch the videos via Plex. I really appreciate the help though :slight_smile:

Ok so here’s what I tried:

.\ffmpeg.exe -i "input.mov" -c:v libx265 -preset veryfast -crf 23 -x265-params profile=main10 "output.mp4"

It’s created the file just fine, but I still have exactly the same issue. I just remember I did try to convert some of these using Tdarr a little while back, and had the same experience.

This was my attempt to configure it as:

H.265/HEVC, 4k, Main Profile, 30fps - any 4k device

The above log excerpt seems to suggest that the tv is only fullHD, not 4k.
So anything above that is probably not supported and needs to be transcoded by your Plex server.

It’s definitely a 4K TV. Here’s the tv details KD-65A8H Specifications | Sony AU.

Try to add a silent audio track. I’d go with 128 kbps stereo in AAC format.
It might just be that the TV is “surprised” by the lack of an audio track.

4 Likes

I’ve tried a couple of things to add a soundtrack, but I’m having trouble getting one added. Do you have any experience doing something like that?

EDIT: I managed to add a silent track - and YES, it seems to work! Thank you so much for pointing me in the right direction! I added it to one of the files I’d already converted to HEVC, I’m now going to see if I can just add it to the original videos, I’m guessing it will work.

EDIT2: Yep that works as well, and it’s much quicker, no re-encoding needed! Thanks so much for the suggestion.

FYI this is what I did (thanks to @OttoKerner for letting me know that 48000 is the best sample_rate). This copies the codec and the metadata (which for me, copied over the original recording date, which Plex picks up:

./ffmpeg.exe -i "input.mov" -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=48000 -c:v copy -shortest -map_metadata 0 "output.mp4"
1 Like

Always use a sample rate of 48000 for audio tracks in a video.

44100 only occurs in audio CDs and music streaming.

Considering this, you can bet that all those TVs and streaming boxes have never been tested thoroughly with videos which have audio tracks with 44100 sample rate. So glitches and weirdness can occur more likely. On top of that, the default sample rate on many devices is 48000 nowadays – sometimes even without the ability to change that. So the audio sample rate has to be converted during playback. And that in turn can again lead to sync issues or other weirdness.
So avoid it.

2 Likes

Clever, Otto. I wouldn’t have thought of that.

1 Like

My favorite kind of thread, an interesting solution to a weird problem.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.