flingo64 / PhotoStation-Upload-Lr-Plugin

Photo StatLr (aka PhotoStation Upload) is a Lightroom Publish and Export Service Plugin that enables the export /publishing of photos and videos from Lr to a Synology Photo Station. It uploads the photos/videos and all required thumbnails. It can download comments and ratings and do a real two-way synch of various metadata (tags, ratings, labels).
http://messmer-online.de/index.php/software/11-photo-statlr
GNU General Public License v3.0
209 stars 21 forks source link

Synology Photos supports videos in .mov and h265 - no conversion necessary #82

Open stepman0 opened 2 months ago

stepman0 commented 2 months ago

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?

flingo64 commented 2 months ago

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:

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"