
Recherche avancée
Autres articles (63)
-
List of compatible distributions
26 avril 2011, parThe table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...) -
Configuration spécifique pour PHP5
4 février 2011, parPHP5 est obligatoire, vous pouvez l’installer en suivant ce tutoriel spécifique.
Il est recommandé dans un premier temps de désactiver le safe_mode, cependant, s’il est correctement configuré et que les binaires nécessaires sont accessibles, MediaSPIP devrait fonctionner correctement avec le safe_mode activé.
Modules spécifiques
Il est nécessaire d’installer certains modules PHP spécifiques, via le gestionnaire de paquet de votre distribution ou manuellement : php5-mysql pour la connectivité avec la (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains 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 ;
Sur d’autres sites (7619)
-
Top Conversion Metrics to Track in 2024
22 janvier 2024, par Erin -
Processing a single frame of audio and image in FFmpeg
21 juillet 2015, par James FCurrently 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 eachwrite_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
-
Merge video with ffmpeg(or alternatives) with extra properties(an overlay)
28 juin 2021, par dconixDevI'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)