Foren

How store image and video in document and media portlet

Dhanush B, geändert vor 9 Jahren.

How store image and video in document and media portlet

Junior Member Beiträge: 56 Beitrittsdatum: 26.08.14 Neueste Beiträge
Hi friends,
i want to upload video to document and media portlet using custom portlet,what i have done in my portlet is i gave one upload button using that if user upload the video i want to store that video to document and media portlet and the link or reference of video is store to my table in database.
please share idea for this friends.
Thanks and Regards
Dhanush
thumbnail
Tanweer Ahmed ., geändert vor 1 Jahr.

RE: How store image and video in document and media portlet

Expert Beiträge: 322 Beitrittsdatum: 11.03.10 Neueste Beiträge
Hi Dhanush,

Its better to use Liferay APIs and tables to upload data to document and media portlet.With this you also get the Permissions related stuff out-of-the-box.Your documents are safe and only accessible with proper roles.

You can use DLApp API.Refer the Example code below.
long folderId = DLAppLocalServiceUtil.addFolder(userId, repositoryId, folderId, name, description,
                        folderServiceContext).getFolderId();
FileEntry fileEntry = DLAppLocalServiceUtil.addFileEntry(userId, repositoryId, folderId, title, mimeType, title,
                    description, changeLog, file, serviceContext);

The information would be saved in liferay tables - dlfileentry, dlfolder.

Regards,
Tanweer.
Dhanush B, geändert vor 9 Jahren.

RE: How store image and video in document and media portlet

Junior Member Beiträge: 56 Beitrittsdatum: 26.08.14 Neueste Beiträge
Hi Tanweer,
Thanks for your reply,i tried your idea but video is not storing into database and document and media portlet.
can u please give me one example for this.
this is my code:

FileEntry fileEntry = DLAppLocalServiceUtil.addFileEntry(10195, 10179, 18605,"Image", MimeTypesUtil.getContentType(image),"Host",
"Hai", "img", image, sc)



Thanks and Regards
B.Dhanush
Dhanush B, geändert vor 9 Jahren.

RE: How store image and video in document and media portlet

Junior Member Beiträge: 56 Beitrittsdatum: 26.08.14 Neueste Beiträge
Hi Tanweer ,
I have successfully added image and video to document and media portlet now my problem is how to fetch the url in my jsp page.
Please anyone have idea for my issue.
Thanks and Regards
Dhanush
thumbnail
Jitendra Rajput, geändert vor 9 Jahren.

RE: How store image and video in document and media portlet

Liferay Master Beiträge: 875 Beitrittsdatum: 07.01.11 Neueste Beiträge
You can use DLUtil API to generate document download URL.

DLUtil.getPreviewURL(
		FileEntry fileEntry, FileVersion fileVersion, ThemeDisplay themeDisplay,
		String queryString) 



Thank you,
Jitendra
Dhanush B, geändert vor 9 Jahren.

RE: How store image and video in document and media portlet

Junior Member Beiträge: 56 Beitrittsdatum: 26.08.14 Neueste Beiträge
hi Jitendra,
Thanks for your reply
can you give one example for this dlutil().

Regards
Dhanush
thumbnail
Jitendra Rajput, geändert vor 9 Jahren.

RE: How store image and video in document and media portlet

Liferay Master Beiträge: 875 Beitrittsdatum: 07.01.11 Neueste Beiträge
For document download URL example you can look into download.jspf inside portal source.

Thank you,
Jitendra
Dhanush B, geändert vor 9 Jahren.

RE: How store image and video in document and media portlet

Junior Member Beiträge: 56 Beitrittsdatum: 26.08.14 Neueste Beiträge
hi Jitendra
finally i got solution for download url of document and media portlet using this code:

<a href='<%=themeDisplay.getPortalURL()+"/c/document_library/get_file?uuid="+d.getUuid()+"&groupId="+themeDisplay.getScopeGroupId() %>' download>

but before downloading i want to play the video in my jsp page. how to do that please friends share your ideas.
i attached one file i want to give like this to user.
Dhanush B, geändert vor 9 Jahren.

RE: How store image and video in document and media portlet

Junior Member Beiträge: 56 Beitrittsdatum: 26.08.14 Neueste Beiträge
Please Can Any one Reply
thumbnail
Juan Gonzalez, geändert vor 9 Jahren.

RE: How store image and video in document and media portlet

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
Hi Danush,

you can use Liferay out of the box video preview from 6.1:

https://www.liferay.com/documentation/liferay-portal/6.2/user-guide/-/ai/automatic-previews-and-metadata-liferay-portal-6-2-user-guide-05-en

