Recherche avancée

Médias (91)

Autres articles (38)

  • 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 ;

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

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (5874)

  • OpenCV VideoWriter produces "can't find starting number" error

    5 avril 2020, par user3325139

    I am trying to write 16-bit grayscale video using the FFV1 codec and opencv.ImageWriter on Windows 10

    



    Here is my code :

    



    import numpy as np
import cv2, pdb

print(cv2.getBuildInformation())

def to8(img):
    return (img/256).astype('uint8')

cap = cv2.VideoCapture(0+cv2.CAP_DSHOW)
cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc('Y','1','6',' '))
cap.set(cv2.CAP_PROP_CONVERT_RGB, False)

out = cv2.VideoWriter('out.avi', cv2.VideoWriter_fourcc('F','F','V','1'), cap.get(cv2.CAP_PROP_FPS), (int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)),int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))))

while True:
    ret, frame = cap.read()
    frame = cv2.normalize(frame,None,0,65535,cv2.NORM_MINMAX)

    cv2.imshow('Video',to8(frame))
    out.write(frame)

    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
cap.release()
out.release()
cv2.destroyAllWindows()


    



    And here is my error :

    



    [ERROR:0] global C:\projects\opencv-python\opencv\modules\videoio\src\cap.cpp (415) cv::VideoWriter::open VIDEOIO(CV_IMAGES): raised OpenCV exception:

OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\videoio\src\cap_images.cpp:253: error: (-5:Bad argument) CAP_IMAGES: can't find starting number (in the name of file): out.avi in function 'cv::icvExtractPattern'


    



    I am running this script from a command window with admin privileges. I've tried both making sure the output file does and does not exist before running.

    



    My OpenCV build information is here : https://pastebin.com/whtF6ixG

    



    Thanks !

    



    EDIT :
Based on Rotem's suggestion, instead of using VideoWriter I piped directly to FFMPEG using ffmpeg-python :

    



    import numpy as np
import cv2, pdb
import ffmpeg

def to8(img):
    return (img/256).astype('uint8')

cap = cv2.VideoCapture(0+cv2.CAP_DSHOW)
cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc('Y','1','6',' '))
cap.set(cv2.CAP_PROP_CONVERT_RGB, False)

ff_proc = (
    ffmpeg
    .input('pipe:',format='rawvideo',pix_fmt='gray16le',s='%sx%s'%(int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)),int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))),r='60')
    .output('out3.avi',vcodec='ffv1',an=None)
    .run_async(pipe_stdin=True)
)

while True:
    ret, frame = cap.read()

    cv2.imshow('Video',to8(frame))
    ff_proc.stdin.write(frame)

    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

out.terminate()
cap.release()
cv2.destroyAllWindows()


    


  • java.io.IOException : Cannot run program "/data/user/0/com.package.name/files/ffmpeg" : error=13, Permission denied

    12 avril 2020, par KANAYO AUGUSTIN UG

    I am trying to cut a video using FFmpeg library from com.writingminds:FFmpegAndroid:0.3.2...
When I try to run my command

    



    String[] complexCommand = { "-y", "-i", inputFilePath,"-ss", "" + trimStart, "-t", "" + trim, "-c","copy", outputFilePath};
execFFmpegBinary(complexCommand);


    



    I get this error :

    



    


    E/FFmpeg : Exception while trying to run : [Ljava.lang.String ;@c7a48dd

    
 


    java.io.IOException : Cannot run program "/data/user/0/com.package.name/files/ffmpeg" : error=13, Permission denied

    


    



    Even after making sure the library loaded successfully

    



    private void loadFFMpegBinary() {
    try {
        if (ffmpeg == null) {
            ffmpeg = FFmpeg.getInstance(cntxt);
        }
        ffmpeg.loadBinary(new LoadBinaryResponseHandler() {
            @Override
            public void onFailure() {
                Log.i("success", "false");
            }

            @Override
            public void onSuccess() {
                Log.i("success", "true");
            }
        });
    } catch (FFmpegNotSupportedException e) {
    } catch (Exception e) {
    }
}


    



    I have enabled WRITE_PERMISSION in Android.manifest file, and I also tried to write a file to the storage and it worked.

    



    I guess FFmpeg has a default path to write a file which is /data/user/0/com.package.name/files/ffmpeg, but I need to change the default path please anyone with an idea ?

    


  • "Couldn't find ffmpeg or avconv" error while importing pydub

    14 avril 2020, par Vidya Reddy

    I am trying to convert .mp3 file to .wav. I am facing issue. I have tried all the suggestions given in stackoverflow but no use. ffmpeg is also installed successfully. Please find below code I am using

    



    from pydub import AudioSegment
src = 'Audio_1.mp3'
dst = 'Audio_2.wav'
sound = AudioSegment.from_mp3(src)
sound.export(dst, format="wav")


    



    I am facing below errors :

    



    RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work
FileNotFoundError: [WinError 2] The system cannot find the file specified


    



    I have tried all the existing solutions in stackoverflow but nothing could help. ffmpeg is installed successfully but still the issue. Please help me in this