Recherche avancée

Médias (1)

Mot : - Tags -/géodiversité

Autres articles (49)

  • 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

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (7658)

  • (ffmpeg) How to sync dshow inputs, dropping frames, and -rtbufsize [closed]

    29 juillet 2021, par Zach Fleeman

    I wrote a quick batch script to capture anything from my Elgato HD60 Pro capture card, and while it works in some ways, I don't really understand how certain parameters are affecting my capture.

    


    Whenever I run this command without the -rtbufsize 2048M -thread_queue_size 5096 params, I drop a ton of frames. I only added those params with those values because I found them on another stackoverflow thread. I wouldn't mind actually knowing what these do, and how I can fine-tune them for my script.

    


    ffmpeg.exe -y -rtbufsize 2048M -thread_queue_size 5096 -fflags +igndts ^
-f dshow -i video="Game Capture HD60 Pro":audio="Game Capture HD60 Pro Audio" ^
-filter:v "crop=1410:1080:255:0, scale=706x540" ^
-c:v libx264 -preset veryfast -b:v 1500k -pix_fmt yuv420p ^
-c:a aac ^
-f tee -map 0:v -map 0:a "%mydate%_%mytime%_capture.mp4|[f=flv]rtmp://xxx.xxx.xxx.xxx/live"


    


    In Open Broadcaster Software, my Elgato is a near-instant video feed, but this captures/streams things at a 3-ish second delay, which is okay until I work on this second command. I'm using gdigrab to capture the window from LiveSplit for my speedrunning, but I can't get the video streams to be synced up. I tried adding and modifying another -rtbufsize before the gdigrab input, but again, I'm not sure if this is what I need to do to delay the LiveSplit grab. It seems to always be 2 to 3 seconds ahead of my capture card. How can I get these inputs to be synced and react at the same time ? i.e., I start the timer in LiveSplit at the same time that I hit a button on my super nintendo.

    


    ffmpeg.exe -y -rtbufsize 750M -thread_queue_size 5096 ^
-f dshow  -i video="Game Capture HD60 Pro":audio="Game Capture HD60 Pro Audio" ^
-rtbufsize 2000M -thread_queue_size 5096 ^
-f gdigrab -r 60 -i title=LiveSplit ^
-filter_complex "[0:v][0:v]overlay=255:0 [game];[game][1:v]overlay=0:40 [v]" ^
-c:v libx264 -preset veryfast -b:v 1500k -pix_fmt yuv420p ^
-c:a aac ^
-f tee -map "[v]" -map 0:a "%mydate%_%mytime%_capture.mp4|[f=flv]rtmp://192.168.1.7/live"


    


    tl ;dr
Where should I put -rtbufsize ? What value should it be ? And how about -thread_queue_size ? Are these things that I have to specify once or multiple times for each input ? How can I get my different input sources to sync up ?

    


    p.s., I'm cropping and overlaying my Elgato inputs because my capture card does 1920x1080, but my video is most likely a 4:3-ish SNES/NES game.

    


  • Merge video with ffmpeg(or alternatives) with extra properties(an overlay)

    28 juin 2021, par dconixDev

    I'll be scraping clips from twitch and merging them to create a single video file.
I already figured out the scraping of twitch clip links(but i only get 16-20 videos because i need to scroll with selenium but i dont really mind it, if you have a working solution then make an answer about it) and also the simple merging videos.

    


    I'm scraping links with :

    


    #!/usr/bin/python3.9
import bs4
import requests
import time
from datetime import datetime
from selenium import webdriver
from selenium.webdriver.firefox.options import Options

# Initialize driver and run it headless
options = Options()
options.headless = True
driver = webdriver.Firefox(options=options)

def extract_source(url):
     agent = {"User-Agent":"Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0"}
     source=requests.get(url, headers=agent).text
     return source

def extract_data(source):
     soup=bs4.BeautifulSoup(source, 'html.parser')
     names=soup.find_all('a', attrs={'data-a-target':'preview-card-image-link'})
     return names

driver.get('https://www.twitch.tv/directory/game/League%20of%20Legends/clips?range=24hr')

# I wait 3 seconds for the clips to get pulled in
# I'd like here to scroll down a bit so i can scrape more clips, but even after i tried some solutions my firefox(was debugging in GUI mode, not headless as it is now) wasnt scrolling
time.sleep(3)
extract_links=extract_data(driver.page_source)
for a in extract_links:
    print(a.get('href'))

driver.quit()

# I tried scrolling using this but didnt work, not sure why
# this script is supposed to scroll until youre at the end of the page
# SCROLL_PAUSE_TIME = 0.5

# # Get scroll height
# last_height = driver.execute_script("return document.body.scrollHeight")

