PhotoStation-Upload-Lr-Plugin
PhotoStation-Upload-Lr-Plugin copied to clipboard
Synology Photos supports videos in .mov and h265 - no conversion necessary
I just figured out that Synology Photos supports both .MOV (with H265 from iPhone) and .mp4 with h265 codec. So the conversion on upload is not necessary anymore.
Having a look into the code, it seems that either this code in PSUploadTask.lua should be adopted (starting in line 252):
-- replace original video if:
-- - srcVideo is to be rotated (meta or hard)
-- - srcVideo is mp4, but not h264 (PS would try to open, but does only support h264)
-- - srcVideo is mp4, but has no audio stream (PS would ignore it)
-- - exportParams.orgVideoForceConv was set
if tonumber(vinfo.rotation) > 0
or tonumber(vinfo.mrotation) > 0
or (converter.videoIsNativePSFormat(vidExtOrg) and vinfo.vformat ~= 'h264')
or vinfo.aFormat == nil
or orgVideoForceConv then
videoSettings.replaceOrgVideo = true
videoSettings.Orig_Filename = videoSettings.Replace_Filename
else
videoSettings.replaceOrgVideo = false
videoSettings.Orig_Filename = videoPath
end
If backward compatiblity is wanted, either an additional option for orgVideoForceConv (the dropdown configuration box) saying no conversion or an explicit version check is possible (But I have no details on which version supports what ;-))
For the first way, I can try to create a pull request - but what is your favorite?
Thanks for this hint! The current implementation does not allow to define the list of supported Containers/Extensions and VideoCodecs based on the target photo server version. I'm currently modifiying this, so that supported extensions and VideoCodecs will be configurable in the code (PSPhotoServer.lua) per photo server version. That way, we don't need any new config flag in the UI and we can keep it backward compatible for Photo Station users (if there are any left at all). For Photo Station it will be as before:
- Containers/Extensions: mp4 and m4v
- VideoCodecs: h264
For Photos I did some check with a bunch of different Video files. This is my list what at least is natively supported by Photos (begining w/ v1.0):
- Containers/Extensions:
'3gp''avi''m4v''mp4''mpg''mov''mts' - VideoCodecs (as reported by ffmpeg v4.x):
'h263''h264''hevc''mpeg1vide''mpeg4''mjpeg''rawvideo'
H.265 Videos are reported as 'hevc', at least my Android videos using ffmpeg 4.x. Could you please verify this by simply exporting some videos with Photo StatLr and check what is reported in the logfile as "vformat" within the vinfo object, e.g.:
16:57:05, TRACE: "vformat":"hevc"
The issue is fixed in v7.4.1