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
223

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

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

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact