Recherche avancée

Médias (2)

Mot : - Tags -/doc2img

Autres articles (43)

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

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

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

Sur d’autres sites (6875)

  • OSError : [Errno 13] Permission denied when running python code called extract.py

    26 avril 2017, par aisunshinehui

    ffmpeg.py :

    def resize(videoName, resizedName):
       if not os.path.exists(videoName):
         print '%s does not exist!' % videoName
         return False
       # call ffmpeg and grab its stderr output
       p = subprocess.Popen([ffmpeg, "-i", videoName],stderr=subprocess.PIPE)
       out, err = p.communicate()
       # search resolution info
       if err.find('differs from') > -1:
         return False
       reso = re.findall(r'Video.*, ([0-9]+)x([0-9]+)', err)
       if len(reso) < 1:
          return False
       # call ffmpeg again to resize
       subprocess.call([ffmpeg, '-i', videoName, '-s', '160 x 120', resizedName])
       return check(resizedName)

    # check the video file is corrupted or not
    def check(videoName):
        if not os.path.exists(videoName):
           return False
        p = subprocess.Popen([ffmpeg, "-i", videoName], stderr=subprocess.PIPE)
        out, err = p.communicate()
        if err.find('Invalid') > -1:
           return False
        return True

    extract.py :

    def extract(videoName, outputBase):
       if not os.path.exists(videoName):
           print '%s does not exist!' % videoName
           return False
       if check_dup(outputBase):
           print '%s processed' % videoName
           return True
       resizedName = os.path.join(tmpDir, os.path.basename(videoName))
       if not ffmpeg.resize(videoName, resizedName):
           resizedName = videoName     # resize failed, just use the input video
       subprocess.call('%s %s | %s %s %s %s' % (dtBin, resizedName, fvBin, pcaList, codeBookList, outputBase), shell=True)
       return True

    def check_dup(outputBase):
       """
       Check if fv of all modalities have been extracted
       """
       featTypes = ['traj', 'hog', 'hof', 'mbhx', 'mbhy']
       featDims = [20, 48, 54, 48, 48]
       for i in range(len(featTypes)):
           featName = '%s.%s.fv.txt' % (outputBase, featTypes[i])
           if not os.path.isfile(featName) or not os.path.getsize(featName) > 0:
               return False
           # check if the length of feature can be fully divided by featDims
           f = open(featName)
           featLen = len(f.readline().rstrip().split())
           f.close()
           if featLen % (featDims[i] * 512) > 0:
               return False
       return True

    i run the extract.py in the terminal and error occurred as follows,then add sudo and run chmod 777 -R /usr/lib/python2.7 to change the permission but it doesn`t work !

    aisunshinehui@aisunshinehui : /program/dtfv/script$ sudo python extract_fv.py /home/aisunshinehui/program/dtfv/script/videolist/video.txt

    /home/aisunshinehui/program/dtfv/script/output/ 1
    [sudo] password for aisunshinehui:
       0 /home/aisunshinehui/program/dtfv/script/videolist
     Traceback (most recent call last):
         File "extract_fv.py", line 63, in <module>
           extract(videos[i], outputName)
         File "extract_fv.py", line 27, in extract
           if not ffmpeg.resize(videoName, resizedName):
         File "/home/aisunshinehui/program/dtfv/script/ffmpeg.py", line 17, in resize
           p = subprocess.Popen([ffmpeg, "-i", videoName], stderr=subprocess.PIPE)
         File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
           errread, errwrite)
         File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
           raise child_exception
       OSError: [Errno 13] Permission denied
    </module>

    help me !

  • java.io.IOException : Error running exec() Working Directory : null Environment : null

    16 janvier 2018, par Muhammad Hamza Shahid

    I am using WritingMinds/ffmpeg-android-java in application.

    here is my code

    loadFFmpeg();
    String cmd="ffmpeg -i /storage/emulated/0/media/audio/a.mp3 -i  /storage/emulated/0/recording.3gp -filter_complex \"[0:a][1:a]amerge=inputs=2[aout]\" -map \"[aout]\" " + outputFile;
    executeFFmpeg(cmd.split(" "));

    and

    private void loadFFmpeg() {
       FFmpeg ffmpeg = FFmpeg.getInstance(MainActivity.this.getApplicationContext());
       try {
           ffmpeg.loadBinary(new LoadBinaryResponseHandler() {

               @Override
               public void onStart() {}

               @Override
               public void onFailure() {}

               @Override
               public void onSuccess() {}

               @Override
               public void onFinish() {}
           });
       } catch (FFmpegNotSupportedException e) {
           // Handle if FFmpeg is not supported by device
       }
    }

    private void executeFFmpeg(String[] cmd)
    {
       /*String workFolder = getApplicationContext().getFilesDir() + "/ffmpeg";
       String environment = Environment.getExternalStorageDirectory().getAbsolutePath();
       Map map = new HashMap();
       map.put("Working Directory", workFolder);
       map.put("Environment",environment);*/
       FFmpeg ffmpeg = FFmpeg.getInstance(MainActivity.this.getApplicationContext());
       try {
           // to execute "ffmpeg -version" command you just need to pass "-version"
           ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler() {

               @Override
               public void onStart() {}

               @Override
               public void onProgress(String message) {}

               @Override
               public void onFailure(String message) {}

               @Override
               public void onSuccess(String message) {}

               @Override
               public void onFinish() {
                   stop.setEnabled(false);
                   play.setEnabled(true);
               }
           });
       } catch (FFmpegCommandAlreadyRunningException e) {
           // Handle if FFmpeg is already running
       }
    }

    but I am getting following error

    6784-6962/com.flipartstudio.playandrecord E/FFmpeg : Exception while trying to run : [Ljava.lang.String ;@41803270
    java.io.IOException : Error running exec(). Command : [/data/data/com.flipartstudio.playandrecord/files/ffmpeg, /system/bin/ls, -l, /data/data/com.example.foo/files/ffmpeg] Working Directory : null Environment : null
    at java.lang.ProcessManager.exec(ProcessManager.java:211)
    at java.lang.Runtime.exec(Runtime.java:168)
    at java.lang.Runtime.exec(Runtime.java:123)
    at com.github.hiteshsondhi88.libffmpeg.ShellCommand.run(ShellCommand.java:10)
    at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:38)
    at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:10)
    at android.os.AsyncTask$2.call(AsyncTask.java:287)
    at java.util.concurrent.FutureTask.run(FutureTask.java:234)
    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
    at java.lang.Thread.run(Thread.java:856)
    Caused by : java.io.IOException : No such file or directory
    at java.lang.ProcessManager.exec(Native Method)
    at java.lang.ProcessManager.exec(ProcessManager.java:209)
    at java.lang.Runtime.exec(Runtime.java:168) 
    at java.lang.Runtime.exec(Runtime.java:123) 
    at com.github.hiteshsondhi88.libffmpeg.ShellCommand.run(ShellCommand.java:10) 
    at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:38) 
    at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:10) 
    at android.os.AsyncTask$2.call(AsyncTask.java:287) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:234) 
    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 
    at java.lang.Thread.run(Thread.java:856) 

    I have also added

  • java.io.IOException : Error running exec() Working Directory : null Environment : null

    23 janvier 2017, par Muhammad Hamza Shahid

    I am using WritingMinds/ffmpeg-android-java in application.

    here is my code

    loadFFmpeg();
    String cmd="ffmpeg -i /storage/emulated/0/media/audio/a.mp3 -i  /storage/emulated/0/recording.3gp -filter_complex \"[0:a][1:a]amerge=inputs=2[aout]\" -map \"[aout]\" " + outputFile;
    executeFFmpeg(cmd.split(" "));

    and

    private void loadFFmpeg() {
       FFmpeg ffmpeg = FFmpeg.getInstance(MainActivity.this.getApplicationContext());
       try {
           ffmpeg.loadBinary(new LoadBinaryResponseHandler() {

               @Override
               public void onStart() {}

               @Override
               public void onFailure() {}

               @Override
               public void onSuccess() {}

               @Override
               public void onFinish() {}
           });
       } catch (FFmpegNotSupportedException e) {
           // Handle if FFmpeg is not supported by device
       }
    }

    private void executeFFmpeg(String[] cmd)
    {
       /*String workFolder = getApplicationContext().getFilesDir() + "/ffmpeg";
       String environment = Environment.getExternalStorageDirectory().getAbsolutePath();
       Map map = new HashMap();
       map.put("Working Directory", workFolder);
       map.put("Environment",environment);*/
       FFmpeg ffmpeg = FFmpeg.getInstance(MainActivity.this.getApplicationContext());
       try {
           // to execute "ffmpeg -version" command you just need to pass "-version"
           ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler() {

               @Override
               public void onStart() {}

               @Override
               public void onProgress(String message) {}

               @Override
               public void onFailure(String message) {}

               @Override
               public void onSuccess(String message) {}

               @Override
               public void onFinish() {
                   stop.setEnabled(false);
                   play.setEnabled(true);
               }
           });
       } catch (FFmpegCommandAlreadyRunningException e) {
           // Handle if FFmpeg is already running
       }
    }

    but I am getting following error

    6784-6962/com.flipartstudio.playandrecord E/FFmpeg : Exception while trying to run : [Ljava.lang.String ;@41803270
    java.io.IOException : Error running exec(). Command : [/data/data/com.flipartstudio.playandrecord/files/ffmpeg, /system/bin/ls, -l, /data/data/com.example.foo/files/ffmpeg] Working Directory : null Environment : null
    at java.lang.ProcessManager.exec(ProcessManager.java:211)
    at java.lang.Runtime.exec(Runtime.java:168)
    at java.lang.Runtime.exec(Runtime.java:123)
    at com.github.hiteshsondhi88.libffmpeg.ShellCommand.run(ShellCommand.java:10)
    at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:38)
    at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:10)
    at android.os.AsyncTask$2.call(AsyncTask.java:287)
    at java.util.concurrent.FutureTask.run(FutureTask.java:234)
    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
    at java.lang.Thread.run(Thread.java:856)
    Caused by : java.io.IOException : No such file or directory
    at java.lang.ProcessManager.exec(Native Method)
    at java.lang.ProcessManager.exec(ProcessManager.java:209)
    at java.lang.Runtime.exec(Runtime.java:168) 
    at java.lang.Runtime.exec(Runtime.java:123) 
    at com.github.hiteshsondhi88.libffmpeg.ShellCommand.run(ShellCommand.java:10) 
    at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:38) 
    at com.github.hiteshsondhi88.libffmpeg.FFmpegExecuteAsyncTask.doInBackground(FFmpegExecuteAsyncTask.java:10) 
    at android.os.AsyncTask$2.call(AsyncTask.java:287) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:234) 
    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 
    at java.lang.Thread.run(Thread.java:856) 

    I have also added