Recherche avancée

Médias (1)

Mot : - Tags -/artwork

Autres articles (79)

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

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

  • Publier sur MédiaSpip

    13 juin 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

Sur d’autres sites (7089)

  • Can google cloud dataflow (apache beam) use ffmpeg to process video or image data

    12 février 2016, par Michael

    Can a dataflow process use ffmpeg to process video or images and if so what would a sample workflow look like

  • Google Speech - Streaming Request Returns EOF

    9 octobre 2017, par Josh

    Using Go, I’m taking a RTMP stream, transcoding it to FLAC (using ffmpeg) and attempting to stream to Google’s Speech API to transcribe the audio. However, I keep getting EOF errors when sending the data. I can’t find any information on this error in the docs so I’m not exactly sure what’s causing it.

    I’m chunking the received data into 3s clips (length isn’t relevant as long as it’s less than the maximum length of a streaming recognition request).

    Here is the core of my code :

    func main() {

       done := make(chan os.Signal)
       received := make(chan []byte)

       go receive(received)
       go transcribe(received)

       signal.Notify(done, os.Interrupt, syscall.SIGTERM)

       select {
       case <-done:
           os.Exit(0)
       }
    }

    func receive(received chan<- []byte) {
       var b bytes.Buffer
       stdout := bufio.NewWriter(&b)

       cmd := exec.Command("ffmpeg", "-i", "rtmp://127.0.0.1:1935/live/key", "-f", "flac", "-ar", "16000", "-")
       cmd.Stdout = stdout

       if err := cmd.Start(); err != nil {
           log.Fatal(err)
       }

       duration, _ := time.ParseDuration("3s")
       ticker := time.NewTicker(duration)

       for {
           select {
           case <-ticker.C:
               stdout.Flush()
               log.Printf("Received %d bytes", b.Len())
               received <- b.Bytes()
               b.Reset()
           }
       }
    }

    func transcribe(received <-chan []byte) {
       ctx := context.TODO()

       client, err := speech.NewClient(ctx)
       if err != nil {
           log.Fatal(err)
       }

       stream, err := client.StreamingRecognize(ctx)
       if err != nil {
           log.Fatal(err)
       }

       // Send the initial configuration message.
       if err = stream.Send(&speechpb.StreamingRecognizeRequest{
           StreamingRequest: &speechpb.StreamingRecognizeRequest_StreamingConfig{
               StreamingConfig: &speechpb.StreamingRecognitionConfig{
                   Config: &speechpb.RecognitionConfig{
                       Encoding:        speechpb.RecognitionConfig_FLAC,
                       LanguageCode:    "en-GB",
                       SampleRateHertz: 16000,
                   },
               },
           },
       }); err != nil {
           log.Fatal(err)
       }

       for {
           select {
           case data := <-received:
               if len(data) > 0 {
                   log.Printf("Sending %d bytes", len(data))
                   if err := stream.Send(&speechpb.StreamingRecognizeRequest{
                       StreamingRequest: &speechpb.StreamingRecognizeRequest_AudioContent{
                           AudioContent: data,
                       },
                   }); err != nil {
                       log.Printf("Could not send audio: %v", err)
                   }
               }
           }
       }
    }

    Running this code gives this output :

    2017/10/09 16:05:00 Received 191704 bytes
    2017/10/09 16:05:00 Saving 191704 bytes
    2017/10/09 16:05:00 Sending 191704 bytes
    2017/10/09 16:05:00 Could not send audio: EOF

    2017/10/09 16:05:03 Received 193192 bytes
    2017/10/09 16:05:03 Saving 193192 bytes
    2017/10/09 16:05:03 Sending 193192 bytes
    2017/10/09 16:05:03 Could not send audio: EOF

    2017/10/09 16:05:06 Received 193188 bytes
    2017/10/09 16:05:06 Saving 193188 bytes
    2017/10/09 16:05:06 Sending 193188 bytes // Notice that this doesn't error

    2017/10/09 16:05:09 Received 191704 bytes
    2017/10/09 16:05:09 Saving 191704 bytes
    2017/10/09 16:05:09 Sending 191704 bytes
    2017/10/09 16:05:09 Could not send audio: EOF

    Notice that not all of the Sends fail.

    Could anyone point me in the right direction here ? Is it something to do with the FLAC headers or something ? I also wonder if maybe resetting the buffer causes some of the data to be dropped (i.e. it’s a non-trivial operation that actually takes some time to complete) and it doesn’t like this missing information ?

    Any help would be really appreciated.

  • google speech to text errors out (grpc invalid deadline NaN)

    15 décembre 2019, par jamescharlesworth

    I have a ffmpeg script that cuts an audio file into a short 5 second clip, however after I cut the file, calling the google speech recognize command errors out.

    Creating a clip - full code link :

    const uri = 'http://traffic.libsyn.com/joeroganexp/p1400.mp3?dest-id=19997';
    const command = ffmpeg(got.stream(uri));
    command
     .seek(0)
     .duration(5)
     .audioBitrate(128)
     .format('mp3')
    ...

    which works fine and creates ./clip2.mp3.

    I then take that file and upload it to speech to text api and it times out (script here. When I put timeout and maxRetries argument I can get the actual error :

    Error: 2 UNKNOWN: Getting metadata from plugin failed with error: Deadline is too far in the future
       at Object.callErrorFromStatus (/Users/jamescharlesworth/Downloads/demo/node_modules/@grpc/grpc-js/build/src/call.js:30:26)
       at Http2CallStream.<anonymous> (/Users/jamescharlesworth/Downloads/demo/node_modules/@grpc/grpc-js/build/src/client.js:96:33)
       at Http2CallStream.emit (events.js:215:7)
       at /Users/jamescharlesworth/Downloads/demo/node_modules/@grpc/grpc-js/build/src/call-stream.js:98:22
       at processTicksAndRejections (internal/process/task_queues.js:75:11) {
     code: 2,
     details: 'Getting metadata from plugin failed with error: Deadline is too far in the future',
     metadata: Metadata { internalRepr: Map {}, options: {} },
     note: 'Exception occurred in retry method that was not classified as transient'
    }
    </anonymous>

    Stepping through the grpc code i see that the deadline is an invalid date.
    enter image description here
    This seems to be causing the issue but i assume it may be from incorrect params passed into the speech client.recognize() method.

    A few other things to note :

    • The script works for some audio files, not all
    • I can upload the broken my clip mp3 clip2.mp3 to the demo app here and it works fine.
    • If I change the seek command of my ffmpeg script to start at 0.01 speech recognize command will work (however it breaks other audio clips as its not the correct starting point). I notice that when i do this the png of the mp3 gets stripped out and is a much smaller file size