Advanced search

Medias (91)

Other articles (37)

  • Publier sur MédiaSpip

    13 June 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Ajouter notes et légendes aux images

    7 February 2011, by

    Pour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
    Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
    Modification lors de l’ajout d’un média
    Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...)

  • Supporting all media types

    13 April 2011, by

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats: images: png, gif, jpg, bmp and more audio: MP3, Ogg, Wav and more video: AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data: OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

On other websites (2819)

  • Pyinstaller exe works halfway on another computer

    5 November 2022, by At Bay

    I wrote a code which uses FFMPEG and os, subprocess, datetime, speechrecognition, and xlsxwriter libraries. Below a brief sketch of the code - it goes through a directory of wav files and creates a transcription for X seconds in length and saves it into an excel sheet.
import os
import subprocess
import datetime
import speech_recognition as sr
import xlsxwriter

    


    def ffmpeg():
   #create clip
   subprocess.run(["ffmpeg", "-ss", starti, "-t", lengthi, "-i", filepathO, filepathNEW1])

   #convert to mono
   subprocess.run(["ffmpeg", "-i", filepathNEW1, "-ac", "1", filepathNEW2])
   
   #compres to 44.1 kHZ
   subprocess.run(["ffmpeg", "-i", filepathNEW2, "-ar", "44100", filepathNEW3])

def transcription():
    with sr.AudioFile(os.path.abspath(clippath)) as source:
       audio = r.record(source)  # read the entire audio file
       transcriptstring = str(r.recognize_google(audio, language = 'en', show_all=True))
       worksheet.write(tcol, transcriptstring)


#call functions in this order
for filename in os.listdir(ufolder):
   if (filename.endswith(".wav")):
       ffmpeg() #cuts clips, compresses to mono and 44.1 khz
       transcription() 

