LycheeOrg / Lychee

A great looking and easy-to-use photo-management-system you can run on your server, to manage and share photos.
https://lycheeorg.github.io/
MIT License
3.3k stars 295 forks source link

Video sort order #977

Closed pokemonbattledroid closed 2 months ago

pokemonbattledroid commented 3 years ago

Hi,

This is probably me, but I wanted to check.

All my photos appear to upload and sort correctly, but any mp4, whether it is from gopro, mobile or camera, it all seems to just be placed at the bottom or top (depending on ascending or descending taken date order)

Is there a way to go about this? On the mac when I see it in finder, and date modified - it all appears in the correct order.

Thank you!!

kamil4 commented 3 years ago

In general, you haven't provided us with enough information (diagnostics output would've been really handy in this case).

Judging by #978 though, you already figured out that you need ffmpeg for full video support in Lychee. It is needed both for extracting a static preview frame out of video files (to show you something more than an empty rectangle in album view) and for extracting the metadata out of the video files such as the creation date, which is what I'm guessing you are missing in your case.

pokemonbattledroid commented 3 years ago

Sorry, here's the diagnostics output

Diagnostics
    -------
    Warning: Dropbox import not working. dropbox_key is empty.
    Warning: You may experience problems when uploading a large amount of photos. Take a look in the FAQ for details.

    System Information
    --------------
    Lychee Version (release):        4.3.0
    DB Version:                      4.3.0

    composer install:                --no-dev
    APP_ENV:                         production
    APP_DEBUG:                       false

    System:                          Linux
    PHP Version:                     7.4
    Max uploaded file size:          100M
    Max post size:                   100M
    SQLite Version:                  3.7.17

    Imagick:                         1
    Imagick Active:                  1
    Imagick Version:                 1690
    GD Version:                      bundled (2.1.0 compatible)

    Config Information
    --------------
    version:                         040300
    check_for_updates:               0
    sorting_Photos_col:              takestamp
    sorting_Photos_order:            DESC
    sorting_Albums_col:              title
    sorting_Albums_order:            ASC
    imagick:                         1
    skip_duplicates:                 0
    small_max_width:                 0
    small_max_height:                360
    medium_max_width:                1920
    medium_max_height:               1080
    lang:                            en
    layout:                          1
    image_overlay_type:              date
    default_license:                 none
    compression_quality:             90
    full_photo:                      1
    delete_imported:                 0
    Mod_Frame:                       1
    Mod_Frame_refresh:               30
    thumb_2x:                        1
    small_2x:                        1
    medium_2x:                       1
    landing_page_enable:             0
    landing_owner:                   Go
    landing_title:                   Memories
    landing_subtitle:                with Friends and Family
    landing_facebook:                
    landing_flickr:                  
    landing_twitter:                 
    landing_instagram:               
    landing_youtube:                 
    landing_background:              
    site_title:                      Memories
    site_copyright_enable:           1
    site_copyright_begin:            2021
    site_copyright_end:              2021
    additional_footer_text:          
    display_social_in_gallery:       0
    public_search:                   0
    SL_enable:                       0
    SL_for_admin:                    0
    public_recent:                   0
    recent_age:                      1
    public_starred:                  0
    downloadable:                    0
    photos_wraparound:               1
    map_display:                     0
    zip64:                           1
    map_display_public:              0
    map_provider:                    Wikimedia
    force_32bit_ids:                 0
    map_include_subalbums:           0
    update_check_every_days:         3
    has_exiftool:                    0
    share_button_visible:            0
    import_via_symlink:              0
    has_ffmpeg:                      1
    location_decoding:               0
    location_decoding_timeout:       30
    location_show:                   0
    location_show_public:            0
    rss_enable:                      0
    rss_recent_days:                 7
    rss_max_items:                   100
    prefer_available_xmp_metadata:   0
    editor_enabled:                  1
    lossless_optimization:           0
    swipe_tolerance_x:               150
    swipe_tolerance_y:               250
    local_takestamp_video_formats:   .avi|.mov|.mp4
    log_max_num_line:                1000
    unlock_password_photos_with_url_param: 0
    nsfw_visible:                    0
    nsfw_blur:                       0
    nsfw_warning:                    0
    nsfw_warning_admin:              0
    map_display_direction:           1
    album_subtitle_type:             oldstyle
    upload_processing_limit:         4
    public_photos_hidden:            1
About
kamil4 commented 3 years ago

While I can't figure out the issue you are having with ffmpeg, you may want to try to get exiftool installed on your system. Exiftool can extract metadata such as creation time from many video files, so while it won't give you thumbnails for your videos, it should be able to solve the sort order issue.

Getting Lychee to find exiftool should be a little simpler than ffmpeg. You only need to modify one file, Lychee/vendor/lychee-org/php-exif/lib/PHPExif/Adapter/Exiftool.php, in the same way as for ffmpeg (the toolPath field). has_exiftool Lychee config needs to be reset to 1 as well.

