Recherche avancée

Médias (2)

Mot : - Tags -/doc2img

Autres articles (32)

  • 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

  • Support de tous types de médias

    10 avril 2011

    Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)

  • Déploiements possibles

    31 janvier 2010, par

    Deux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
    L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
    Version mono serveur
    La version mono serveur consiste à n’utiliser qu’une (...)

Sur d’autres sites (5213)

  • lavc : replace internal use of AV_CODEC_CAP_AUTO_THREADS with an internal cap

    9 mars 2021, par Anton Khirnov
    lavc : replace internal use of AV_CODEC_CAP_AUTO_THREADS with an internal cap
    

    AV_CODEC_CAP_AUTO_THREADS was originally added in b4d44a45f9a to mark
    codecs that spawn threads internally and are able to select an optimal
    threads count by themselves (all such codecs are wrappers around
    external libraries). It is used by lavc generic code to check whether it
    should handle thread_count=0 itself or pass the zero directly to the
    codec implementation. Within this meaning, it is clearly supposed to be
    an internal cap rather than a public one, since from the viewpoint of a
    libavcodec user, lavc ALWAYS handles thread_count=0. Whether it happens
    in the generic code or within the codec internals is not a meaningful
    difference for the caller.

    External aspects of this flag will be dealt with in the following
    commit.

    • [DH] libavcodec/internal.h
    • [DH] libavcodec/libaomdec.c
    • [DH] libavcodec/libaomenc.c
    • [DH] libavcodec/libdav1d.c
    • [DH] libavcodec/libdavs2.c
    • [DH] libavcodec/libkvazaar.c
    • [DH] libavcodec/libopenh264enc.c
    • [DH] libavcodec/librav1e.c
    • [DH] libavcodec/libsvtav1.c
    • [DH] libavcodec/libuavs3d.c
    • [DH] libavcodec/libvpxdec.c
    • [DH] libavcodec/libvpxenc.c
    • [DH] libavcodec/libx264.c
    • [DH] libavcodec/libx265.c
    • [DH] libavcodec/libxavs.c
    • [DH] libavcodec/libxavs2.c
    • [DH] libavcodec/pthread.c
    • [DH] libavcodec/utils.c
  • 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)

    


  • Processing a single frame of audio and image in FFmpeg

    21 juillet 2015, par James F

    Currently we have an implementation of FFmpeg which is triggered from an ActionScript 3 (AS3) application, via CrossBridge (formerly Flascc). In this implementation, we write the entire audio track into the CModule’s memory, using malloc from the AS3 application. Once written, the application starts to process each of the image frames we would like to combine with our audio. This process begins by the AS3 application calling the CModule’s write_frame public method.

    C :
    int write_frame(struct Session *s, uint8_t *buffer, int bufferSize){}

    AS3 :
    var ret:int = writeFrame(_sessionPtr, _pixelBytesPtr, _pixelBytes.length);

    Once the video output has been created, it is retrieved from the CModule to AS3 as a byte array.

    With this implementation, a long duration video or audio track - the application runs out of memory (there’s a memory limit within our CrossBridge sandbox environment). The largest portion of this memory is currently our audio track, as it’s uncompressed PCM data (raw float values).

    Ideally, we would like to write a single audio frame and video frame together, with the AS3 application writing the 1 x audio frame byte array to the CModule’s memory. I have attempted to do this, by allocating the memory requirement for a single frame of audio using malloc, and then overwriting this memory, each time write_frame is called. However, this results in the video file containing a single frame of audio at the start of the video, and no other audio.

    I’m convinced that the audio frame is being constructed correctly, but I believe this approach is conflicting with some of the code within our Muxing.c file. It’s a little different to FFmpeg’s example file (https://ffmpeg.org/doxygen/trunk/muxing_8c-source.html), as this file has been modified by several people. Here’s the methods calls from within write_frame :

    fill_audio_buffer(s->audio_input, s->audio_input_length, s->audio_input_index, s->audio_input_frame_size * 2, s->audio_frame_buffer);

    retval = av_samples_alloc(converted_buffer, NULL, 2, out_samples, audio_st->codec->sample_fmt, 0);

    out_samples = swr_convert(s->audio_swr_context, converted_buffer, out_samples (void *) &s->audio_frame_buffer, in_samples);

    retval = write_audio_frame(s, s->oc, s->audio_st, s->audio_input_frame_size (uint16_t *) converted_buffer[0]);

    s->audio_input_index += s->audio_input_frame_size * 2;

    Is it possible to move to procedural muxing of 1 x frame of audio and 1 x frame of image approach ? Even if it’s slightly slower - it’ll mean we’re not hold the entire audio track in memory. Any suggestions to the required approach would be great, thanks in advance !

    @VC. One - The PCM data is made outside of FFmpeg and then written to the memory that FFmpeg has access to. (using malloc, and then the pointer to this address is sent to the FFmpeg).

    The FFmpeg output file can either be a .WMV file, or .AVi file - the codecs WMV2 and DIVX are used in each case. I have made some modifications since posting the original question, but you’re correct in thinking that the first chunk was being used and then the last frame size increased, meaning the next read of the buffer would yield nothing as it exceeded the buffer.

    I’ve now made some progress by resetting the index audio_input_index back to ’0’ at the start of each write_frame call. However, i’ll need to check whether this is the correct approach, as between each audio frame (1 second at 1fps), there is a slight blip/audio pop noise. In addition to this - the last few frames of audio seem to overlap, causing some of the audio to be repeated. Is it safe practice with C/FFmpeg to recycle a buffer in this way ? It seems that the length of each audio frame changes - at AS3 level my current calculation of the audio frame byte length is (44,100 kHz sample rate * 8) / Frames per second. It’s * 8 as it’s two channel, and each float value is 4 bytes.

    Thanks again for your help