Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Creating thumbnails and automatically importing tags

35 views
Skip to first unread message

Martijn Rentmeester

unread,
Apr 7, 2014, 5:25:17 AM4/7/14
to mmbase-...@googlegroups.com
Hello,

The Open Images Platform is running correctly and I have automatically imported media files using the AssetImporter file. But I have still two questions:

1) How can I configure FFMpeg to automatically create thumbnails?

When I have imported the media files via the AssetImporter, and I open the Open Images Platform in my browser, FFMpeg is called to automatically create thumbnails, but it returns the warning:
WAR 87911 kb mmbase.streams.thumbnails.FFMpegThumbNailCreator call.120 - No file D:\workspace\OIP\data\workdir_thumbnails\dir411755923484434221\thumbnail.1.png produced (file exists: false file length: 0 )

I am working on a Windows 7 machine (64 bit), so I downloaded FFMpeg here: http://ffmpeg.zeranoe.com/builds/

1.1) 
If I type FFMpeg -version in a command window, this is the answer:

ffmpeg version N-61249-g53eb4e0
built on Mar  9 2014 23:06:46 with gcc 4.8.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-zlib
libavutil      52. 66.101 / 52. 66.101
libavcodec     55. 52.102 / 55. 52.102
libavformat    55. 34.100 / 55. 34.100
libavdevice    55. 11.100 / 55. 11.100
libavfilter     4.  3.100 /  4.  3.100
libswscale      2.  5.101 /  2.  5.101
libswresample   0. 18.100 /  0. 18.100
libpostproc    52.  3.100 / 52.  3.100

1.2)
I also tried "ffmpeg -i input.mp4 -ss 00:00:14.00 -f image2 -vframes 1 test.png" and that created a correct thumbnail.

1.3)
This is the output that is created while the AssetImporter is running. So it seems that it can find FFmpeg correctly.

2014-04-07 11:14:44,943 SERVICE ffmpeg version N-61249-g53eb4e0 Copyright (c) 2000-2014 the FFmpeg developers
2014-04-07 11:14:44,944 SERVICE 
2014-04-07 11:14:44,944 SERVICE   built on Mar  9 2014 23:06:46 with gcc 4.8.2 (GCC)
2014-04-07 11:14:44,944 SERVICE 
2014-04-07 11:14:44,944 SERVICE   configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-zlib
2014-04-07 11:14:44,946 SERVICE 
2014-04-07 11:14:44,946 SERVICE   libavutil      52. 66.101 / 52. 66.101
2014-04-07 11:14:44,946 SERVICE 
2014-04-07 11:14:44,946 SERVICE   libavcodec     55. 52.102 / 55. 52.102
2014-04-07 11:14:44,946 SERVICE 
2014-04-07 11:14:44,947 SERVICE   libavformat    55. 34.100 / 55. 34.100
2014-04-07 11:14:44,947 SERVICE 
2014-04-07 11:14:44,947 SERVICE   libavdevice    55. 11.100 / 55. 11.100
2014-04-07 11:14:44,947 SERVICE 
2014-04-07 11:14:44,947 SERVICE   libavfilter     4.  3.100 /  4.  3.100
2014-04-07 11:14:44,947 SERVICE 
2014-04-07 11:14:44,947 SERVICE   libswscale      2.  5.101 /  2.  5.101
2014-04-07 11:14:44,948 SERVICE 
2014-04-07 11:14:44,948 SERVICE   libswresample   0. 18.100 /  0. 18.100
2014-04-07 11:14:44,948 SERVICE 
2014-04-07 11:14:49,499 SERVICE   libpostproc    52.  3.100 / 52.  3.100

2014-04-07 11:14:49,499 SERVICE   libpostproc    52.  3.100 / 52.  3.100

1.4)
My createcaches.xml file is included in the attachment. The only thing I changed is that I added an entry for MP4 HD. But also without that addition it gives the same error.

1.5)
I changed the rights of the D:\workspace\OIP\data\workdir_thumbnails\ folder for my account to full control, so I can also write to these folders.

Any idea what the problem is?

2) Is it also possible to automatically import tags from an xml file?
I have a xml file containing both the tags and the videos belonging to these tags. I want to automatically import the tags plus its relations with the videos.

André van Toly

unread,
Apr 9, 2014, 5:24:01 AM4/9/14
to mmbase-...@googlegroups.com
Hi Martijn,

Op 7 apr. 2014, om 11:25 heeft Martijn Rentmeester <martijnre...@gmail.com> het volgende geschreven:
> Hello,
>
> The Open Images Platform is running correctly and I have automatically imported media files using the AssetImporter file.

That sounds great :-)

> But I have still two questions:
>
> 1) How can I configure FFMpeg to automatically create thumbnails?
>
> When I have imported the media files via the AssetImporter, and I open the Open Images Platform in my browser, FFMpeg is called to automatically create thumbnails, but it returns the warning:
> WAR 87911 kb mmbase.streams.thumbnails.FFMpegThumbNailCreator call.120 - No file D:\workspace\OIP\data\workdir_thumbnails\dir411755923484434221\thumbnail.1.png produced (file exists: false file length: 0 )

Can you take a look in the logs and find what exactly the command is that FFMpeg receives from Java/MMBase?
You write at ad. 1.2 that you were able to create thumbnails on the commandline with "ffmpeg -i input.mp4 -ss 00:00:14.00 -f image2 -vframes 1 test.png", so I suspect that somewhere along the line something is wrong with paths or whatever. Create the following entry in log4j.xml:

<logger name="org.mmbase.util.externalprocess.CommandLauncher" >
<level class="&mmlevel;" value="debug" />
</logger>

And keep an eye out for lines like:

OIP MMBase 2014-04-09 11:12:55,554 DEB mmbase.util.externalprocess.CommandLauncher printCommandLine.462 - ffmpeg -i /Users/Shared/webapps/ROOT/WEB-INF/data/files/18/18721.fragment.m4v -an -ss 2.40 -vframes 1 /Users/Shared/webapps/ROOT/WEB-INF/data/workdir_thumbnails/dir8774234481423017220/thumbnail.%d.png
You can relate mediafragments to tags in similar way as relating licenses to media (see the AssetImporter from line 285 onwards):

RelationManager rm = cloud.getRelationManager(cloud.getNodeManager("mediafragments"), cloud.getNodeManager("licenses"), "related");
Node licenseNode = cloud.getNodeByAlias("licenses_attributionsharealike");
if (SearchUtil.findRelatedNode(mediaFragment, "licenses", "related") == null) {
mediaFragment.createRelation(licenseNode, rm).commit();
log.info("Related mediafragment " + mediaFragment.getNumber() + " to license " + licenseNode.getStringValue("name"));
}

This works only for existing tags of course. You will still need to device a way to check if a tag already exists and if not create a new tag and then relate. But for this there are also some examples in AssetImporter.

I hope this helps. Success!

---Cheers, André

>
>
> --
> You received this message because you are subscribed to the Google Groups "mmbase-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to mmbase-discus...@googlegroups.com.
> To post to this group, send email to mmbase-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/mmbase-discuss.
> For more options, visit https://groups.google.com/d/optout.

--
André van Toly
Web development & userfriendly design

W: http://www.toly.nl
M: +31(0)627233562
------------------------------------------------------------------~~<<>>~~

Martijn Rentmeester

unread,
Apr 10, 2014, 9:13:31 AM4/10/14
to mmbase-...@googlegroups.com


On Wednesday, April 9, 2014 11:24:01 AM UTC+2, André van Toly wrote:
Hi Martijn,

Op 7 apr. 2014, om 11:25 heeft Martijn Rentmeester <martijnre...@gmail.com> het volgende geschreven:
> Hello,
>
> The Open Images Platform is running correctly and I have automatically imported media files using the AssetImporter file.

That sounds great :-)

> But I have still two questions:
>
> 1) How can I configure FFMpeg to automatically create thumbnails?
>
> When I have imported the media files via the AssetImporter, and I open the Open Images Platform in my browser, FFMpeg is called to automatically create thumbnails, but it returns the warning:
> WAR 87911 kb mmbase.streams.thumbnails.FFMpegThumbNailCreator call.120 - No file D:\workspace\OIP\data\workdir_thumbnails\dir411755923484434221\thumbnail.1.png produced (file exists: false file length: 0 )

Can you take a look in the logs and find what exactly the command is that FFMpeg receives from Java/MMBase?
You write at ad. 1.2 that you were able to create thumbnails on the commandline with "ffmpeg -i input.mp4 -ss 00:00:14.00 -f image2 -vframes 1 test.png", so I suspect that somewhere along the line something is wrong with paths or whatever. Create the following entry in log4j.xml:

  <logger name="org.mmbase.util.externalprocess.CommandLauncher" >
    <level class="&mmlevel;" value="debug" />
  </logger>

And keep an eye out for lines like:

OIP MMBase 2014-04-09 11:12:55,554 DEB mmbase.util.externalprocess.CommandLauncher printCommandLine.462 - ffmpeg -i /Users/Shared/webapps/ROOT/WEB-INF/data/files/18/18721.fragment.m4v -an -ss 2.40 -vframes 1 /Users/Shared/webapps/ROOT/WEB-INF/data/workdir_thumbnails/dir8774234481423017220/thumbnail.%d.png

Thanks for the reply. This is indeed what is outputed. The problem seems to be that FFMpeg outputs to a directory/file that is not created at that moment. When I create the directory dir8774234481423017220, the command above works fine, but without that map being created, it returns the error:

[image2 @ 00000000029612a0] Could not open file: D:\workspace\OIP\data\workdir_thumbnails\dir8774234481423017220\thumbnail.1.png
av_interleaved_write_frame(): Input/output error

I have had a look on the internet to see if I can change something in ffmpeg that it checks on existance of a directory first, but I haven't found this.

Where in OIP does it create these directories? Maybe there should be a check at that point?
Thanks, that will help me to find where I should start looking.

André van Toly

unread,
Apr 14, 2014, 4:08:00 PM4/14/14
to mmbase-...@googlegroups.com
Hi,

Op 10 apr. 2014, om 15:13 heeft Martijn Rentmeester <martijnre...@gmail.com> het volgende geschreven:
> On Wednesday, April 9, 2014 11:24:01 AM UTC+2, André van Toly wrote:
> Hi Martijn,
>
> Op 7 apr. 2014, om 11:25 heeft Martijn Rentmeester <martijnre...@gmail.com> het volgende geschreven:
> > Hello,
> >
> > The Open Images Platform is running correctly and I have automatically imported media files using the AssetImporter file.
>
> That sounds great :-)
>
> > But I have still two questions:
> >
> > 1) How can I configure FFMpeg to automatically create thumbnails?
> >
> > When I have imported the media files via the AssetImporter, and I open the Open Images Platform in my browser, FFMpeg is called to automatically create thumbnails, but it returns the warning:
> > WAR 87911 kb mmbase.streams.thumbnails.FFMpegThumbNailCreator call.120 - No file D:\workspace\OIP\data\workdir_thumbnails\dir411755923484434221\thumbnail.1.png produced (file exists: false file length: 0 )
>
> Can you take a look in the logs and find what exactly the command is that FFMpeg receives from Java/MMBase?
> You write at ad. 1.2 that you were able to create thumbnails on the commandline with "ffmpeg -i input.mp4 -ss 00:00:14.00 -f image2 -vframes 1 test.png", so I suspect that somewhere along the line something is wrong with paths or whatever. Create the following entry in log4j.xml:
>
> <logger name="org.mmbase.util.externalprocess.CommandLauncher" >
> <level class="&mmlevel;" value="debug" />
> </logger>
>
> And keep an eye out for lines like:
>
> OIP MMBase 2014-04-09 11:12:55,554 DEB mmbase.util.externalprocess.CommandLauncher printCommandLine.462 - ffmpeg -i /Users/Shared/webapps/ROOT/WEB-INF/data/files/18/18721.fragment.m4v -an -ss 2.40 -vframes 1 /Users/Shared/webapps/ROOT/WEB-INF/data/workdir_thumbnails/dir8774234481423017220/thumbnail.%d.png
>
> Thanks for the reply. This is indeed what is outputed. The problem seems to be that FFMpeg outputs to a directory/file that is not created at that moment. When I create the directory dir8774234481423017220, the command above works fine, but without that map being created, it returns the error:
>
> [image2 @ 00000000029612a0] Could not open file: D:\workspace\OIP\data\workdir_thumbnails\dir8774234481423017220\thumbnail.1.png
> av_interleaved_write_frame(): Input/output error
>
> I have had a look on the internet to see if I can change something in ffmpeg that it checks on existance of a directory first, but I haven't found this.
>
> Where in OIP does it create these directories? Maybe there should be a check at that point?

The problem your facing now is in the codebase of MMBase I think. It's in org.mmbase.streams.thumbnails.FFMpegThumbNailCreator
http://scm.mmbase.org/view/mmbase/branches/MMBase-1_9/applications/streams/src/main/java/org/mmbase/streams/thumbnails/FFMpegThumbNailCreator.java?view=log

I think maybe in #getTempDir() (line 62). Maybe your system does not support 'thumbNailDir.mkdirs()' or something? This may never have been tested on Windows.

---Regards, André


--
André van Toly
web http://www.toly.nl mobile +31(0)627233562
irc irc://irc.slashnet.org/#mmbase
twitter twitter://twitter.com/#!/elfuego2
----------------------------------------------------------------~~<<>>~~

Reply all
Reply to author
Forward
0 new messages