Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

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

Autres articles (102)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • Menus personnalisés

    14 novembre 2010, par

    MediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
    Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
    Menus créés à l’initialisation du site
    Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...)

Sur d’autres sites (8731)

  • get value from cropdetect

    5 juin 2022, par Greg

    I have been able to parse the output of ffmpeg cropdetect with a batch file in Windows 7 to get crop=640:480:0:0 but the process goes too far and processes the last mp4 or mkv file twice.
I run the first for loop to get a list of mkv or mp4 files in the folder and run a process :gin.
The second for loop to run ffmpeg skipping ahead 30 seconds and run cropdetect on only one second of video with the long file of 60 plus entrys of
[Parsed_cropdetect_0 @ 0000000002ef8f00] x1:0 x2:1279 y1:0 y2:719 w:1280 h:720 x:0 y:0 pts:1081 t:1.081000 crop=1280:720:0:0
going to tmp.txt
Tail gives me the last line of tmp.txt and outputs to a new text file tmp1.txt
The last for loop looks at tmp1.txt and returns the 14th. token of crop=1280:720:0:0

    



    This is a Zeranoe Windows static build and I have tails for windows installed.

    



    I have tried...
different for loops

    



    for %g in (*.mp4, *.mkv) do set this=%g


    



    for /f "delims=*" %g in ('dir /b /o:n *.mp4, *.mkv') set this=%g


    



    I have also tried to have tail output overwrite the input with tail -1 tmp.txt > tmp.txt

    



    this all works but is not as elegant.
what I have so far,

    



    for /f "delims=*" %%g in ('dir /b /o:-n *.m??') do set cdet=%%g&& call :gin

:gin

ffmpeg -hide_banner -ss 00:0:30.000 -i "%cdet%" -t 1 -vf cropdetect -f null -2>&1 | findstr /c:"crop=" > tmp.txt 

tail -1 tmp.txt  >tmp1.txt

for /f "usebackq tokens=14" %%a in ("tmp1.txt") do set line=%%a

del tmp*.txt

echo %line%


    



    I would like to see if there is a better way to do this without creating temp files and overwriting already processed files.

    



    for those interested the updated script is :

    



    for /F "eol=| delims=" %%I in ('dir /a-d /b /o:-n *.mkv 2^>nul') do set "cdet=%%I" && call :gin

goto :end
:gin
ffmpeg -hide_banner -ss 00:0:30.000 -i "%cdet%" -t 1 -vf cropdetect -f null - 2>&1 | findstr /c:"crop=" >tmp1.txt
for /f "usebackq tokens=14" %%a in ("tmp1.txt") do set line=%%a
del tmp*.txt
echo %line%
pause
:end
exit /b


    


  • A 'clean' way to cut an MP4 movie into two sections using FFMPEG ?

    30 août 2020, par Peter in Japan

    I am attempting to use FFMPEG to make a script that can easily split a short MP4 movie with sound into two pieces at a certain point. I've searched through what feels like hundreds of posts to try to find "the" answer, but most of my attempts end up with poor results, broken video files that cause my video play to freeze, and so on. I am attempting to make a script that allows me to easily cut a short anime movie (something grabbed from Twitter or some other short source) and cut it into two sections, so it can be under the 2:20 Twitter time limit, or to cut out some scene I don't want to show my followers.

    


    The issue is that FFMPEG is good at cutting videos into segments, but bad at know where keyframes are, so most videos have two seconds of blank video at the front before some keyframe appears, which looks terrible.

    


    One example I found that works well is below, which cuts any mp4 into a bunch of chunks of n second size (six seconds in the example below). Source and documentation for this is https://moe.vg/3b8eNTs

    


    ffmpeg -i seitokai.mp4 -c:v libx264 -crf 22 -map 0 -segment_time 6 -reset_timestamps 1 -g 30 -sc_threshold 0 -force_key_frames "expr:gte(t,n_forced*1)" -f segment output%03d.mp4

    


    This code works great, at least allowing me to access the "left" side of a video that I want, in this case a six-second segment I want. Can anyone tell me how to accomplish the above, but starting at the 13-second period in said video, so I could get right "right" (not starting from 00:00:00) video cut cleanly ?

    


    Alternately, a single, unified and elegant way to split (re-encode) an MP4 into two segments that forces keyframes from the very beginning of the cut pieces would be wonderful. I can't believe how hard this seems to be.

    


    Thanks in advance for any help you can give ! Greetings from rural Japan !

    


  • libswscale bad dst image pointers cgo

    28 août 2020, par SolskGaer

    I am trying to use libswscale to scale image before encoding to h264 using cgo. Here I wrote a simple demo(sorry for the bad code style, I just want to do quick verification) :

    


    func scale(img []byte, scaleFactor int) {
    input, _, _ := image.Decode(bytes.NewReader(img))
    if a, ok := input.(*image.YCbCr); ok {
        width, height := a.Rect.Dx(), a.Rect.Dy()
        var format C.enum_AVPixelFormat = C.AV_PIX_FMT_YUV420P
        context := C.sws_getContext(C.int(width), C.int(height), format, C.int(width/scaleFactor), C.int(height/scaleFactor), 0, C.int(0x10), nil, nil, nil)
        in := make([]uint8, 0)
        in = append(in, a.Y...)
        in = append(in, a.Cb...)
        in = append(in, a.Cr...)
        stride := []C.int{C.int(width), C.int(width / 2), C.int(width / 2), 0}
        outstride := []C.int{C.int(width / scaleFactor), C.int(width / scaleFactor / 2), C.int(width / scaleFactor / 2), 0}
        out := make([]uint8, width*height/scaleFactor/scaleFactor*3/2)
        C.sws_scale(context, (**C.uint8_t)(unsafe.Pointer(&in[0])), (*C.int)(&stride[0]), 0,
            C.int(height), (**C.uint8_t)(unsafe.Pointer(&out[0])), (*C.int)(&outstride[0]))
        min := image.Point{0, 0}
        max := image.Point{width / scaleFactor, height / scaleFactor}
        output := image.NewYCbCr(image.Rectangle{Min: min, Max: max}, image.YCbCrSubsampleRatio420)
        paneSize := width * height / scaleFactor / scaleFactor
        output.Y = out[:paneSize]
        output.Cb = out[paneSize : paneSize*5/4]
        output.Cr = out[paneSize*5/4:]
        opt := jpeg.Options{
            Quality: 90,
        }
        f, _ := os.Create("img.jpeg")
        jpeg.Encode(f, output, &opt)
    }
}



    


    Everytime I run the code snippet, I got an error saying bad dst image pointers, what is the problem of my code. I am new to cgo, so the code is probably silly to you, I apology for that.
If you have more elegant way to achieve the functionality, I am all ears. Any suggestion would be appreciated.