workbook.close()



    


    When I try to run the exe created by pyinstaller, I get the following error:

    


    Enter directory of wav files: C:\Users\myname\Downloads\&#xA;Enter clip start (seconds): 0&#xA;Enter desired clip length (seconds): 5&#xA;Traceback (most recent call last):&#xA;  File "cliptranscript.py", line 134, in <module>&#xA;  File "cliptranscript.py", line 47, in ffmpeg&#xA;  File "subprocess.py", line 503, in run&#xA;  File "subprocess.py", line 971, in __init__&#xA;  File "subprocess.py", line 1440, in _execute_child&#xA;FileNotFoundError: [WinError 2] The system cannot find the file specified&#xA;[13304] Failed to execute script &#x27;cliptranscript&#x27; due to unhandled exception!&#xA;</module>

    &#xA;

    Below is a partial view of the folder created by pyinstaller:&#xA;1

    &#xA;

  • Concatenating trimmed mp4 and mov videos using ffmpeg

    22 September 2022, by Brazol

    I'm trying to concatenate two trimmed videos. When both are encoded with the same codec (or in my case have the same extension) it works fine. But when one is .mp4 (h264) and the other is .mov (hevc) it fails. What can I do to make it work always?

    &#xA;

    My ffmpeg command:

    &#xA;

    -i “path1.mp4" -i “path2.MOV" -filter_complex "[0:v]setdar=9/16,trim=start=0ms:end=2444ms,setpts=PTS-STARTPTS[v0];[0:a]atrim=start=0ms:end=2444ms,asetpts=PTS-STARTPTS[a0];[1:v]setdar=9/16,trim=start=0ms:end=4368ms,setpts=PTS-STARTPTS[v1];[1:a]atrim=start=0ms:end=4368ms,asetpts=PTS-STARTPTS[a1];[v0][a0][v1][a1]concat=n=2:v=1:a=1:unsafe=1[vout][aout]" -map "[vout]" -map "[aout]" -qscale:v 2 -preset veryfast “output.mp4"&#xA;

    &#xA;

    Output with error:

    &#xA;

    Stream mapping:&#xA;Stream #0:0 (aac) -> atrim&#xA;Stream #0:1 (hevc) -> setdar&#xA;Stream #1:0 (aac) -> atrim&#xA;Stream #1:1 (h264) -> setdar&#xA;concat:out:v0 -> Stream #0:0 (mpeg4)&#xA;concat:out:a0 -> Stream #0:1 (aac)&#xA;&#xA;[Parsed_concat_10 @ 0x283185130] Input link in0:v0 parameters (size 720x1280, SAR 1:1) do not match the corresponding output link in0:v0 parameters (2160x3840, SAR 1:1)&#xA;[mp4 @ 0x14af95e80] Frame rate very high for a muxer not efficiently supporting it.&#xA;Please consider specifying a lower framerate, a different muxer or -vsync 2&#xA;[mpeg4 @ 0x14af75a20] timebase 1/1000000 not supported by MPEG 4 standard, the maximum admitted value for the timebase denominator is 65535&#xA;&#xA;Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height&#xA;

    &#xA;

  • PHP-FFMpeg not converting (error with ffmpeg)

    13 August 2016, by Magurean Dan Sergiu

    I have installed ffmpeg server side with all the dependencies, updated it. And then installed PHP-FFMpeg with Composer. Tested that ffmpeg is instaled with a ssh conexion.

    root@host [/opt/ffmpeg]# ffmpeg
    ffmpeg version N-81322-ge8b355a Copyright (c) 2000-2016 the FFmpeg developers
    built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-17)
    configuration: --disable-yasm
    libavutil      55. 28.100 / 55. 28.100
    libavcodec     57. 51.100 / 57. 51.100
    libavformat    57. 46.100 / 57. 46.100
    libavdevice    57.  0.102 / 57.  0.102
    libavfilter     6. 51.100 /  6. 51.100
    libswscale      4.  1.100 /  4.  1.100
    libswresample   2.  1.100 /  2.  1.100
    Hyper fast Audio and Video encoder
    usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options]     outfile}...

    Use -h to get full help or, even better, run 'man ffmpeg'

    But when I try to convert a video file with a php script it throws me a very long error.
    PHP Code:

    &lt;?PHP
    include($_SERVER['DOCUMENT_ROOT']."/vendors/install/vendor/autoload.php");
    $ffmpeg = FFMpeg\FFMpeg::create();
    $video = $ffmpeg->open($_SERVER['DOCUMENT_ROOT'].'/resources/uploads/96048/ffd3c5e349fa5745159deef163b5c253.wmv');
    $video
          ->filters()
          ->synchronize();
    $format = new FFMpeg\Format\Video\X264();
    $format->on('progress', function ($video, $format, $percentage) {
       echo "$percentage % transcoded";});
    $video
         ->save($format,$_SERVER['DOCUMENT_ROOT'].'/resources/uploads/96048/ffd3c5e349fa5745159deef163b5c253.mp4');
    ?>

    Error displayed:

    <b>Fatal error</b>:  Uncaught exception 'Alchemy\BinaryDriver\Exception\ExecutionFailureException' with message 'ffmpeg failed to execute command '/usr/local/bin/ffmpeg' '-y' '-i' '/home/user/working/resources/uploads/23097/2efeb41a1a7085a1dbd469c4895ac23e.wmv' '-async' '1' '-metadata:s:v:0' 'start_time=0' '-threads' '12' '-vcodec' 'libx264' '-acodec' 'libfaac' '-b:v' '1000k' '-refs' '6' '-coder' '1' '-sc_threshold' '40' '-flags' '+loop' '-me_range' '16' '-subq' '7' '-i_qfactor' '0.71' '-qcomp' '0.6' '-qdiff' '4' '-trellis' '1' '-b:a' '128k' '-pass' '1' '-passlogfile' '/tmp/ffmpeg-passes57ad320a1b685j794u/pass-57ad320a1b716' '/home/user/working/resources/uploads/23097/2efeb41a1a7085a1dbd469c4895ac23e.mp4'' in /home/user/working/vendors/install/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php:100↵Stack trace:↵#0 /home/user/working/vendors/install/vendor/alchemy/binary-driver/src/Alchemy/BinaryDriver/ProcessRunner.php(72): Alchemy\BinaryDriver\ProcessRunner-&amp;gt;doExecutionFailure(''/usr/bin/ffmpe...')↵#1 / in <b>/home/user/working/vendors/install/vendor/php-ffmpeg/php-ffmpeg/src/FFMpeg/Media/Video.php</b> on line <b>168</b><br />↵"

    Then I have took the basic code displayed upwards and ran it directly through ssh.

    '/usr/local/bin/ffmpeg' '-y' '-i' '/home/user/working/resources/uploads/23097/2efeb41a1a7085a1dbd469c4895ac23e.wmv' '-async' '1' '-metadata:s:v:0' 'start_time=0' '-threads' '12' '-vcodec' 'libx264' '-acodec' 'libfaac' '-b:v' '1000k' '-refs' '6' '-coder' '1' '-sc_threshold' '40' '-flags' '+loop' '-me_range' '16' '-subq' '7' '-i_qfactor' '0.71' '-qcomp' '0.6' '-qdiff' '4' '-trellis' '1' '-b:a' '128k' '-pass' '1' '-passlogfile' '/tmp/ffmpeg-passes57ad320a1b685j794u/pass-57ad320a1b716' '/home/user/working/resources/uploads/23097/2efeb41a1a7085a1dbd469c4895ac23e.mp4'

    And this is the response I get:

    ffmpeg version N-81322-ge8b355a Copyright (c) 2000-2016 the FFmpeg developers
     built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-17)
     configuration: --disable-yasm
     libavutil      55. 28.100 / 55. 28.100
     libavcodec     57. 51.100 / 57. 51.100
     libavformat    57. 46.100 / 57. 46.100
     libavdevice    57.  0.102 / 57.  0.102
     libavfilter     6. 51.100 /  6. 51.100
     libswscale      4.  1.100 /  4.  1.100
     libswresample   2.  1.100 /  2.  1.100
    Guessed Channel Layout for Input Stream #0.0 : stereo
    Input #0, asf, from '/home/user/working/resources/uploads/23097/2efeb41a1a7085a1dbd469c4895ac23e.wmv':
     Metadata:
       SfOriginalFPS   : 299700
       WMFSDKVersion   : 11.0.6001.7000
       WMFSDKNeeded    : 0.0.0.0000
       comment         : Footage: Small World Productions, Inc; Tourism New Zealand | Producer: Gary F. Spradling | Music: Steve Ball
       title           : Wildlife in HD
       copyright       : © 2008 Microsoft Corporation
       IsVBR           : 0
       DeviceConformanceTemplate: AP@L3
     Duration: 00:00:30.09, start: 0.000000, bitrate: 6977 kb/s
       Stream #0:0(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, 2 channels, fltp, 192 kb/s
       Stream #0:1(eng): Video: vc1 (Advanced) (WVC1 / 0x31435657), yuv420p, 1280x720, 5942 kb/s, 29.97 fps, 29.97 tbr, 1k tbn, 1k tbc
    Unknown encoder 'libx264'

    My question is what to do next? I have wasted 3 days to make this work and this is the furthest I have come. How can I test if libx264 is installed corectly? And if it is not installed corectly how cand I reinstal or make it work?