From 6.2 you can add these videos in a web content using CKEditor.


You can configure an Asset Publisher too to achieve that requirement and maybe use some Application Display Template to customize your view. Take into account that there is a known bug when having multiple videos in an asset publisher (you can patch your installation or ask for a patch if you are a EE customer):

https://issues.liferay.com/browse/LPS-48554
Dhanush B, geändert vor 9 Jahren.

RE: How store image and video in document and media portlet

Junior Member Beiträge: 56 Beitrittsdatum: 26.08.14 Neueste Beiträge
Hi Juan,
Thanks for your reply,but i have created custom portlet from my custom portlet only i uploaded video to document and media portlet using dlfileentrylocalserviceutil, now i want display the video in my view.jsp, how to do that please guide me.

Thanks and Regards
B.Dhanush
thumbnail
Manikantha Rajamani, geändert vor 9 Jahren.

RE: How store image and video in document and media portlet

Expert Beiträge: 258 Beitrittsdatum: 25.03.14 Neueste Beiträge
Hi
Dhanush B

please share that custom portlet which you developed for uploading the video to Document Library.
I need same requirement.
if u share it will be help full for me..


Regards
Manikantha R.
Dhanush B, geändert vor 9 Jahren.

RE: How store image and video in document and media portlet

Junior Member Beiträge: 56 Beitrittsdatum: 26.08.14 Neueste Beiträge
Hi Rajamani,
Can you share your mail id i will send my portlet to your mailid.
Thank you
thumbnail
Manikantha Rajamani, geändert vor 9 Jahren.

RE: How store image and video in document and media portlet

Expert Beiträge: 258 Beitrittsdatum: 25.03.14 Neueste Beiträge
Hi Danush,

e-mail id is manikantha.rajamani@gmail.com

thanks for sending the portlet


Regards
Manikantha R
Dhanush B, geändert vor 9 Jahren.

RE: How store image and video in document and media portlet

Junior Member Beiträge: 56 Beitrittsdatum: 26.08.14 Neueste Beiträge
Hi friends,
Finally i got the solution,DLUtil.getPreviewURL() using this i am fetching the file from document and media and displaying in my jsp page.
Now it's working fine.emoticon
Thanks and Regards
B.dhanush
shima shima, geändert vor 9 Jahren.

RE: How store image and video in document and media portlet

Junior Member Beiträge: 46 Beitrittsdatum: 14.04.14 Neueste Beiträge
hi would u please say your solution
I have a problam same as you
Dhanush B, geändert vor 9 Jahren.

RE: How store image and video in document and media portlet

Junior Member Beiträge: 56 Beitrittsdatum: 26.08.14 Neueste Beiträge
hi shima,
can you explain post what's problem you're facing in that uploading audio and video.
varshali c, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

New Member Beiträge: 11 Beitrittsdatum: 21.06.16 Neueste Beiträge
Hi,

I am new to liferay. I want to upload video(mp4,wmv etc.) in web content display. As given on liferay site I tried for Xuggler but could not get anything related to it.

I am using liferay CE 6.2 GA3.
Where to place properties mentioned by you?

Please help.

Many Thanks.
thumbnail
Juan Gonzalez, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
Can you explain which steps you tried and the results you obtained?
varshali c, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

New Member Beiträge: 11 Beitrittsdatum: 21.06.16 Neueste Beiträge
Hi Juan,

I want to upload video from web content using ckeditor/or any other means like structure/template combination.

I tried Xuggler from : Control Panel - Server administration- External services.

But I got "An unexpected error occurred while installing Xuggler.: xuggle.googlecode.com" error.

Then I referred:
https://web.liferay.com/community/forums/-/message_boards/view_message/61635970#_19_message_61343272

But I could not download/clone Xuggler from github.

I have downloaded Xuggler 5.4 but as said in above post we need to build manually for Windows 7 64 bit.
thumbnail
Juan Gonzalez, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
Are you using any Windows 64 bit?
varshali c, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

New Member Beiträge: 11 Beitrittsdatum: 21.06.16 Neueste Beiträge
Juan Gonzalez:
Are you using any Windows 64 bit?



Yes Juan, I am using Windows 7 Operating system 64 bits.
thumbnail
Juan Gonzalez, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
varshali c:
Juan Gonzalez:
Are you using any Windows 64 bit?


Yes Juan, I am using Windows 7 Operating system 64 bits.


Ok varshali. I was planning releasing a xuggler 5.5 plugin in Marketplace, but still need to build jar files for some environments.

