Recherche avancée

Médias (0)

Mot : - Tags -/api

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (38)

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

  • Other interesting software

    13 avril 2011, par

    We don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
    The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
    We don’t know them, we didn’t try them, but you can take a peek.
    Videopress
    Website : http://videopress.com/
    License : GNU/GPL v2
    Source code : (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

Sur d’autres sites (5086)

  • Simply beyond ridiculous

    7 mai 2010, par Dark Shikari — H.265, speed

    For the past few years, various improvements on H.264 have been periodically proposed, ranging from larger transforms to better intra prediction. These finally came together in the JCT-VC meeting this past April, where over two dozen proposals were made for a next-generation video coding standard. Of course, all of these were in very rough-draft form ; it will likely take years to filter it down into a usable standard. In the process, they’ll pick the most useful features (hopefully) from each proposal and combine them into something a bit more sane. But, of course, it all has to start somewhere.

    A number of features were common : larger block sizes, larger transform sizes, fancier interpolation filters, improved intra prediction schemes, improved motion vector prediction, increased internal bit depth, new entropy coding schemes, and so forth. A lot of these are potentially quite promising and resolve a lot of complaints I’ve had about H.264, so I decided to try out the proposal that appeared the most interesting : the Samsung+BBC proposal (A124), which claims compression improvements of around 40%.

    The proposal combines a bouillabaisse of new features, ranging from a 12-tap interpolation filter to 12thpel motion compensation and transforms as large as 64×64. Overall, I would say it’s a good proposal and I don’t doubt their results given the sheer volume of useful features they’ve dumped into it. I was a bit worried about complexity, however, as 12-tap interpolation filters don’t exactly scream “fast”.

    I prepared myself for the slowness of an unoptimized encoder implementation, compiled their tool, and started a test encode with their recommended settings.

    I waited. The first frame, an I-frame, completed.

    I took a nap.

    I waited. The second frame, a P-frame, was done.

    I played a game of Settlers.

    I waited. The third frame, a B-frame, was done.

    I worked on a term paper.

    I waited. The fourth frame, a B-frame, was done.

    After a full 6 hours, 8 frames had encoded. Yes, at this rate, it would take a full two weeks to encode 10 seconds of HD video. On a Core i7. This is not merely slow ; this is over 1000 times slower than x264 on “placebo” mode. This is so slow that it is not merely impractical ; it is impossible to even test. This encoder is apparently designed for some sort of hypothetical future computer from space. And word from other developers is that the Intel proposal is even slower.

    This has led me to suspect that there is a great deal of cheating going on in the H.265 proposals. The goal of the proposals, of course, is to pick the best feature set for the next generation video compression standard. But there is an extra motivation : organizations whose features get accepted get patents on the resulting standard, and thus income. With such large sums of money in the picture, dishonesty becomes all the more profitable.

    There is a set of rules, of course, to limit how the proposals can optimize their encoders. If different encoders use different optimization techniques, the results will no longer be comparable — remember, they are trying to compare compression features, not methods of optimizing encoder-side decisions. Thus all encoders are required to use a constant quantizer, specified frame types, and so forth. But there are no limits on how slow an encoder can be or what algorithms it can use.

    It would be one thing if the proposed encoder was a mere 10 times slower than the current reference ; that would be reasonable, given the low level of optimization and higher complexity of the new standard. But this is beyond ridiculous. With the prize given to whoever can eke out the most PSNR at a given quantizer at the lowest bitrate (with no limits on speed), we’re just going to get an arms race of slow encoders, with every company trying to use the most ridiculous optimizations possible, even if they involve encoding the frame 100,000 times over to choose the optimal parameters. And the end result will be as I encountered here : encoders so slow that they are simply impossible to even test.

    Such an arms race certainly does little good in optimizing for reality where we don’t have 30 years to encode an HD movie : a feature that gives great compression improvements is useless if it’s impossible to optimize for in a reasonable amount of time. Certainly once the standard is finalized practical encoders will be written — but it makes no sense to optimize the standard for a use-case that doesn’t exist. And even attempting to “optimize” anything is difficult when encoding a few seconds of video takes weeks.

    Update : The people involved have contacted me and insist that there was in fact no cheating going on. This is probably correct ; the problem appears to be that the rules that were set out were simply not strict enough, making many changes that I would intuitively consider “cheating” to be perfectly allowed, and thus everyone can do it.

    I would like to apologize if I implied that the results weren’t valid ; they are — the Samsung-BBC proposal is definitely one of the best, which is why I picked it to test with. It’s just that I think any situation in which it’s impossible to test your own software is unreasonable, and thus the entire situation is an inherently broken one, given the lax rules, slow baseline encoder, and no restrictions on compute time.

  • Availability of WebM (VP8) Video Hardware IP Designs

    10 janvier 2011, par noreply@blogger.com (John Luther)

    Hello from the frigid city of Oulu, in the far north of Finland. Our WebM hardware development team, formerly part of On2 Technologies, is now up-to-speed and working hard on a number of video efforts for WebM.

    • VP8 (the video codec used in WebM) hardware decoder IP is available from Google for semiconductor companies who want to support high-quality WebM playback in their chipsets.
    • The Oulu team will release the first VP8 video hardware encoder IP in the first quarter of 2011. We have the IP running in an FPGA environment, and rigorous testing is underway. Once all features have been tested and implemented, the encoder will be launched as well.

    WebM video hardware IPs are implemented and delivered as RTL (VHDL/Verilog) source code, which is a register-level hardware description language for creating digital circuit designs. The code is based on the Hantro brand video IP from On2, which has been successfully deployed by numerous chipset companies around the world. Our designs support VP8 up to 1080p resolution and can run 30 or 60fps, depending on the foundry process and hardware clock frequency.

    The WebM/VP8 hardware decoder implementation has already been licensed to over twenty partners and is proven in silicon. We expect the first commercial chips to integrate our VP8 decoder IP to be available in the first quarter of 2011. For example, Chinese semiconductor maker Rockchip last week demonstrated full WebM hardware playback on their new RK29xx series processor at CES in Las Vegas (video below).


    Note : To view the video in WebM format, ensure that you’ve enrolled in the YouTube HTML5 trial and are using a WebM-compatible browser. You can also view the video on YouTube.

    Hardware implementations of the VP8 encoder also bring exciting possibilities for WebM in portable devices. Not only can hardware-accelerated devices play high-quality WebM content, but hardware encoding also enables high-resolution, real-time video communications apps on the same devices. For example, when VP8 video encoding is fully off-loaded to a hardware accelerator, you can run 720p or even 1080p video conferencing at full framerate on a portable device with minimal battery use.

    The WebM hardware video IP team will be focusing on further developing the VP8 hardware designs while also helping our semiconductor partners to implement WebM video compression in their chipsets. If you have any questions, please visit our Hardware page.

    Happy New Year to the WebM community !

    Jani Huoponen, Product Manager
    Aki Kuusela, Engineering Manager

  • Uploading video to Twitter sometimes doesn't work

    22 juillet 2021, par K-s S-k

    I have a very difficult situation. I've already spent 2 days and couldn't find a solution. Project on Laravel. I want to upload videos to Twitter using the Twitter API endpoints. But sometimes I am getting this error :

    


    


    file is currently unsupported

    


    


    I did everything as recommended in the official documentation Video specifications and recommendations. I get an error when I set an audio codec is aac in my video file, despite the fact that it is recommended in the official documentation, but when I set the audio codec to mp3, the video is uploaded, but the sound quality is very poor, and sometimes there is no sound at all. Please forgive me if this is awkward to read, but I want to provide all of my code. Because I don't know how to solve this anymore and I think it might help.

    


    <?php

namespace App\Jobs;

use App\Models\PublishedContent;
use Atymic\Twitter\Facades\Twitter;
use GuzzleHttp\Client as GuzzleClient;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Bus\Queueable;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\File;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Support\Str;


class PublishToTwitter implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    /**
     * @var
     */
    protected $publishingData;

    /**
     * Create a new job instance.
     *
     * @param $publishingData
     */
    public function __construct($publishingData)
    {
        $this->publishingData = $publishingData;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        $publishingData = $this->publishingData;

        if (is_array($publishingData)) {
            $publishingResult = $this->publishing(...array_values($publishingData));
            sendNotification($publishingResult['message'], $publishingResult['status'], 'Twitter', $publishingResult['link'], $publishingData['post_name'], $publishingData['user']);
        } else {
            $scheduledData = processingScheduledPost($publishingData);
            $postName = $scheduledData['scheduleData']['post_name'];
            $postContent = $scheduledData['scheduleData']['post_content'];
            $userToken = json_decode($publishingData->user_token,true);
            $requestToken = [
                'token'  => $userToken['oauth_token'],
                'secret' => $userToken['oauth_token_secret'],
            ];
            $publishingResult = $this->publishing($scheduledData['file'], $postName, $postContent, $requestToken);
            $publishingResult['status'] && PublishedContent::add($scheduledData['craft'], $scheduledData['file'], "twitter_share");
            sendResultToUser($publishingData, $scheduledData['user'], $publishingResult['message'], $postName, $publishingResult['link'], $publishingResult['publishing_status'], $scheduledData['social_media']);
            sendNotification($publishingResult['message'], $publishingResult['status'], 'Twitter', $publishingResult['link'], $postName, $scheduledData['user']);
        }
    }

    /**
     * @param $file
     * @param $postName
     * @param $postContent
     * @param $requestToken
     * @return array
     */
    private function publishing($file, $postName, $postContent, $requestToken): array
    {
        $result = [
            'status' => false,
            'link' => null,
            'message' => 'Your content can\'t successfully published on Twitter. This file is not supported for publishing.',
            'publishing_status' => 'error'
        ];

        if ((($file->refe_type !== 'text') || $file->refe_file_path) && !checkIfFileExist($file->refe_file_path)) {
            $result['message'] = 'Missing or invalid file.';
            return $result;
        }

        $filePath = $file->refe_file_path;
        $fileSize = $file->content_length;
        $tempFileName = 'temp-' . $file->refe_file_name;
        $ext = $file->file_type;
        $mediaCategory = 'tweet_' . $file->refe_type;
        $mediaType = $file->refe_type . '/' . $ext;
        $remoteFile = file_get_contents($filePath);
        $tempFolder = public_path('/storage/uploads/temp');

        if (!file_exists($tempFolder)) {
            mkdir($tempFolder, 0777, true);
        }

        $tempFile = public_path('/storage/uploads/temp/' . $tempFileName);
        File::put($tempFile, $remoteFile);
        $convertedFileName = 'converted-' . $file->refe_file_name;
        $convertedFile = public_path('/storage/uploads/temp/' . $convertedFileName);
        $command = 'ffmpeg -y -i '.$tempFile.' -b:v 5000k -b:a 380k -c:a aac -profile:a aac_low -threads 1 '.$convertedFile.'';
        exec($command);
        @File::delete($tempFile);

        try {
            $twitter = Twitter::usingCredentials($requestToken['token'], $requestToken['secret']);
            if ($file->refe_type === 'text') {
                $twitter->postTweet([
                    'status' => urldecode($postContent),
                    'format' => 'json',
                ]);

                $result['link'] = 'https://twitter.com/home';
                $result['status'] = true;
                $result['message'] = 'Your content successfully published on Twitter. You can visit to Twitter and check it.';
                $result['publishing_status'] = 'done';
            } else if ($file->refe_type === 'video' || $file->refe_type === 'image') {
                if ($file->refe_type === 'video') {
                    $duration = getVideoDuration($file->refe_file_path);

                    if ($duration > config('constant.sharing_configs.max_video_duration.twitter')) {
                        throw new \Exception('The duration of the video file must not exceed 140 seconds.');
                    }
                }

                $isFileTypeSupported = checkPublishedFileType('twitter', $file->refe_type, strtolower($ext));
                $isFileSizeSupported = checkPublishedFileSize('twitter', $file->refe_type, $fileSize, strtolower($ext));

                if (!$isFileTypeSupported) {
                    throw new \Exception('Your content can\'t successfully published on Twitter. This file type is not supported for publishing.');
                }

                if (!$isFileSizeSupported) {
                    throw new \Exception('Your content can\'t successfully published on Twitter. The file size is exceeded.');
                }

                if ($file->refe_type === 'video') $fileSize = filesize($convertedFile);

                if (strtolower($ext) === 'gif') {
                    $initMedia = $twitter->uploadMedia([
                        'command' => 'INIT',
                        'total_bytes' => (int)$fileSize
                    ]);
                } else {
                    $initMedia = $twitter->uploadMedia([
                        'command' => 'INIT',
                        'media_type' => $mediaType,
                        'media_category' => $mediaCategory,
                        'total_bytes' => (int)$fileSize
                    ]);
                }

                $mediaId = (int)$initMedia->media_id_string;

                $fp = fopen($convertedFile, 'r');
                $segmentId = 0;

                while (!feof($fp)) {
                    $chunk = fread($fp, 1048576);

                    $twitter->uploadMedia([
                        'media_data' => base64_encode($chunk),
                        'command' => 'APPEND',
                        'segment_index' => $segmentId,
                        'media_id' => $mediaId
                    ]);

                    $segmentId++;
                }

                fclose($fp);

                $twitter->uploadMedia([
                    'command' => 'FINALIZE',
                    'media_id' => $mediaId
                ]);

                if ($file->refe_type === 'video') {
                    $waits = 0;

                    while ($waits <= 4) {
                        // Authorizing header for Twitter API
                        $oauth = [
                            'command' => 'STATUS',
                            'media_id' => $mediaId,
                            'oauth_consumer_key' => config('twitter.consumer_key'),
                            'oauth_nonce' => Str::random(42),
                            'oauth_signature_method' => 'HMAC-SHA1',
                            'oauth_timestamp' => time(),
                            'oauth_token' => $requestToken['token'],
                            'oauth_version' => '1.0'
                        ];

                        // Generate an OAuth 1.0a HMAC-SHA1 signature for an HTTP request
                        $baseInfo = $this->buildBaseString('https://upload.twitter.com/1.1/media/upload.json', 'GET', $oauth);
                        // Getting a signing key
                        $compositeKey = rawurlencode(config('twitter.consumer_secret')) . '&' . rawurlencode($requestToken['secret']);
                        // Calculating the signature
                        $oauthSignature = base64_encode(hash_hmac('sha1', $baseInfo, $compositeKey, true));
                        $oauth['oauth_signature'] = $oauthSignature;
                        $headers['Authorization'] = $this->buildAuthorizationHeader($oauth);

                        try {
                            $guzzle = new GuzzleClient([
                                'headers' => $headers
                            ]);
                            $response = $guzzle->request( 'GET', 'https://upload.twitter.com/1.1/media/upload.json?command=STATUS&media_id=' . $mediaId);
                            $uploadStatus = json_decode($response->getBody()->getContents());
                        } catch (\Exception | GuzzleException $e) {
                            dd($e->getMessage(), $e->getLine(), $e->getFile());
                        }

                        if (isset($uploadStatus->processing_info->state)) {
                            switch ($uploadStatus->processing_info->state) {
                                case 'succeeded':
                                    $waits = 5; // break out of the while loop
                                    break;
                                case 'failed':
                                    File::delete($tempFile);
                                    Log::error('File processing failed: ' . $uploadStatus->processing_info->error->message);
                                    throw new \Exception('File processing failed: ' . $uploadStatus->processing_info->error->message);
                                default:
                                    sleep($uploadStatus->processing_info->check_after_secs);
                                    $waits++;
                            }
                        } else {
                            throw new \Exception('There was an unknown error uploading your file');
                        }
                    }
                }

                $twitter->postTweet(['status' => urldecode($postContent), 'media_ids' => $initMedia->media_id_string]);
                @File::delete($convertedFile);
                $result['link'] = 'https://twitter.com/home';
                $result['status'] = true;
                $result['message'] = 'Your content successfully published on Twitter. You can visit to Twitter and check it.';
                $result['publishing_status'] = 'done';
            }
        } catch (\Exception $e) {
            dd($e->getMessage());
            $result['message'] = $e->getMessage();
            return $result;
        }

        return $result;
    }

    /**
     * @param $baseURI
     * @param $method
     * @param $params
     * @return string
     *
     * Creating the signature base string
     */
    protected function buildBaseString($baseURI, $method, $params): string
    {
        $r = array();
        ksort($params);
        foreach($params as $key=>$value){
            $r[] = "$key=" . rawurlencode($value);
        }
        return $method . "&" . rawurlencode($baseURI) . '&' . rawurlencode(implode('&', $r));
    }

    /**
     * @param $oauth
     * @return string
     *
     * Collecting parameters
     */
    protected function buildAuthorizationHeader($oauth): string
    {
        $r = 'OAuth ';
        $values = array();
        foreach($oauth as $key=>$value)
            $values[] = "$key=\"" . rawurlencode($value) . "\"";
        $r .= implode(', ', $values);
        return $r;
    }
}



    


    I would be very grateful if someone would help me.