Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (66)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (10936)

  • Revision ed22179a82 : Rewrite HORIZx4 and HORIZx8 in subpixel filter functions In subpixel filters, p

    3 octobre 2013, par Yunqing Wang

    Changed Paths :
     Modify /vp9/common/x86/vp9_subpixel_8t_ssse3.asm



    Rewrite HORIZx4 and HORIZx8 in subpixel filter functions

    In subpixel filters, prefetched source data, unrolled loops,
    and interleaved instructions.

    In HORIZx4, integrated the idea in Scott's CL (commit :
    d22a504d11a15dc3eab666859db0046b5a7d75c5), which was suggested by
    Erik/Tamar from Intel. Further tweaking was done to combine row 0,
    2, and row 1, 3 in registers to do more 2-row-in-1 operations until
    the last add.

    Test showed a 2% decoder speedup.

    Change-Id : Ib53d04ede8166c38c3dc744da8c6f737ce26a0e3

  • Can't view and record graph at the same time using FFMpegWriter [closed]

    7 juillet 2024, par Barkın Özer

    So this code is used for graphing and logging sensor data coming from bluetooth ports. I wanted to add an function that will record the graph in mp4 format. In order to achieve this I used ffmpegWriter. The issue is while this code records the graph I can't view the graph at the same time.

    


    import serial
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation, FFMpegWriter
import openpyxl
from datetime import datetime

# Constants
GRAVITY = 9.81  # Standard gravity in m/s²

# Initialize serial connections to HC-06 devices
ser_x_accel = serial.Serial('COM4', 9600, timeout=1)  # X-axis acceleration data
ser_y_angle = serial.Serial('COM11', 9600, timeout=1)  # Y-axis angle data

# Initialize empty lists to store data
x_accel_data = []
y_angle_data = []
timestamps = []

# Initialize Excel workbook
wb = openpyxl.Workbook()
ws = wb.active
ws.title = "Sensor Data"
ws.append(["Timestamp", "X Acceleration (m/s²)", "Y Angle (degrees)"])

# Function to update the plot and log data
def update(frame):
    # Read data from serial connections
    line_x_accel = ser_x_accel.readline().decode('utf-8').strip()
    line_y_angle = ser_y_angle.readline().decode('utf-8').strip()
    
    try:
        # Parse and process X-axis acceleration data
        x_accel_g = float(line_x_accel)  # Acceleration in g read from serial
        x_accel_ms2 = x_accel_g * GRAVITY  # Convert from g to m/s²
        x_accel_data.append(x_accel_ms2)
        
        # Parse and process Y-axis angle data
        y_angle = float(line_y_angle)
        y_angle_data.append(y_angle)
        
        # Append timestamp
        timestamps.append(datetime.now())

        # Limit data points to show only the latest 100
        if len(x_accel_data) > 100:
            x_accel_data.pop(0)
            y_angle_data.pop(0)
            timestamps.pop(0)

        # Log data to Excel with timestamp
        timestamp_str = timestamps[-1].strftime("%H:%M:%S")
        ws.append([timestamp_str, x_accel_data[-1], y_angle_data[-1]])

        # Clear and update plots
        ax1.clear()
        ax1.plot(timestamps, x_accel_data, label='X Acceleration', color='b')
        ax1.legend(loc='upper left')
        ax1.set_ylim([-20, 20])  # Adjust based on expected acceleration range in m/s²
        ax1.set_title('Real-time X Acceleration Data')
        ax1.set_xlabel('Time')
        ax1.set_ylabel('Acceleration (m/s²)')
        ax1.grid(True)

        ax2.clear()
        ax2.plot(timestamps, y_angle_data, label='Y Angle', color='g')
        ax2.legend(loc='upper left')
        ax2.set_ylim([-180, 180])
        ax2.set_title('Real-time Y Angle Data')
        ax2.set_xlabel('Time')
        ax2.set_ylabel('Angle (degrees)')
        ax2.grid(True)

        # Update text boxes with latest values
        text_box.set_text(f'X Acceleration: {x_accel_data[-1]:.2f} m/s²')
        text_box2.set_text(f'Y Angle: {y_angle_data[-1]:.2f}°')
        
        # Save the workbook periodically (every 100 updates)
        if frame % 100 == 0:
            wb.save("sensor_data.xlsx")
        
    except ValueError:
        pass  # Ignore lines that are not properly formatted

# Setup the plots
fig, (ax1, ax2) = plt.subplots(2, 1, figsize=(10, 8))
text_box = ax1.text(0.05, 0.95, '', transform=ax1.transAxes, fontsize=12, verticalalignment='top', bbox=dict(boxstyle='round', facecolor='wheat', alpha=0.5))
text_box2 = ax2.text(0.05, 0.95, '', transform=ax2.transAxes, fontsize=12, verticalalignment='top', bbox=dict(boxstyle='round', facecolor='wheat', alpha=0.5))

# Animate the plots
ani = FuncAnimation(fig, update, interval=100)  # Update interval of 100ms

# Save the animation as a video file
writer = FFMpegWriter(fps=10, metadata=dict(artist='Me'), bitrate=1800)
ani.save("sensor_data.mp4", writer=writer)

plt.tight_layout()
plt.show()

# Save the workbook at the end of the session
wb.save("sensor_data.xlsx")



    


    I tried using OpenCV to record the graph but then I didn't even got any recording. I think solving this issue with my original code would be a better approach.

    


  • Issue with streaming in realtime to HTML5 video player

    24 juillet 2023, par ImaSquareBTW

    ok so i created a project which should take an mkv file convert it to a sutaible fomrat in relatime and play it as it transcodes in the html 5 video player and should play as soon as small segement is ready for playback but unfornatlly it does seem to work heres my code if your curious, help would be very much appreicted

    


    &#xA;&#xA;  &#xA;    &#xA;  &#xA;  &#xA;    <video controls="controls">&#xA;      <source src="output.mp4" type="video/mp4">&#xA;    </source></video>&#xA;    <code class="echappe-js">&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/ffmpeg/0.11.6/ffmpeg.min.js&quot; integrity=&quot;sha512-91IRkhfv1tLVYAdH5KTV&amp;#x2B;KntIZP/7VzQ9E/qbihXFSj0igeacWWB7bQrdiuaJVMXlCVREL4Z5r&amp;#x2B;3C4yagAlwEw==&quot; crossorigin=&quot;anonymous&quot; referrerpolicy=&quot;no-referrer&quot;&gt;&lt;/script&gt;&#xA;    &lt;script src='http://stackoverflow.com/feeds/tag/player.js'&gt;&lt;/script&gt;&#xA;  &#xA;&#xA;

    &#xA;

    and my javscript :

    &#xA;

    let mediaSource;&#xA;let sourceBuffer;&#xA;let isTranscoding = false;&#xA;let bufferedSeconds = 0;&#xA;&#xA;async function setupMediaSource() {&#xA;  mediaSource = new MediaSource();&#xA;  const videoPlayer = document.getElementById(&#x27;video-player&#x27;);&#xA;  videoPlayer.src = URL.createObjectURL(mediaSource);&#xA;  await new Promise(resolve => {&#xA;    mediaSource.addEventListener(&#x27;sourceopen&#x27;, () => {&#xA;      sourceBuffer = mediaSource.addSourceBuffer(&#x27;video/mp4; codecs="avc1.64001E, mp4a.40.2"&#x27;); // Match the transcoded format&#xA;      sourceBuffer.addEventListener(&#x27;updateend&#x27;, () => {&#xA;        if (!sourceBuffer.updating &amp;&amp; mediaSource.readyState === &#x27;open&#x27;) {&#xA;          mediaSource.endOfStream();&#xA;          resolve();&#xA;        }&#xA;      });&#xA;    });&#xA;  });&#xA;}&#xA;&#xA;async function transcodeVideo() {&#xA;  const ffmpeg = createFFmpeg({ log: true });&#xA;  const videoPlayer = document.getElementById(&#x27;video-player&#x27;);&#xA;&#xA;  await ffmpeg.load();&#xA;  const transcodeCommand = [&#x27;-i&#x27;, &#x27;The Legend of Old Gregg S02E05.mkv&#x27;, &#x27;-c:v&#x27;, &#x27;libx264&#x27;, &#x27;-preset&#x27;, &#x27;ultrafast&#x27;, &#x27;-c:a&#x27;, &#x27;aac&#x27;, &#x27;-strict&#x27;, &#x27;experimental&#x27;, &#x27;-f&#x27;, &#x27;mp4&#x27;, &#x27;-movflags&#x27;, &#x27;frag_keyframe&#x2B;empty_moov&#x27;, &#x27;output.mp4&#x27;];&#xA;&#xA;  const videoUrl = &#x27;The Legend of Old Gregg S02E05.mkv&#x27;; // The URL of the original video file&#xA;&#xA;  let lastBufferedSeconds = 0;&#xA;  let currentTime = 0;&#xA;  while (currentTime &lt; videoPlayer.duration) {&#xA;    if (!isTranscoding &amp;&amp; sourceBuffer.buffered.length > 0 &amp;&amp; sourceBuffer.buffered.end(0) - currentTime &lt; 5) {&#xA;      isTranscoding = true;&#xA;      const start = sourceBuffer.buffered.end(0);&#xA;      const end = Math.min(videoPlayer.duration, start &#x2B; 10);&#xA;      await fetchAndTranscode(videoUrl, start, end, ffmpeg, transcodeCommand);&#xA;      isTranscoding = false;&#xA;      currentTime = end;&#xA;      bufferedSeconds &#x2B;= (end - start);&#xA;      const transcodingSpeed = bufferedSeconds / (currentTime);&#xA;      lastBufferedSeconds = bufferedSeconds;&#xA;      console.log(`Transcoded ${end - start} seconds of video. Buffered: ${bufferedSeconds.toFixed(2)}s (${transcodingSpeed.toFixed(2)}x speed)`);&#xA;    }&#xA;    await new Promise(resolve => setTimeout(resolve, 500));&#xA;  }&#xA;&#xA;  await ffmpeg.exit();&#xA;}&#xA;&#xA;async function fetchAndTranscode(url, start, end, ffmpeg, transcodeCommand) {&#xA;  const response = await fetch(url, { headers: { Range: `bytes=${start}-${end}` } });&#xA;  const data = new Uint8Array(await response.arrayBuffer());&#xA;  ffmpeg.FS(&#x27;writeFile&#x27;, &#x27;input.mkv&#x27;, data); // Use &#x27;input.mkv&#x27; as a temporary file&#xA;  await ffmpeg.run(...transcodeCommand);&#xA;  const outputData = ffmpeg.FS(&#x27;readFile&#x27;, &#x27;output.mp4&#x27;);&#xA;  appendSegmentToBuffer(outputData);&#xA;}&#xA;&#xA;function appendSegmentToBuffer(segment) {&#xA;  if (!sourceBuffer.updating) {&#xA;    sourceBuffer.appendBuffer(segment);&#xA;  } else {&#xA;    sourceBuffer.addEventListener(&#x27;updateend&#x27;, () => {&#xA;      sourceBuffer.appendBuffer(segment);&#xA;    });&#xA;  }&#xA;}&#xA;&#xA;async function createFFmpeg(options) {&#xA;  const { createFFmpeg } = FFmpeg;&#xA;  const ffmpeg = createFFmpeg(options);&#xA;  await ffmpeg.load();&#xA;  return ffmpeg;&#xA;}&#xA;&#xA;(async () => {&#xA;  await setupMediaSource();&#xA;  await transcodeVideo();&#xA;})();&#xA;&#xA;

    &#xA;