In the meantime, I am attaching the windows 64 bit version of xuggler 5.5, BUT, remember this is GPL version, so take that into account on your projects you're using it. Here you have a link to the GPL license: https://github.com/artclarke/xuggle-xuggler/blob/master/COPYING, and here is the source code: https://github.com/artclarke/xuggle-xuggler

Check if this works for you.

Thanks!
varshali c, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

New Member Beiträge: 11 Beitrittsdatum: 21.06.16 Neueste Beiträge
Hi Juan,

Do I need to follow build instructions from http://www.xuggle.com/xuggler/build for Xuggler 5.5
thumbnail
Juan Gonzalez, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
varshali c:
Hi Juan,

Do I need to follow build instructions from http://www.xuggle.com/xuggler/build for Xuggler 5.5


Nope, just copy/paste that jar library in your Liferay WEB-INF/lib (override if already exists), and start server.

Please write here if it works or not when uploading videos.
varshali c, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

New Member Beiträge: 11 Beitrittsdatum: 21.06.16 Neueste Beiträge
Juan Gonzalez:

Nope, just copy/paste that jar library in your Liferay WEB-INF/lib (override if already exists), and start server.

Please write here if it works or not when uploading videos.


Hi Juan,

I got Audio and Video button in ckeditor.. emoticon

I am getting "Java Platform SE binary has stopped working" alert window.

Now I am able to play 200KB .wmv video, but even after uploading video of 24MB 2 days ago in documents and media library its preview is not available.
And audio file of 4MB is not playing on my web page. I dont have smaller file than this.
Do I need to set properties for audio files as I did for video?
Please reply..


2016-08-11 06:31:02,081 ERROR [com.liferay.portlet.documentlibrary.util.VideoProcessorImpl] (liferay/document_library_video_processor-1) java.util.concurrent.ExecutionException: com.liferay.portal.kernel.process.ProcessException: Subprocess terminated with exit code -1073741819
java.util.concurrent.ExecutionException: com.liferay.portal.kernel.process.ProcessException: Subprocess terminated with exit code -1073741819


Many Thanks!
thumbnail
Juan Gonzalez, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
Hi varshali.

The failing video is in mp4 format, isn't it?
varshali c, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

New Member Beiträge: 11 Beitrittsdatum: 21.06.16 Neueste Beiträge
Juan Gonzalez:
Hi varshali.

The failing video is in mp4 format, isn't it?


Hi Juan,

I am able to play 200 KB .wmv video but not of 24MB .wmv video

Also 4mb .mp3 audio is not playing on web page. I have edited my previous post. Please check for server logs in that.

Thank you!!
thumbnail
Juan Gonzalez, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
varshali c:
Juan Gonzalez:
Hi varshali.

The failing video is in mp4 format, isn't it?


Hi Juan,

I am able to play 200 KB .wmv video but not of 24MB .wmv video

Also 4mb .mp3 audio is not playing on web page. I have edited my previous post. Please check for server logs in that.

Thank you!!


Hi again.

I think I've got this working.

Can you shutdown your server and replace the same jar existing in Liferay WEB-INF/lib with this new version I am attaching?

Then startup and access those files again to see if they are created now.

Thanks!
varshali c, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

New Member Beiträge: 11 Beitrittsdatum: 21.06.16 Neueste Beiträge
Hi Juan,

I have installed new jar file, still I am unable to play audio file in web content. I can upload .mp3 file but not able to play.
please see logs below.

2016-08-16 09:58:44,300 ERROR [org.ffmpeg] (liferay/document_library_raw_metadata_processor-1) [mp3 @ 000000001C2E2AD0] Header missing
2016-08-16 09:58:53,000 ERROR [com.liferay.portlet.documentlibrary.util.AudioProcessorImpl] (liferay/document_library_audio_processor-1) java.util.concurrent.ExecutionException: com.liferay.portal.kernel.process.ProcessException: java.lang.RuntimeException: Unable to encode audio
java.util.concurrent.ExecutionException: com.liferay.portal.kernel.process.ProcessException: java.lang.RuntimeException: Unable to encode audio
	at com.liferay.portal.kernel.process.ProcessExecutor$ProcessExecutionFutureResult.get(ProcessExecutor.java:502)


Thanks!
thumbnail
Juan Gonzalez, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
Please attach sample to reproduce.
varshali c, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

New Member Beiträge: 11 Beitrittsdatum: 21.06.16 Neueste Beiträge
Juan Gonzalez:
Please attach sample to reproduce.



I am using Windows 7 sample audio files(.mp3) to upload on web content page.
thumbnail
Juan Gonzalez, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
varshali c:
Juan Gonzalez:
Please attach sample to reproduce.



