Announcement

  •  » Extensions
  •  » VideoJS: Video creation date not recognized

#1 2016-01-02 18:47:04

eMarcus
Member
2015-02-20
6

VideoJS: Video creation date not recognized

Hi,

I maintain an album with pictures and videos of my son. The album is sorted, so that the newest pics are shown first. But whenever I upload a video, the video is placed at the very end of the album because Piwigo/VideoJS does not recognize its creation date. I have to manually set the creation date using the Edit function of the web interface. Although this is a workaround, it is somehow cumbersome, especially when I add many videos at once.

Most of my videos are taken with a Canon IXUS 140. I then convert the .MOV file using ffmpeg to a .mp4

What I tried so far:

1.) add -metadata creation_time=<date> using ffmpeg
2.) add CreateTime, ModifyTime, MediaCreateTime, MediaModifyTime, TrackCreateTime, TrackModifyTime using exiftool

but nothing worked.

Any idea what I can do to add the Creation Date to the video, so it is correctly recognized by Piwigo/VideoJS?

Thanks,
Marcus.

Piwigo version: 2.7.4
PHP version: 5.3.10
MySQL version: 5.5.46

Offline

 

#2 2016-03-27 17:26:22

Jari
Guest

Re: VideoJS: Video creation date not recognized

I have the same problem. Could not get VideoJs plugin to get the date from the video file.

With exiftool you have to set the DateTimeOriginal so that Piwigo will use it. You can get exiftool to take that info from CreateDate. Some of my videos have DateTimeOriginal, but not all. It depends on the device I have used to record the videos. All of my videos have CreateDate.

What I have done is take a .jpg from the videos with avconv, take all exif data from the video with exiftool and put it in the jpg file. Then I update the exif data on the jpg file, CreateDate field to DateTimeOriginal. The command bellow does that. In the beginning the command makes the pwg_representative directory, if it is not there all ready. I'm running it on ubuntu linux. If you have ffmpeg installed and not avconv, just replace the avconv with ffmpeg. Should work. Run the command IN THE DIRECTORY WHERE THE VIDEOS ARE. I just googled a lot and came up with following command. I'm not a superuser, I barely understand the commands. Use at your own risk!

mkdir -p ./pwg_representative; for file in ./*.mp4;do avconv -ss 2.0 -i "$file" -t 1 -s 480x300 -f image2 ./pwg_representative/"${file%.mp4}".jpg;done;for file in ./*.mp4; do exiftool -tagsfromfile "$file" "-all:all>exif:all" -overwrite_original ./pwg_representative/"${file%.mp4}".jpg; done; for file in ./pwg_representative/*.jpg; do exiftool "-CreateDate>DateTimeOriginal" -overwrite_original "$file"; done

mkdir -p ./pwg_representative;
--makes the pwg_representavive directory under current directory

for file in ./*.mp4;do avconv -ss 2.0 -i "$file" -t 1 -s 480x300 -f image2 ./pwg_representative/"${file%.mp4}".jpg;done;
--take a jpg image from all mp4 files at 2 second mark and save them to pwg_representative directory under current directory

for file in ./*.mp4; do exiftool -tagsfromfile "$file" "-all:all>exif:all" -overwrite_original ./pwg_representative/"${file%.mp4}".jpg; done;
--take exif data from the video and put in the jpg files

for file in ./pwg_representative/*.jpg; do exiftool "-CreateDate>DateTimeOriginal" -overwrite_original "$file"; done
--update/create exif tag DateTimeOriginal with CreateDate

You don't have to recode you mov files to mp4. You should be able to  just put them in the mp4 container with ffmpeg/avconv: for file in ./*.mov; do avconv -i "$file" -vcodec copy -acodec copy ./"${file%.mov}".mp4; done

Jari

 

#3 2016-03-30 01:35:53

windracer
Member
St. Pete, FL
2014-12-28
448

Re: VideoJS: Video creation date not recognized

I've always had this problem as well and am just manually setting the date/time. Annoying, but doable.

Offline

 

#4 2020-05-07 09:43:28

Amony
Member
2020-05-07
3

Re: VideoJS: Video creation date not recognized

Jari wrote:

With exiftool you have to set the DateTimeOriginal so that Piwigo will use it. You can get exiftool to take that info from CreateDate. Some of my videos have DateTimeOriginal, but not all. It depends on the device I have used to record the videos. All of my videos have CreateDate.

What I have done is take a .jpg from the videos with avconv, take all exif data from the video with exiftool and put it in the jpg file. Then I update the exif data on the jpg file, CreateDate field to DateTimeOriginal. The command bellow does that. In the beginning the command makes the pwg_representative directory, if it is not there all ready. I'm running it on ubuntu linux. If you have ffmpeg installed and not avconv, just replace the avconv with ffmpeg. Should work. Run the command IN THE DIRECTORY WHERE THE VIDEOS ARE. I just googled a lot and came up with following command. I'm not a superuser, I barely understand the commands. Use at your own risk!

mkdir -p ./pwg_representative; for file in ./*.mp4;do avconv -ss 2.0 -i "$file" -t 1 -s 480x300 -f image2 ./pwg_representative/"${file%.mp4}".jpg;done;for file in ./*.mp4; do exiftool -tagsfromfile "$file" "-all:all>exif:all" -overwrite_original ./pwg_representative/"${file%.mp4}".jpg; done; for file in ./pwg_representative/*.jpg; do exiftool "-CreateDate>DateTimeOriginal" -overwrite_original "$file"; done

Jari

I'm encountering the same problems as well, it has not been fixed, but Jari's suggestions work for me !
Thanks a lot !

Offline

 

#5 2022-01-09 22:35:53

syker69
Member
2021-12-30
15

Re: VideoJS: Video creation date not recognized

Just to say thanks for this! been tearing my hair out with videos showing up in the wrong sort order!

Cheers

Offline

 

#6 2022-02-19 20:27:11

sfatula
Member
Calera, OK
2021-07-01
7

Re: VideoJS: Video creation date not recognized

For mov files, I use this if you want to use ffmpeg:

ffmpeg -i 20210910T191242.MOV -vcodec libx264 -map_metadata 0 20210910T191242.mp4

This copies tags such as creation date that are in the original mov into the mp4.

videojs sees it, at least mine does.

Offline

 
  •  » Extensions
  •  » VideoJS: Video creation date not recognized

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact