Recherche avancée

Médias (16)

Mot : - Tags -/mp3

Autres articles (61)

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

  • Problèmes fréquents

    10 mars 2010, par

    PHP et safe_mode activé
    Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
    La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

Sur d’autres sites (4662)

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


    


  • FFMPEG - force webm clusters duration [closed]

    1er avril 2021, par Vlad Sineok

    in short, i'm modifying a game that uses a VP8 video format.
the original videos are at 25 fps and have all clusters of nice and perfect duration 0.96 seconds and contain 25 blocks each (except for that last cluster, which usually varies). also every cluster starts with a keyframe. (all that information i gathered using webm_info from google's libwebm repo)

    


    unless all of the requirements are met, the game struggles to play the webm file smoothly, so my own webm files stutter most of the time, because ffmpeg fails to create the correct clusters and mkclean doesn't help either.
so my question is : how would i force ffmpeg to make all clusters have that perfect duration ?
here's what my command currently looks like

    


    for %%f in (*.webm) do (
ffmpeg -y -i %%f -vcodec libvpx -cpu-used 1 -pass 1 -reserve_index_space 16384 -fflags +genpts -crf 15 -slices 8 -g 25 -keyint_min 25 -vprofile 1 -auto-alt-ref 1 -arnr-maxframes 5 -arnr-strength 3 -deadline good -vf scale=512:384,setsar=1:1 -vb 4000k -an -r 25 -movflags use_metadata_tags -f webm NUL && ^
ffmpeg -y -i %%f -vcodec libvpx -cpu-used 1 -pass 2 -reserve_index_space 16384 -fflags +genpts -crf 15 -slices 8 -g 25 -keyint_min 25 -vprofile 1 -auto-alt-ref 1 -arnr-maxframes 5 -arnr-strength 3 -deadline good -vf scale=512:384,setsar=1:1 -vb 4000k -an -r 25 -movflags use_metadata_tags -f webm %%~nf.webm
)