I am using Windows 7 sample audio files(.mp3) to upload on web content page.


I could upload "Kalimba.mp3" file to documents and media, and its preview is generated succesfully.

Probably you didn't install the new jar file properly, or you didn't remove the previous one.
varshali c, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

New Member Beiträge: 11 Beitrittsdatum: 21.06.16 Neueste Beiträge
Juan Gonzalez:

I could upload "Kalimba.mp3" file to documents and media, and its preview is generated succesfully.

Probably you didn't install the new jar file properly, or you didn't remove the previous one.


I have removed old jar file and then placed new jar file. and then started server again.
I could not play audio file on web content display. I am able to upload .mp3 file but after publishing it is not playing on web page.

Please see log attached below. It is showing same error message: Header missing and unable to encode audio.

 2016-08-17 06:39:33,117 ERROR [org.ffmpeg] (liferay/document_library_raw_metadata_processor-1) [mp3 @ 000000001BD72AD0] Header missing
2016-08-17 06:39:33,118 ERROR [org.ffmpeg] (liferay/document_library_raw_metadata_processor-1) [mp3 @ 000000001BD72AD0] Header missing
2016-08-17 06:39:33,118 ERROR [org.ffmpeg] (liferay/document_library_raw_metadata_processor-1) [mp3 @ 000000001BD72AD0] Header missing
2016-08-17 06:39:37,188 ERROR [com.liferay.portlet.documentlibrary.util.AudioProcessorImpl] (liferay/document_library_audio_processor-1) java.util.concurrent.ExecutionException: com.liferay.portal.kernel.process.ProcessException: java.lang.RuntimeException: Unable to encode audio
java.util.concurrent.ExecutionException: com.liferay.portal.kernel.process.ProcessException: java.lang.RuntimeException: Unable to encode audio
	at com.liferay.portal.kernel.process.ProcessExecutor$ProcessExecutionFutureResult.get(ProcessExecutor.java:502)
	at com.liferay.portal.kernel.process.ProcessExecutor$ProcessExecutionFutureResult.get(ProcessExecutor.java:476)
	at com.liferay.portlet.documentlibrary.util.AudioProcessorImpl._generateAudioXuggler(AudioProcessorImpl.java:380)
	at com.liferay.portlet.documentlibrary.util.AudioProcessorImpl._generateAudioXuggler(AudioProcessorImpl.java:421) 
thumbnail
Juan Gonzalez, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
Which file did you use? You should provide more specific information so I can help you.
varshali c, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

New Member Beiträge: 11 Beitrittsdatum: 21.06.16 Neueste Beiträge
Juan Gonzalez:
Which file did you use? You should provide more specific information so I can help you.



Hi Juan,

I am using windows 7 default .mp3 files.. Maid with the Flaxen Hair and Sleep away.mp3

Many Thanks!!
thumbnail
Juan Gonzalez, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
I could add those files and previews are being created fine with new Xuggler jar file (same as I've attached previously).

See attached screenshot files.

You could try to repeat the process in a new/clean environment to ensure it isn't caused by some temp files. In that case remember to copy the xuggler jar file I've attached previously.

Thanks.
abhishek kumar, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

Regular Member Beiträge: 138 Beitrittsdatum: 17.08.15 Neueste Beiträge
varshali c:
Hi,

I want to upload video(mp4,wmv etc.) in web content display.
.


Hi

For video so that it would play in web content , you can refer this link for reference .
Add the video in document and media folder just drag and drop it will uploaded there itself .

Webcontent_Video


Regards
Abhishek
thumbnail
Juan Gonzalez, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
abhishek kumar:
varshali c:
Hi,

I want to upload video(mp4,wmv etc.) in web content display.
.


Hi

For video so that it would play in web content , you can refer this link for reference .
Add the video in document and media folder just drag and drop it will uploaded there itself .

Webcontent_Video


Regards
Abhishek


Sorry Abhisked but that approach is incomplete. For example, in your article you only could upload mp4 videos that are ready for playing in web (for example, many of them won't be played until are downloaded completely).

Using Xuggler we will ensure all uploaded formats would be playable through any browser, and those can be seeked at any video time point using partial Http requests.
abhishek kumar, geändert vor 7 Jahren.

RE: How store image and video in document and media portlet

Regular Member Beiträge: 138 Beitrittsdatum: 17.08.15 Neueste Beiträge
Juan Gonzalez:
Sorry Abhisked but that approach is incomplete.


Ok ,Thanks for correcting me as I'M not aware of that , i got the solution of mp4 , might be helpful .


Regards
Abhishek