
Recherche avancée
Médias (91)
-
DJ Z-trip - Victory Lap : The Obama Mix Pt. 2
15 septembre 2011
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Matmos - Action at a Distance
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
DJ Dolores - Oslodum 2004 (includes (cc) sample of “Oslodum” by Gilberto Gil)
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Danger Mouse & Jemini - What U Sittin’ On ? (starring Cee Lo and Tha Alkaholiks)
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Cornelius - Wataridori 2
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
The Rapture - Sister Saviour (Blackstrobe Remix)
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (57)
-
Le profil des utilisateurs
12 avril 2011, parChaque 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, parAccé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, parLes 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_renI’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 user1978421does 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 oneffmpeg -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 '16 and Pregnant- Unseen Moments_Viva_2013_04_09_19_57_00.wtv':
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'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 'test.srt' already exists. Overwrite ? [y/N] Output #0, srt, to 'test.srt':
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'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 YangQuestion (read the context below first) :


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.


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


Context and what I've done so far :


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 :


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 -


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.


As for the audio, there is another ffmpeg instance :


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 -


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


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)


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




package main

import (
 "bytes"
 "context"
 "fmt"
 "log"
 "net/http"
 "os/exec"
 "time"

 "github.com/adriancable/webtransport-go"
)

func warn(str string) {
 fmt.Printf("\n===== WARNING ===================================================================================================\n %s\n=================================================================================================================\n", str)
}

func main() {

 password := []byte("abc")

 videoString := []string{
 "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", "500K",
 "-no-scenecut", "1",
 "-g", "216000",
 "-f", "hevc", "-",
 }

 audioString := []string{
 "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",
 "-mapping_family", "0",
 "-b:a", "25K",
 "-map", "0",
 "-f", "data", "-",
 }

 connected := false

 http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
 session := request.Body.(*webtransport.Session)

 session.AcceptSession()
 fmt.Println("\nAccepted incoming WebTransport connection.")
 fmt.Println("Awaiting authentication...")

 authData, err := session.ReceiveMessage(session.Context()) // Waits here till first datagram
 if err != nil { // if client closes connection before sending anything
 fmt.Println("\nConnection closed:", err)
 return
 }

 if len(authData) >= 2 && bytes.Equal(authData[2:], password) {
 if connected {
 session.CloseSession()
 warn("Client has authenticated, but a session is already taking place! Connection closed.")
 return
 } else {
 connected = true
 fmt.Println("Client has authenticated!\n")
 }
 } else {
 session.CloseSession()
 warn("Client has failed authentication! Connection closed. (" + string(authData[2:]) + ")")
 return
 }

 videoStream, _ := session.OpenUniStreamSync(session.Context())

 videoCmd := exec.Command(videoString[0], videoString[1:]...)
 go func() {
 videoOut, _ := videoCmd.StdoutPipe()
 videoCmd.Start()

 buffer := make([]byte, 15000)
 for {
 len, err := videoOut.Read(buffer)
 if err != nil {
 break
 }
 if len > 0 {
 videoStream.Write(buffer[:len])
 }
 }
 }()

 time.Sleep(50 * time.Millisecond)

 audioStream, err := session.OpenUniStreamSync(session.Context())

 audioCmd := exec.Command(audioString[0], audioString[1:]...)
 go func() {
 audioOut, _ := audioCmd.StdoutPipe()
 audioCmd.Start()

 buffer := make([]byte, 15000)
 for {
 len, err := audioOut.Read(buffer)
 if err != nil {
 break
 }
 if len > 0 {
 audioStream.Write(buffer[:len])
 }
 }
 }()

 for {
 data, err := session.ReceiveMessage(session.Context())
 if err != nil {
 videoCmd.Process.Kill()
 audioCmd.Process.Kill()

 connected = false

 fmt.Println("\nConnection closed:", err)
 break
 }

 if len(data) == 0 {

 } else if data[0] == byte(0) {
 fmt.Printf("Received mouse datagram: %s\n", data)
 }
 }

 })

 server := &webtransport.Server{
 ListenAddr: ":1024",
 TLSCert: webtransport.CertFile{Path: "SSL/fullchain.pem"},
 TLSKey: webtransport.CertFile{Path: "SSL/privkey.pem"},
 QuicConfig: &webtransport.QuicConfig{
 KeepAlive: false,
 MaxIdleTimeout: 3 * time.Second,
 },
 }

 fmt.Println("Launching WebTransport server at", server.ListenAddr)
 ctx, cancel := context.WithCancel(context.Background())
 if err := server.Run(ctx); err != nil {
 log.Fatal(err)
 cancel()
 }

}