
Recherche avancée
Autres articles (44)
-
Modifier la date de publication
21 juin 2013, parComment changer la date de publication d’un média ?
Il faut au préalable rajouter un champ "Date de publication" dans le masque de formulaire adéquat :
Administrer > Configuration des masques de formulaires > Sélectionner "Un média"
Dans la rubrique "Champs à ajouter, cocher "Date de publication "
Cliquer en bas de la page sur Enregistrer -
Pas question de marché, de cloud etc...
10 avril 2011Le vocabulaire utilisé sur ce site essaie d’éviter toute référence à la mode qui fleurit allègrement
sur le web 2.0 et dans les entreprises qui en vivent.
Vous êtes donc invité à bannir l’utilisation des termes "Brand", "Cloud", "Marché" etc...
Notre motivation est avant tout de créer un outil simple, accessible à pour tout le monde, favorisant
le partage de créations sur Internet et permettant aux auteurs de garder une autonomie optimale.
Aucun "contrat Gold ou Premium" n’est donc prévu, aucun (...) -
Activation de l’inscription des visiteurs
12 avril 2011, parIl est également possible d’activer l’inscription des visiteurs ce qui permettra à tout un chacun d’ouvrir soit même un compte sur le canal en question dans le cadre de projets ouverts par exemple.
Pour ce faire, il suffit d’aller dans l’espace de configuration du site en choisissant le sous menus "Gestion des utilisateurs". Le premier formulaire visible correspond à cette fonctionnalité.
Par défaut, MediaSPIP a créé lors de son initialisation un élément de menu dans le menu du haut de la page menant (...)
Sur d’autres sites (6694)
-
Revision 6c622e2783 : Merge "Separate transform and quant from vp9_encode_sb" into experimental
4 mai 2013, par John KoleszarChanged Paths :
Modify /vp9/encoder/vp9_encodeframe.c
Modify /vp9/encoder/vp9_quantize.c
Modify /vp9/encoder/vp9_rdopt.c
Merge "Separate transform and quant from vp9_encode_sb" into experimental -
Revision 4b8f7a67e5 : Merge "configure : special case flag test for clang" into experimental
4 mai 2013, par James ZernMerge "configure : special case flag test for clang" into experimental
-
"File doesn't exist" - streamio FFMPEG on screenshot after create method
3 mai 2013, par dodgerogers747I have videos being directly uploaded to S3 using Amazon's CORS configuration. Videos are uploaded via a dedicated S3 form, once they have been uploaded successfully the URL of the video is appended to the @video.file hidden_field via javascript and then the video saves.
I can't get this
after_save
method to work which takes a screenshot of the video and saves it to S3 via carrierwave after the video has been saved as a rails object. ( It was previously working using a carrierwave video upload instance )It errors out with
Errno::ENOENT - No such file or directory - the file 'http://bucket-name.s3.amazonaws.com/uploads/video/file/secure-random-hex/video_name.m4v' does not exist:
I have tried running this method as a class method to call it from the console but it always comes back with the same error, even though the video exists.My bucket is set to public, read and write. How come it doesn't think the file exists ?
If anyone needs more code just shout, thanks in advance.
application trace
Started POST "/videos" for 127.0.0.1 at 2013-05-03 10:48:07 -0700
Processing by VideosController#create as JS
Parameters: {"utf8"=>"✓", "authenticity_token"=>"MAHxrVcmPDtVIMfDWZBwL0YnzaAaAe1PTGip5M4OVoY=", "video"=>{"user_id"=>"5", "file"=>"http://bucket-name.s3.amazonaws.com/uploads/video/file/secure-random-hex/video.m4v"}}
User Load (0.3ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 5 LIMIT 1
(0.1ms) BEGIN
SQL (20.5ms) INSERT INTO `videos` (`created_at`, `file`, `question_id`, `screenshot`, `updated_at`, `user_id`) VALUES ('2013-05-03 17:48:07', 'http://teebox-network.s3.amazonaws.com/uploads/video/file/secure-random-hex/video.m4v', NULL, NULL, '2013-05-03 17:48:07', 5)
(44.0ms) ROLLBACK
Completed 500 Internal Server Error in 71ms
Errno::ENOENT - No such file or directory - the file 'http://teebox-network.s3.amazonaws.com/uploads/video/file/secure-random-hex/video.m4v' does not exist:
(gem) streamio-ffmpeg-0.9.0/lib/ffmpeg/movie.rb:10:in `initialize'
app/models/video.rb:25:in `new'
app/models/video.rb:25:in `take_screenshot'video.rb
attr_accessible :user_id, :question_id, :file, :screenshot
belongs_to :question
belongs_to :user
default_scope order('created_at DESC')
after_create :take_screenshot
mount_uploader :screenshot, ImageUploader
validates_presence_of :user_id, :file
def take_screenshot
FFMPEG.ffmpeg_binary = '/opt/local/bin/ffmpeg'
movie = FFMPEG::Movie.new("#{self.file}")
self.screenshot = movie.screenshot("#{Rails.root}/public/uploads/tmp/screenshots/#{File.basename(self.file)}.jpg", seek_time: 2 )
self.save!
endvideos/_form.html.erb
<form action="http://bucket-name.s3.amazonaws.com" data-remote="true" class="direct-upload" enctype="multipart/form-data" method="post">
<input type="hidden" />
<input type="hidden" value="ACCESS_KEY" />
<input type="hidden" value="public-read" />
<input type="hidden" />
<input type="hidden" />
<input type="hidden" value="201" />
<input type="file" />
</form>
<%= form_for @video, html: { multipart: true, id: "new_video" }, remote: true do |f| %>
<% if @video.errors.any? %>
<div>
<h2><%= pluralize(@video.errors.count, "error") %> prohibited this post from being saved:</h2>
<ul>
<% @video.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<%= f.hidden_field :user_id, value: current_user.id %>
<%= f.hidden_field :file %><br />
<% end %>ImageUploader
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::RMagick
include Sprockets::Helpers::RailsHelper
include Sprockets::Helpers::IsolatedHelper
storage :fog
before :store, :remember_cache_id
after :store, :delete_tmp_dir
def cache_dir
Rails.root.join('public/uploads/tmp/')
end
def remember_cache_id(new_file)
@cache_id_was = cache_id
end
def delete_tmp_dir(new_file)
if @cache_id_was.present? && @cache_id_was =~ /\A[\d]{8}\-[\d]{4}\-[\d]+\-[\d]{4}\z/
FileUtils.rm_rf(File.join(root, cache_dir, @cache_id_was))
end
end
process resize_and_pad: [306, 150, '#000']
def store_dir
"uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
def extension_white_list
%w(jpg)
# %w(ogg ogv 3gp mp4 m4v webm mov)
end