Recherche avancée

Médias (39)

Mot : - Tags -/audio

Autres articles (53)

  • Les vidéos

    21 avril 2011, par

    Comme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
    Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
    Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...)

  • 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 (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

Sur d’autres sites (8141)

  • xabe.ffmpeg not working in azure app service

    28 décembre 2020, par Sripathi Raja

    I have a .net core application which generates video thumbnails for uploaded videos. I am using xabe.ffmpeg for this . The code runs fine in the local system and Iam able to generate the thumbnails . I have containerized this application and pushed it to azure app service . But when the code is deployed on azure app service its throws an error . I have placed the ffmpeg.exe ,ffprobe.exe , ffplay.exe inside a folder ffmpeg in wwwroot folder .
the app service logs give this error

    


    the first line is the path : /app/wwwroot/ffmpeg

    


    2020-12-25T14:34:01.347103909Z /app/wwwroot/ffmpeg&#xA;2020-12-25T14:34:01.443016709Z [41m[30mfail[39m[22m[49m : Microsoft.AspNetCore.Server.Kestrel[13]&#xA;2020-12-25T14:34:01.443066009Z Connection id "0HM58S8AE014U", Request id "0HM58S8AE014U:00000002" : An unhandled exception was thrown by the application.&#xA;2020-12-25T14:34:01.456821709Z System.ComponentModel.Win32Exception (2) : No such file or directory&#xA;2020-12-25T14:34:01.462537109Z at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)&#xA;2020-12-25T14:34:01.462555709Z at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)&#xA;2020-12-25T14:34:01.462560609Z at System.Diagnostics.Process.Start()&#xA;2020-12-25T14:34:01.463739309Z at Xabe.FFmpeg.FFmpeg.RunProcess(String args, String processPath, Nullable1 priority, Boolean standardInput, Boolean standardOutput, Boolean standardError) 2020-12-25T14:34:01.463755809Z    at Xabe.FFmpeg.FFprobeWrapper.&lt;>c__DisplayClass9_0.<runprocess>b__0() 2020-12-25T14:34:01.463761809Z    at System.Threading.Tasks.Task</runprocess>1.InnerInvoke()&#xA;2020-12-25T14:34:01.463766309Z at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj)&#xA;2020-12-25T14:34:01.463781109Z at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)&#xA;2020-12-25T14:34:01.463786509Z --- End of stack trace from previous location where exception was thrown ---&#xA;2020-12-25T14:34:01.463790909Z at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)&#xA;2020-12-25T14:34:01.463795509Z at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)&#xA;2020-12-25T14:34:01.463800009Z --- End of stack trace from previous location where exception was thrown ---&#xA;2020-12-25T14:34:01.463813709Z at Xabe.FFmpeg.FFprobeWrapper.RunProcess(String args, CancellationToken cancellationToken)&#xA;2020-12-25T14:34:01.463818109Z at Xabe.FFmpeg.FFprobeWrapper.GetStreams(String videoPath, CancellationToken cancellationToken)&#xA;2020-12-25T14:34:01.463821909Z at Xabe.FFmpeg.FFprobeWrapper.SetProperties(MediaInfo mediaInfo, CancellationToken cancellationToken)&#xA;2020-12-25T14:34:01.463825509Z at Xabe.FFmpeg.MediaInfo.Get(String filePath, CancellationToken cancellationToken)&#xA;2020-12-25T14:34:01.463829109Z at Xabe.FFmpeg.MediaInfo.Get(String filePath)&#xA;2020-12-25T14:34:01.463832609Z at Xabe.FFmpeg.FFmpeg.GetMediaInfo(String fileName)&#xA;2020-12-25T14:34:01.467009509Z at root2webAPI.Controllers.AzureStorageControllers.BlobExplorerController.GetVideoThumbnailAsync(IFormFile file, Int32 frameTarget) in /src/root2webAPI/Controllers/AzureStorageControllers/BlobExplorerController.cs:line 271&#xA;2020-12-25T14:34:01.467023809Z at root2webAPI.Controllers.AzureStorageControllers.BlobExplorerController.UploadMediaBlob(IFormFile file, String parentId) in /src/root2webAPI/Controllers/AzureStorageControllers/BlobExplorerController.cs:line 96&#xA;2020-12-25T14:34:01.467028709Z at lambda_method(Closure , Object )&#xA;2020-12-25T14:34:01.467032109Z at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()&#xA;2020-12-25T14:34:01.467035909Z at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)&#xA;2020-12-25T14:34:01.467039409Z at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)&#xA;2020-12-25T14:34:01.467043209Z at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)&#xA;2020-12-25T14:34:01.467055709Z at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)&#xA;2020-12-25T14:34:01.467060609Z at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)&#xA;2020-12-25T14:34:01.467067409Z at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)&#xA;2020-12-25T14:34:01.467071609Z at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)&#xA;2020-12-25T14:34:01.467075209Z at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)&#xA;2020-12-25T14:34:01.467078709Z at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)&#xA;2020-12-25T14:34:01.467089009Z at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)&#xA;2020-12-25T14:34:01.467093409Z at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)&#xA;2020-12-25T14:34:01.467096909Z at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)&#xA;2020-12-25T14:34:01.467100509Z at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)&#xA;2020-12-25T14:34:01.467103809Z at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext]

    &#xA;

    here is my relevant .net application code

    &#xA;

      private async Task<mediametadata> GetVideoThumbnailAsync(IFormFile file,int frameTarget)&#xA;    {&#xA;     var fileName = file.FileName;&#xA;     var filePath = Path.Combine(_rootPath, "videos", fileName);&#xA;     var fileExtension = Path.GetExtension(filePath);&#xA;     &#xA;     // the xabe wrapper works with only mp4 extension to create thumbnail , if the file is any other format first convert it to&#xA;     //the mp4 format and then goahead with creating the thumbnail.  &#xA;     var thumbnailImageName = fileName.Replace(fileExtension, ".jpg");&#xA;     var thumbnailImagePath = Path.Combine(_rootPath, "thumbnails", thumbnailImageName);&#xA;     &#xA;            using (Stream fileStream = new FileStream(filePath, FileMode.Create)) {&#xA;                &#xA;             await file.CopyToAsync(fileStream);&#xA;            }&#xA;    Console.WriteLine(Path.Combine(_rootPath,"ffmpeg"));&#xA;    FFmpeg.SetExecutablesPath(Path.Combine(_rootPath,"ffmpeg"));&#xA;    IMediaInfo mediaInfo = await FFmpeg.GetMediaInfo(filePath);&#xA;    var videoDuration = mediaInfo.VideoStreams.First().Duration;&#xA;    IConversion conversion = await FFmpeg.Conversions.FromSnippet.Snapshot(filePath, thumbnailImagePath , TimeSpan.FromSeconds(frameTarget));&#xA;    IConversionResult result = await conversion.Start();&#xA;    MediaMetadata media = new MediaMetadata();&#xA;    media.DurationSeconds=Convert.ToInt32(videoDuration.TotalMilliseconds);&#xA;    // media.DurationSeconds=10;&#xA;    media.ThumbnailImagePath= thumbnailImagePath;&#xA;    return media;&#xA;    &#xA;    }&#xA;</mediametadata>

    &#xA;

    could you help me out with this ..many thanks

    &#xA;

  • WARN : Tried to pass invalid video frame, marking as broken : Your frame has data type int64, but we require uint8

    5 septembre 2019, par Tavo Diaz

    I am doing some Udemy AI courses and came across with one that "teaches" a bidimensional cheetah how to walk. I was doing the exercises on my computer, but it takes too much time. I decided to use Google Cloud to run the code and see the results some hours after. Nevertheless, when I run the code I get the following error " WARN : Tried to pass
    invalid video frame, marking as broken : Your frame has data type int64, but we require uint8 (i.e. RGB values from 0-255)".

    After the code is executed, I see into the folder and I don’t see any videos (just the meta info).

    Some more info (if it helps) :
    I have a 1 CPU (4g), SSD Ubuntu 16.04 LTS

    I have not tried anything yet to solve it because I don´t know what to try. Im looking for solutions on the web, but nothing I could try.

    This is the code

    import os
    import numpy as np
    import gym
    from gym import wrappers
    import pybullet_envs


    class Hp():
       def __init__(self):
           self.nb_steps = 1000
           self.episode_lenght =   1000
           self.learning_rate = 0.02
           self.nb_directions = 32
           self.nb_best_directions = 32
           assert self.nb_best_directions &lt;= self.nb_directions
           self.noise = 0.03
           self.seed = 1
           self.env_name = 'HalfCheetahBulletEnv-v0'


    class Normalizer():
       def __init__(self, nb_inputs):
           self.n = np.zeros(nb_inputs)
           self.mean = np.zeros(nb_inputs)
           self.mean_diff = np.zeros(nb_inputs)
           self.var = np.zeros(nb_inputs)

       def observe(self, x):
           self.n += 1.
           last_mean = self.mean.copy()
           self.mean += (x - self.mean) / self.n
           #abajo es el online numerator update
           self.mean_diff += (x - last_mean) * (x - self.mean)
           #abajo online computation de la varianza
           self.var = (self.mean_diff / self.n).clip(min = 1e-2)  

       def normalize(self, inputs):
           obs_mean = self.mean
           obs_std = np.sqrt(self.var)
           return (inputs - obs_mean) / obs_std

    class Policy():
       def __init__(self, input_size, output_size):
           self.theta = np.zeros((output_size, input_size))

       def evaluate(self, input, delta = None, direction = None):
           if direction is None:
               return self.theta.dot(input)
           elif direction == 'positive':
               return (self.theta + hp.noise * delta).dot(input)
           else:
               return (self.theta - hp.noise * delta).dot(input)

       def sample_deltas(self):
           return [np.random.randn(*self.theta.shape) for _ in range(hp.nb_directions)]

       def update (self, rollouts, sigma_r):
           step = np.zeros(self.theta.shape)
           for r_pos, r_neg, d in rollouts:
               step += (r_pos - r_neg) * d
           self.theta += hp.learning_rate / (hp.nb_best_directions * sigma_r) * step


    def explore(env, normalizer, policy, direction = None, delta = None):
       state = env.reset()
       done = False
       num_plays = 0.
       #abajo puede ser promedio de las rewards
       sum_rewards = 0
       while not done and num_plays &lt; hp.episode_lenght:
           normalizer.observe(state)
           state = normalizer.normalize(state)
           action = policy.evaluate(state, delta, direction)
           state, reward, done, _ = env.step(action)
           reward = max(min(reward, 1), -1)
           #abajo sería poner un promedio
           sum_rewards += reward
           num_plays += 1
       return sum_rewards

    def train (env, policy, normalizer, hp):
       for step in range(hp.nb_steps):
           #iniciar las perturbaciones deltas y los rewards positivos/negativos
           deltas = policy.sample_deltas()
           positive_rewards = [0] * hp.nb_directions
           negative_rewards = [0] * hp.nb_directions
           #sacar las rewards en la dirección positiva
           for k in range(hp.nb_directions):
               positive_rewards[k] = explore(env, normalizer, policy, direction = 'positive', delta = deltas[k])
           #sacar las rewards en dirección negativo
           for k in range(hp.nb_directions):
               negative_rewards[k] = explore(env, normalizer, policy, direction = 'negative', delta = deltas[k])
           #sacar todas las rewards para sacar la desvest
           all_rewards = np.array(positive_rewards + negative_rewards)
           sigma_r = all_rewards.std()
           #acomodar los rollauts por el max (r_pos, r_neg) y seleccionar la mejor dirección
           scores = {k:max(r_pos, r_neg) for k, (r_pos, r_neg) in enumerate(zip(positive_rewards, negative_rewards))}
           order = sorted(scores.keys(), key = lambda x:scores[x])[:hp.nb_best_directions]
           rollouts = [(positive_rewards[k], negative_rewards[k], deltas[k]) for k in order]
           #actualizar policy
           policy.update (rollouts, sigma_r)
           #poner el final reward del policy luego del update
           reward_evaluation = explore (env, normalizer, policy)
           print('Paso: ', step, 'Lejania: ', reward_evaluation)

    def mkdir(base, name):
       path = os.path.join(base, name)
       if not os.path.exists(path):
           os.makedirs(path)
       return path
    work_dir = mkdir('exp', 'brs')
    monitor_dir = mkdir(work_dir, 'monitor')

    hp = Hp()
    np.random.seed(hp.seed)
    env = gym.make(hp.env_name)
    env = wrappers.Monitor(env, monitor_dir, force = True)
    nb_inputs = env.observation_space.shape[0]
    nb_outputs = env.action_space.shape[0]
    policy = Policy(nb_inputs, nb_outputs)
    normalizer = Normalizer(nb_inputs)
    train(env, policy, normalizer, hp)
  • Ubuntu ffmpeg can't use libx264

    27 mai 2021, par user1315621

    Command

    &#xA;

    ffprobe rtsp://localhost/myvideo -codec:v libx264 -show_frames -of csv&#xA;

    &#xA;

    Output

    &#xA;

    Failed to set value &#x27;libx264&#x27; for option &#x27;codec:v&#x27;: Option not found&#xA;

    &#xA;

    But libx264 seems to be installed -&#xA;sudo apt install libx264-dev :

    &#xA;

    Reading package lists... Done&#xA;Building dependency tree       &#xA;Reading state information... Done&#xA;libx264-dev is already the newest version (2:0.152.2854&#x2B;gite9a5903-2).&#xA;

    &#xA;