Posted by Airborn on August 2, 2013 at 8:11am
Dear,
I would like to ask for some help regarding the topic mentioned in the title. My objective is to record a video through a webcam and pass it somehow to the Video module and create a Video node out of it. I can already upload videos to the module and transcode it through Zencoder and I'm already solved the recording part with the "Media: Webcam" module (https://drupal.org/project/media_webcam) but I don't know how to connect those two and pass the recorded video to the Video module.
Can you help me with this?
Thank you,
Alex
Comments
I tried to make a small
I tried to make a small extension which gets the node before save with the hook_node_presave() but I don't know exaclty how to convert it to a Video node :S
Okay it seems to be solved
Okay it seems to be solved with this small hack:
function webcam_video_converter_node_presave($node) {
if ($node->type = 'webcam') {
$node->type = 'video';
$node->field_video['und'][0] = array_merge($node->field_webcam['und'][0], array(
'display' => 1,
'dimensions' => '1280x720',
'convert_video_on_save' => 1,
'bypass_autoconversion' => 0,
'use_default_video_thumb' => 0,
'conversionstatus' => NULL,
'thumbnail' => 0,
));
}
}
If you have a better solution, please inform me :)
Alex
There is a strange behavious
There is a strange behavious while using this code. The files are transcoded they are moved to S3 and after a time they are disappearing from there. I can't understand the reason.
I think it was because of a
I think it was because of a mistype in the if statement. Of course we need == insted of = :)
But I will test it a bit.
And the thumbnails are not
And the thumbnails are not created.
This one is also fixed by the
This one is also fixed by the fix above