Recherche avancée

Médias (91)

Autres articles (57)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • Sélection de projets utilisant MediaSPIP

    29 avril 2011, par

    Les exemples cités ci-dessous sont des éléments représentatifs d’usages spécifiques de MediaSPIP pour certains projets.
    Vous pensez avoir un site "remarquable" réalisé avec MediaSPIP ? Faites le nous savoir ici.
    Ferme MediaSPIP @ Infini
    L’Association Infini développe des activités d’accueil, de point d’accès internet, de formation, de conduite de projets innovants dans le domaine des Technologies de l’Information et de la Communication, et l’hébergement de sites. Elle joue en la matière un rôle unique (...)

Sur d’autres sites (3709)

  • Windows Batch - Change the beginning of a path but keep the rest

    21 juin 2014, par o_ren

    I’m running FFMPEG for video encoding.
    I have a batch file which will encode files you drop on it, keeping the file’s original name and copy the encoded files to a specific directory.
    I would like that script to "know" the original’s file path and copy the encoded file to a path relative to it, meaning :
    original file dropped on batch file is in C :\some\folder\show\season\episode\file.mov
    encoded file should be encoded to D :\different\directory\show\season\episode\file.mp4
    The part of the path up until \show is fixed.

    This is what I have so far :

    @echo on

    set count=0
    for %%a in (%*) do (<br />
     if exist %%a (

           md \\specific\path\"%%~na"

           %MYFILES%\ffmpeg.exe -i "%%~a" -vcodec libx264 -preset medium -vprofile baseline -level 3.0 -b 500k -vf scale=640:-1 -acodec aac -strict -2 -ac 2 -ab 64k -ar 48000 "%%~na_500.mp4"
           copy "%%~na_500.mp4" "\\specific\path\"%%~na"\%%~na_500.mp4"
           copy "%%~na_500.mp4" "\\specific\path\"%%~na"\%%~na_500.mp4"
           del "%%~na_500.mp4"

    set /a count+=1

    ) else (
    echo Skipping non-existent %% a

    Thank you,
    Oren

  • How to extract subtitles from .wtv file using ffmpeg ?

    20 mai 2013, par user1978421

    does anyone know how to extract subtitles from a wtv file using ffmpeg ?
    i have tried many different commands. None of them works.
    the closest is this one

    ffmpeg -i input.wtv -vn -an -codec:s:0 srt test.srt

    But it complains Error while encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

    what does that really mean ??

    The complete console output is as follows

    ffmpeg version N-52233-gee94362 Copyright (c) 2000-2013 the FFmpeg developers
     built on Apr 18 2013 02:50:33 with gcc 4.8.0 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
     libavutil      52. 26.100 / 52. 26.100
     libavcodec     55.  2.100 / 55.  2.100
     libavformat    55.  2.100 / 55.  2.100
     libavdevice    55.  0.100 / 55.  0.100
     libavfilter     3. 56.103 /  3. 56.103
     libswscale      2.  2.100 /  2.  2.100
     libswresample   0. 17.102 /  0. 17.102
     libpostproc    52.  3.100 / 52.  3.100
    [wtv @ 0269bac0] truncated file
       Last message repeated 3 times
    [mpeg2video @ 02692f60] Invalid frame dimensions 0x0.
       Last message repeated 12 times
    [wtv @ 0269bac0] max_analyze_duration 5000000 reached at 5016000 microseconds
    Input #0, wtv, from &#39;16 and Pregnant- Unseen Moments_Viva_2013_04_09_19_57_00.wtv&#39;:
     Metadata:
       WM/MediaClassPrimaryID: db9830bd-3ab3-4fab-8a371a995f7ff74
       WM/MediaClassSecondaryID: ba7f258a-62f7-47a9-b21f4651c42a000
       Title           : 16 and Pregnant: Unseen Moments
       WM/SubTitleDescription: Dr Drew hosts a look at the exclusive moments we didn&#39;t see from the second season of 16 and Pregnant.
       genre           : Documentary;Reality TV
       WM/OriginalReleaseTime: 0
       WM/MediaCredits : ;;;
       service_provider: Viva
       service_name    : Viva
       WM/MediaOriginalChannel: 16
       WM/MediaOriginalChannelSubNumber: 0
       WM/MediaOriginalBroadcastDateTime: 2011-12-13T00:00:00Z
       WM/MediaOriginalRunTime: 38377217299
       WM/MediaIsStereo: false
       WM/MediaIsRepeat: true
       WM/MediaIsLive  : false
       WM/MediaIsTape  : false
       WM/MediaIsDelay : false
       WM/MediaIsSubtitled: false
       WM/MediaIsMovie : false
       WM/MediaIsPremiere: false
       WM/MediaIsFinale: false
       WM/MediaIsSAP   : false
       WM/MediaIsSport : false
       WM/Provider     : MediaCenterDefault
       WM/VideoClosedCaptioning: false
       WM/WMRVEncodeTime: 2013-04-09 18:57:02
       WM/WMRVSeriesUID: !GenericSeries!16 and Pregnant: Unseen Moments
       WM/WMRVServiceID: !Generated!be3ff88ee57a4cadb0334ef3df5bc91b
       WM/WMRVProgramID: !MCProgram!37282063
       WM/WMRVRequestID: 0
       WM/WMRVScheduleItemID: 0
       WM/WMRVQuality  : 0
       WM/WMRVOriginalSoftPrePadding: 480
       WM/WMRVOriginalSoftPostPadding: 60
       WM/WMRVHardPrePadding: -300
       WM/WMRVHardPostPadding: 0
       WM/WMRVATSCContent: false
       WM/WMRVDTVContent: true
       WM/WMRVHDContent: false
       Duration        : 38379654765
       WM/WMRVEndTime  : 2013-04-09 20:01:00
       WM/WMRVBitrate  : 2.118481
       WM/WMRVKeepUntil: 0
       WM/WMRVActualSoftPrePadding: 477
       WM/WMRVActualSoftPostPadding: 60
       WM/WMRVContentProtected: false
       WM/WMRVContentProtectedPercent: 0
       WM/WMRVExpirationSpan: 9223372036854775807
       WM/WMRVInBandRatingSystem: 255
       WM/WMRVInBandRatingLevel: 255
       WM/WMRVInBandRatingAttributes: 0
       WM/WMRVWatched  : true
     Duration: 01:03:58.07, start: 1.509175, bitrate: 2118 kb/s
       Stream #0:0[0x22](eng): Subtitle: dvb_subtitle
       Stream #0:1[0x23](eng): Audio: mp2 (P[0][0][0] / 0x0050), 48000 Hz, stereo, s16p, 256 kb/s
       Stream #0:2[0x24]: Video: mpeg2video (Main), yuv420p, 544x576 [SAR 32:17 DAR 16:9], 25 fps, 25 tbr, 10000k tbn, 50 tbc
       Stream #0:3[0x0]: Video: mjpeg, yuvj420p, 189x200 [SAR 96:96 DAR 189:200], 90k tbr, 90k tbn, 90k tbc
       Metadata:
         title           : TV Thumbnail
    File &#39;test.srt&#39; already exists. Overwrite ? [y/N] Output #0, srt, to &#39;test.srt&#39;:
     Metadata:
       WM/MediaClassPrimaryID: db9830bd-3ab3-4fab-8a371a995f7ff74
       WM/MediaClassSecondaryID: ba7f258a-62f7-47a9-b21f4651c42a000
       Title           : 16 and Pregnant: Unseen Moments
       WM/SubTitleDescription: Dr Drew hosts a look at the exclusive moments we didn&#39;t see from the second season of 16 and Pregnant.
       genre           : Documentary;Reality TV
       WM/OriginalReleaseTime: 0
       WM/MediaCredits : ;;;
       service_provider: Viva
       service_name    : Viva
       WM/MediaOriginalChannel: 16
       WM/MediaOriginalChannelSubNumber: 0
       WM/MediaOriginalBroadcastDateTime: 2011-12-13T00:00:00Z
       WM/MediaOriginalRunTime: 38377217299
       WM/MediaIsStereo: false
       WM/MediaIsRepeat: true
       WM/MediaIsLive  : false
       WM/MediaIsTape  : false
       WM/MediaIsDelay : false
       WM/MediaIsSubtitled: false
       WM/MediaIsMovie : false
       WM/MediaIsPremiere: false
       WM/MediaIsFinale: false
       WM/MediaIsSAP   : false
       WM/MediaIsSport : false
       WM/Provider     : MediaCenterDefault
       WM/VideoClosedCaptioning: false
       WM/WMRVEncodeTime: 2013-04-09 18:57:02
       WM/WMRVSeriesUID: !GenericSeries!16 and Pregnant: Unseen Moments
       WM/WMRVServiceID: !Generated!be3ff88ee57a4cadb0334ef3df5bc91b
       WM/WMRVProgramID: !MCProgram!37282063
       WM/WMRVRequestID: 0
       WM/WMRVScheduleItemID: 0
       WM/WMRVQuality  : 0
       WM/WMRVOriginalSoftPrePadding: 480
       WM/WMRVOriginalSoftPostPadding: 60
       WM/WMRVHardPrePadding: -300
       WM/WMRVHardPostPadding: 0
       WM/WMRVATSCContent: false
       WM/WMRVDTVContent: true
       WM/WMRVHDContent: false
       Duration        : 38379654765
       WM/WMRVEndTime  : 2013-04-09 20:01:00
       WM/WMRVBitrate  : 2.118481
       WM/WMRVKeepUntil: 0
       WM/WMRVActualSoftPrePadding: 477
       WM/WMRVActualSoftPostPadding: 60
       WM/WMRVContentProtected: false
       WM/WMRVContentProtectedPercent: 0
       WM/WMRVExpirationSpan: 9223372036854775807
       WM/WMRVInBandRatingSystem: 255
       WM/WMRVInBandRatingLevel: 255
       WM/WMRVInBandRatingAttributes: 0
       WM/WMRVWatched  : true
       Stream #0:0(eng): Subtitle: srt
    Stream mapping:
     Stream #0:0 -> #0:0 (dvbsub -> srt)
    Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
  • What's the most desireable way to capture system display and audio in the form of individual encoded audio and video packets in go (language) ? [closed]

    11 janvier 2023, par Tiger Yang

    Question (read the context below first) :

    &#xA;

    For those of you familiar with the capabilities of go, Is there a better way to go about all this ? Since ffmpeg is so ubiquitous, I'm sure it's been optomized to perfection, but what's the best way to capture system display and audio in the form of individual encoded audio and video packets in go (language), so that they can be then sent via webtransport-go ? I wish for it to prioritize efficiency and low latency, and ideally capture and encode the framebuffer directly like ffmpeg does.

    &#xA;

    Thanks ! I have many other questions about this, but I think it's best to ask as I go.

    &#xA;

    Context and what I've done so far :

    &#xA;

    I'm writing a remote desktop software for my personal use because of grievances with current solutions out there. At the moment, it consists of a web app that uses the webtransport API to send input datagrams and receive AV packets on two dedicated unidirectional streams, and the webcodecs API to decode these packets. On the serverside, I originally planned to use python with the aioquic library as a webtransport server. Upon connection and authentication, the server would start ffmpeg as a subprocess with this command :

    &#xA;

    ffmpeg -init_hw_device d3d11va -filter_complex ddagrab=video_size=1920x1080:framerate=60 -vcodec hevc_nvenc -tune ll -preset p7 -spatial_aq 1 -temporal_aq 1 -forced-idr 1 -rc cbr -b:v 400K -no-scenecut 1 -g 216000 -f hevc -

    &#xA;

    What I really appreciate about this is that it uses windows' desktop duplication API to copy the framebuffer of my GPU and hand that directly to the on-die hardware encoder with zero round trips to the CPU. I think it's about as efficient and elegant a solution as I can manage. It then outputs the encoded stream to the stdout, which python can read and send to the client.

    &#xA;

    As for the audio, there is another ffmpeg instance :

    &#xA;

    ffmpeg -f dshow -channels 2 -sample_rate 48000 -sample_size 16 -audio_buffer_size 15 -i audio="RD Audio (High Definition Audio Device)" -acodec libopus -vbr on -application audio -mapping_family 0 -apply_phase_inv true -b:a 25K -fec false -packet_loss 0 -map 0 -f data -

    &#xA;

    which listens to a physical loopback interface, which is literally just a short wire bridging the front panel headphone and microphone jacks (I'm aware of the quality loss of converting to analog and back, but the audio is then crushed down to 25kbps so it's fine) ()

    &#xA;

    Unfortunately, aioquic was not easy to work with IMO, and I found webtransport-go https://github.com/adriancable/webtransport-go, which was a hell of a lot better in both simplicity and documentation. However, now I'm dealing with a whole new language, and I wanna ask : (above)

    &#xA;

    EDIT : Here's the code for my server so far :

    &#xA;

    &#xD;&#xA;
    &#xD;&#xA;
    package main&#xA;&#xA;import (&#xA;    "bytes"&#xA;    "context"&#xA;    "fmt"&#xA;    "log"&#xA;    "net/http"&#xA;    "os/exec"&#xA;    "time"&#xA;&#xA;    "github.com/adriancable/webtransport-go"&#xA;)&#xA;&#xA;func warn(str string) {&#xA;    fmt.Printf("\n===== WARNING ===================================================================================================\n   %s\n=================================================================================================================\n", str)&#xA;}&#xA;&#xA;func main() {&#xA;&#xA;    password := []byte("abc")&#xA;&#xA;    videoString := []string{&#xA;        "ffmpeg",&#xA;        "-init_hw_device", "d3d11va",&#xA;        "-filter_complex", "ddagrab=video_size=1920x1080:framerate=60",&#xA;        "-vcodec", "hevc_nvenc",&#xA;        "-tune", "ll",&#xA;        "-preset", "p7",&#xA;        "-spatial_aq", "1",&#xA;        "-temporal_aq", "1",&#xA;        "-forced-idr", "1",&#xA;        "-rc", "cbr",&#xA;        "-b:v", "500K",&#xA;        "-no-scenecut", "1",&#xA;        "-g", "216000",&#xA;        "-f", "hevc", "-",&#xA;    }&#xA;&#xA;    audioString := []string{&#xA;        "ffmpeg",&#xA;        "-f", "dshow",&#xA;        "-channels", "2",&#xA;        "-sample_rate", "48000",&#xA;        "-sample_size", "16",&#xA;        "-audio_buffer_size", "15",&#xA;        "-i", "audio=RD Audio (High Definition Audio Device)",&#xA;        "-acodec", "libopus",&#xA;        "-mapping_family", "0",&#xA;        "-b:a", "25K",&#xA;        "-map", "0",&#xA;        "-f", "data", "-",&#xA;    }&#xA;&#xA;    connected := false&#xA;&#xA;    http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {&#xA;        session := request.Body.(*webtransport.Session)&#xA;&#xA;        session.AcceptSession()&#xA;        fmt.Println("\nAccepted incoming WebTransport connection.")&#xA;        fmt.Println("Awaiting authentication...")&#xA;&#xA;        authData, err := session.ReceiveMessage(session.Context()) // Waits here till first datagram&#xA;        if err != nil {                                            // if client closes connection before sending anything&#xA;            fmt.Println("\nConnection closed:", err)&#xA;            return&#xA;        }&#xA;&#xA;        if len(authData) >= 2 &amp;&amp; bytes.Equal(authData[2:], password) {&#xA;            if connected {&#xA;                session.CloseSession()&#xA;                warn("Client has authenticated, but a session is already taking place! Connection closed.")&#xA;                return&#xA;            } else {&#xA;                connected = true&#xA;                fmt.Println("Client has authenticated!\n")&#xA;            }&#xA;        } else {&#xA;            session.CloseSession()&#xA;            warn("Client has failed authentication! Connection closed. (" &#x2B; string(authData[2:]) &#x2B; ")")&#xA;            return&#xA;        }&#xA;&#xA;        videoStream, _ := session.OpenUniStreamSync(session.Context())&#xA;&#xA;        videoCmd := exec.Command(videoString[0], videoString[1:]...)&#xA;        go func() {&#xA;            videoOut, _ := videoCmd.StdoutPipe()&#xA;            videoCmd.Start()&#xA;&#xA;            buffer := make([]byte, 15000)&#xA;            for {&#xA;                len, err := videoOut.Read(buffer)&#xA;                if err != nil {&#xA;                    break&#xA;                }&#xA;                if len > 0 {&#xA;                    videoStream.Write(buffer[:len])&#xA;                }&#xA;            }&#xA;        }()&#xA;&#xA;        time.Sleep(50 * time.Millisecond)&#xA;&#xA;        audioStream, err := session.OpenUniStreamSync(session.Context())&#xA;&#xA;        audioCmd := exec.Command(audioString[0], audioString[1:]...)&#xA;        go func() {&#xA;            audioOut, _ := audioCmd.StdoutPipe()&#xA;            audioCmd.Start()&#xA;&#xA;            buffer := make([]byte, 15000)&#xA;            for {&#xA;                len, err := audioOut.Read(buffer)&#xA;                if err != nil {&#xA;                    break&#xA;                }&#xA;                if len > 0 {&#xA;                    audioStream.Write(buffer[:len])&#xA;                }&#xA;            }&#xA;        }()&#xA;&#xA;        for {&#xA;            data, err := session.ReceiveMessage(session.Context())&#xA;            if err != nil {&#xA;                videoCmd.Process.Kill()&#xA;                audioCmd.Process.Kill()&#xA;&#xA;                connected = false&#xA;&#xA;                fmt.Println("\nConnection closed:", err)&#xA;                break&#xA;            }&#xA;&#xA;            if len(data) == 0 {&#xA;&#xA;            } else if data[0] == byte(0) {&#xA;                fmt.Printf("Received mouse datagram: %s\n", data)&#xA;            }&#xA;        }&#xA;&#xA;    })&#xA;&#xA;    server := &amp;webtransport.Server{&#xA;        ListenAddr: ":1024",&#xA;        TLSCert:    webtransport.CertFile{Path: "SSL/fullchain.pem"},&#xA;        TLSKey:     webtransport.CertFile{Path: "SSL/privkey.pem"},&#xA;        QuicConfig: &amp;webtransport.QuicConfig{&#xA;            KeepAlive:      false,&#xA;            MaxIdleTimeout: 3 * time.Second,&#xA;        },&#xA;    }&#xA;&#xA;    fmt.Println("Launching WebTransport server at", server.ListenAddr)&#xA;    ctx, cancel := context.WithCancel(context.Background())&#xA;    if err := server.Run(ctx); err != nil {&#xA;        log.Fatal(err)&#xA;        cancel()&#xA;    }&#xA;&#xA;}

    &#xD;&#xA;

    &#xD;&#xA;

    &#xD;&#xA;&#xA;