You will know if it worked by inspecting the info sidebar for newly uploaded video files. If metadata extraction was successful, you will see additional data being displayed there, under Resolution, Duration, Frame rate, and Captured.

pokemonbattledroid commented 3 years ago

That doesn't seem to be working either. I've put the exiftool in the public folder as well and set the path... :(

Also, for some reason, the video plays back fine on a mobile, but on mac chrome, it's just audio and the video doesnt play..

ildyria commented 3 years ago

Also, for some reason, the video plays back fine on a mobile, but on mac chrome, it's just audio and the video doesnt play..

We do not convert anything nor touch the video. we use directly the html5 video solution, so that is not on our side for that one. :/

pokemonbattledroid commented 3 years ago

I'm not sure what exactly I did but was tinkering around and now it seems to be working. It's the full path, and I added something to the .env file too and changed some permissions.

pokemonbattledroid commented 3 years ago

Thank you for your continued efforts!!!!

kamil4 commented 3 years ago

So what works now, ffmpeg, exiftool? :smiley:

I second what @ildyria wrote, BTW. It's up to your web browser to display the video file, we just pass it the URL to the file that you uploaded, without any modifications to the content. In my experience the range of codecs supported by web browsers is very limited; e.g., right now h265 (hevc) tends not to work. I recommend to make sure that everything you upload is encoded with something mainstream like h264 and then you should be good.

pokemonbattledroid commented 3 years ago

Yep, it's h264...bizzare..

But I guess ffmpeg and exiftool are working, so that's great. Just now somehow the mp4's are showing a different capturedate to what I see when I check it on the mac terminal with exiftool command...

Never ending...but it's progress!

iamgo.net

On Wed, 28 Apr 2021 at 21:16, Kamil Iskra @.***> wrote:

So what works now, ffmpeg, exiftool? 😃

I second what @ildyria https://github.com/ildyria wrote, BTW. It's up to your web browser to display the video file, we just pass it the URL to the file that you uploaded, without any modifications to the content. In my experience the range of codecs supported by web browsers is very limited; e.g., right now h265 (hevc) tends not to work. I recommend to make sure that everything you upload is encoded with something mainstream like h264 and then you should be good.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/LycheeOrg/Lychee/issues/977#issuecomment-828748965, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK3U5OTDZKGCB67ZWD476DLTLBULDANCNFSM43XA6FWQ .

flossgeek commented 4 months ago

@gosugimoto Did you figure out what exactly was the culprit? I have the same problem: photos show their metadata but videos do not.

I have set the full path to both the ffmpeg and ffprobe binaries in app/Image/Handles/VideoHandler.php (which seems to work as the thumbnails show up). In public_html/vendor/lychee-org/php-exif/lib/PHPExif/Adapter/FFprobe.php I specified the path to the ffprobe binary as well, but it does not seem to make a difference.

I also manually downloaded an exiftool binary from https://github.com/pulsejet/exiftool-bin and set the path to that binary in public_html/vendor/lychee-org/php-exif/lib/PHPExif/Adapter/Exiftool.php. I've tried this with both the musl and glibc variant, but neither appears to work.

I'm a bit out of my depth here as I don't know what else could make a difference. But as you eventually got it to work, I hope you are able to share the knowledge that got you there (so I don't have to open a new issue).

pokemonbattledroid commented 3 months ago

sorry, i've since stopped using lychee so can't remember at all what this was about!! hope you find a solution!

iamgo.net

On Sat, 11 May 2024 at 09:40, flossgeek @.***> wrote:

@gosugimoto https://github.com/gosugimoto Did you figure out what exactly was the culprit? I have the same problem: photos show their metadata but videos do not.

I have set the full path to both the ffmpeg and ffprobe binaries in app/Image/Handles/VideoHandler.php (which seems to work as the thumbnails show up). In public_html/vendor/lychee-org/php-exif/lib/PHPExif/Adapter/FFprobe.php I specified the path to the ffprobe binary as well, but it does not seem to make a difference.

I also manually downloaded an exiftool binary from https://github.com/pulsejet/exiftool-bin and set the path to that binary in public_html/vendor/lychee-org/php-exif/lib/PHPExif/Adapter/Exiftool.php. I've tried this with both the musl and glibc variant, but neither appears to work.

I'm a bit out of my depth here as I don't know what else could make a difference. But as you eventually got it to work, I hope you are able to share the knowledge that got you there (so I don't have to open a new issue).

— Reply to this email directly, view it on GitHub https://github.com/LycheeOrg/Lychee/issues/977#issuecomment-2105636086, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK3U5OUPDSMN3UW3AFDH2Z3ZBXKP3AVCNFSM43XA6FW2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMJQGU3DGNRQHA3A . You are receiving this because you were mentioned.Message ID: @.***>