# for i in range(3):
    # # Scroll down to bottom
    # driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")

    # # Wait to load page
    # time.sleep(SCROLL_PAUSE_TIME)

    # # Calculate new scroll height and compare with last scroll height
    # new_height = driver.execute_script("return document.body.scrollHeight")
    # if new_height == last_height:
        # break
    # last_height = new_height


    


    I'm joining videos together after downloading(with youtube-dl) with ffmpeg :

    


    ffmpeg -safe 0 -f concat -segment_time_metadata 1 -i videos.txt -vf select=concatdec_select -af aselect=concatdec_select,aresample=async=1 out.mp4

    


    Where videos.txt is as follows :

    


    file 'video_file1.mp4'
file 'video_file2.mp4'
...


    


    I can't really find answers on how to add a watermark(different for each video, although i found this it doesnt explain how to add a unique watermark to individual videos but the same watermark to two videos) without having to render each and every video twice but doing so in one go.

    


    I think I stumbled upon some people who made their videos.txt as follows in purpose of adding extra options to each video :

    


    file 'video_file1.mp4'
option 1(for video_file1.mp4)
option 2(for video_file1.mp4)
file 'video_file2.mp4'
option 1(for video_file2.mp4)
option 2(for video_file2.mp4)
...


    


    Would this work for unique watermarks for each videos(lets suppose watermarks are named video_file1.png, ... meaning the same as the videos, also the watermark is transparent in case that needs more configuration)

    


  • Wav file conversion/resampling options in C#

    7 juin 2021, par oceansmoving

    Background :

    


    Trying to convert various wav files to a format that is accepted by the game CS:GO.
So as you can see below in the source code for a VB application that is successfully doing this (https://github.com/SilentSys/SLAM/blob/master/SLAM/Form1.vb), it's supposed to be :

    


      

    • Mono
    • 


    • 16 Bit
    • 


    • 22050hz
    • 


    


        Private Sub FFMPEG_ConvertAndTrim(inpath As String, outpath As String, samplerate As Integer, channels As Integer, starttrim As Double, length As Double, volume As Double)
        Dim convert As New FFMpegConverter()
        convert.ExtractFFmpeg()

        Dim trimstring As String
        If length > 0 Then
            trimstring = String.Format("-ss {0} -t {1} ", starttrim.ToString("F5", Globalization.CultureInfo.InvariantCulture), length.ToString("F5", Globalization.CultureInfo.InvariantCulture))
        End If

        Dim command As String = String.Format("-i ""{0}"" -n -f wav -flags bitexact -map_metadata -1 -vn -acodec pcm_s16le -ar {1} -ac {2} {3}-af ""volume={4}"" ""{5}""", Path.GetFullPath(inpath), samplerate, channels, trimstring, volume.ToString("F5", Globalization.CultureInfo.InvariantCulture), Path.GetFullPath(outpath))
        convert.Invoke(command)
    End Sub


    


    Now, the thing is I have very little experience with VB, and as it is C# I am trying to learn I don't want this to be a showstopper.

    


    I have been able, in various ways to convert files that seem to be the correct format and can be played by normal media players, but is not accepted by the game, like the files converted with VB.

    


    The different methods I've been trying without success :

    


                int outRate = 22050;


    


                using (var reader = new MediaFoundationReader(inFile))
            {
                var outFormat = new WaveFormat(outRate, 1);
                using (var resampler = new WaveFormatConversionStream(outFormat, reader))
                {
                    WaveFileWriter.CreateWaveFile(outFile, resampler);
                }
            }


    


    Next one gives me an error that everyone is referring to the LT version of the package to solve, that in turn requires license...

    


                var ffMpeg = new FFMpegConverter();

            String args = $"-i '{@inFile}' -n -f wav -flags bitexact -map_metadata -1 -vn -acodec pcm_s16le -ar {outRate} -ac 1 '{@outFile}'";
            ffMpeg.Invoke(args);


    


    Another

    


            using (WaveFileReader reader = new WaveFileReader(inFile))
            {
                var outFormat = new WaveFormat(outRate, 1);
                using (var resampler = new MediaFoundationResampler(reader, outFormat))
                {
                    WaveFileWriter.CreateWaveFile(outFile, resampler);
                }
            }


    


    Another

    


                        FileStream fileStream = new FileStream(inFile, FileMode.Open);
                    WaveFormat waveFormat = new WaveFormat(22050, 16, 1);
                    var reader = new RawSourceWaveStream(fileStream, waveFormat);
                    using (WaveStream convertedStream = WaveFormatConversionStream.CreatePcmStream(reader))
                    {
                        WaveFileWriter.CreateWaveFile(outFile, convertedStream);
                    }
                    fileStream.Close();