
Recherche avancée
Autres articles (85)
-
Modifier la date de publication
21 juin 2013, parComment changer la date de publication d’un média ?
Il faut au préalable rajouter un champ "Date de publication" dans le masque de formulaire adéquat :
Administrer > Configuration des masques de formulaires > Sélectionner "Un média"
Dans la rubrique "Champs à ajouter, cocher "Date de publication "
Cliquer en bas de la page sur Enregistrer -
À propos des documents
21 juin 2013, parQue faire quand un document ne passe pas en traitement, dont le rendu ne correspond pas aux attentes ?
Document bloqué en file d’attente ?
Voici une liste d’actions ordonnée et empirique possible pour tenter de débloquer la situation : Relancer le traitement du document qui ne passe pas Retenter l’insertion du document sur le site MédiaSPIP Dans le cas d’un média de type video ou audio, retravailler le média produit à l’aide d’un éditeur ou un transcodeur. Convertir le document dans un format (...) -
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
Sur d’autres sites (6431)
-
AttributeError : 'FilterableStream' object has no attribute 'input' - ffmpeg-python
26 septembre 2024, par KarolekI am a fresh programmer and I am learning the Python language.
I have been trying to design a graphical application (using tkinter and ffmpeg-python libraries) that converts an image file along with audio into a video of audio length displaying the image. Unfortunately whenever I try run program I keep encountering errors


At first it was due to installing the ffmpeg library in pip package manager instead of ffmpeg-python. I uninstalled the previous one, installing the correct one making sure no other package causes problems. Using a short script like this, the library functioned smoothly :


'''
The Error causing Statement
import ffmpeg 
(
 ffmpeg.input("something.mp3")
 .output("output.wav")
 .run()
)
'''
# When I tried to use the ffmpeg library in a graphics program within a function, unfortunately I was not able to get it to work

import tkinter as tk
from tkinter import filedialog
from tkinter import ttk

def select_image():
 file_path = filedialog.askopenfilename(title="Select a file", filetypes=[("image files","*.jpg;*.png;*.gif;*.jfif;")])
 print("Selected file:", file_path)

def select_audio():
 file_path = filedialog.askopenfilename(title="Select a file", filetypes=[("audio files","*.mp3;*.wav;*.ogg;*.flac;*.m4a;*.acc;")])
 print("Selected file:", file_path)

def create_video(image_file, audio_file, output_format):
 import ffmpeg
 (
 ffmpeg.input(image_file, loop=1)
 .input(audio_file)
 .output("output" + output_format)
 .run()
 ) 

def choose_directory():
 directory_path = filedialog.askdirectory(title="Select directory")
 print("Selected directory:", directory_path)


root = tk.Tk()

root.title("Audio To Video Converter")
root.geometry("500x700")

title = tk.Label(root, text="Audio To Video Converter", font=('Arial', 28))
title.pack(padx=20, pady=20)

selectImage_button = tk.Button(root, text="Select image", command=select_image, height=3, width=50)
selectImage_button.pack(pady=10, padx=20)
selectAudio_button = tk.Button(root, text="Select audio", command=select_audio, height=3, width=50)
selectAudio_button.pack(pady=10, padx=20)

label1 = tk.Label(root, text="Output video format", font=('Arial', 16))
label1.pack(padx=20, pady=10)

outputFormat = ttk.Combobox(root, width=55)
outputFormat['values'] = ('.avi', '.mkv', '.mp4', '.webm')
outputFormat['state'] = 'readonly'
outputFormat.pack(pady=5, padx=20)

label2 = tk.Label(root, text="Output directory", font=('Arial', 16))
label2.pack(padx=20, pady=10)

outputDirectory_button = tk.Button(root, text="Select directory", command=choose_directory, height=3, width=50)
outputDirectory_button.pack(pady=5, padx=60)


convert_button = tk.Button(root, text="Convert", height=3, width=50, command=create_video(selectImage_button, selectAudio_button, outputFormat['values'] ))

root.mainloop()



This is the only thing the console displayed after attempting to run


Traceback (most recent call last):
 File "c:\Users\Admin\Documents\konwerter\konwerter.py", line 56, in <module>
 convert_button = tk.Button(root, text="Convert", height=3, width=50, command=create_video(selectImage_button, selectAudio_button, outputFormat['values'] ))
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "c:\Users\Admin\Documents\konwerter\konwerter.py", line 17, in create_video
 .input(audio_file)
 ^^^^^
AttributeError: 'FilterableStream' object has no attribute 'input'
</module>


I did some research and did not find any information about this error except that it may be due to installing the wrong libraries. This is my list of installed libraries in pip package manager :


colored 2.2.4 customtkinter 5.2.2 darkdetect 0.8.0 ffmpeg-python 0.2.0 future 1.0.0 Gooey 1.0.8.1 packaging 24.1 pillow 10.4.0 pip 24.2 psutil 6.0.0 pyee 12.0.0 pygtrie 2.5.0 six 1.16.0 tkinterdnd2 0.4.2 typing_extensions 4.12.2 wxPython 4.2.2



Perhaps the solution to the problem is simple, but I am new and don't understand many things. I will be very grateful for your answer !


-
How to analyse 404 pages
1er juillet 2019, par Matomo Core Team — Development, Plugins -
FFMPEG with dashjs
14 avril 2017, par Dániel KisI am going to create a live video & audio stream with ffmeg with libvpx-vp9 codec, and I want to view it from html5 browser with dashjs. But when the dashjs opens the video it seatches for chunks than not yet exits.
Here is how I create the stream :
VP9_LIVE_PARAMS="-speed 6 -tile-columns 4 -frame-parallel 1 -threads 8 -static-thresh 0 -max-intra-rate 300 -deadline realtime -lag-in-frames 0 -error-resilient 1"
TARGET_PATH="/var/www/html/live/stream"
ffmpeg \
-thread_queue_size 8192 \
-f v4l2 -input_format mjpeg -r 30 -s 640x360 -i /dev/video0 \
-thread_queue_size 16384 \
-f alsa -ar 44100 -ac 2 -i hw:1,0 \
-map 0:0 \
-pix_fmt yuv422p \
-c:v libvpx-vp9 \
-s 640x360 -keyint_min 60 -g 60 ${VP9_LIVE_PARAMS} \
-b:v 300k \
-f webm_chunk \
-header "${TARGET_PATH}/glass_360.hdr" \
-chunk_start_index 1 \
"${TARGET_PATH}/glass_360_%d.chk" \
-map 1:0 \
-c:a libvorbis \
-b:a 64k -ar 44100 \
-f webm_chunk \
-audio_chunk_duration 2000 \
-header "${TARGET_PATH}/glass_171.hdr" \
-chunk_start_index 1 \
"${TARGET_PATH}/glass_171_%d.chk" \some seconds later I call the ffmpeg again to create manifest file :
ffmpeg \
-analyzeduration 1000\
-f webm_dash_manifest -live 1 \
-i "${TARGET_PATH}/glass_360.hdr" \
-f webm_dash_manifest -live 1 \
-i "${TARGET_PATH}/glass_171.hdr" \
-c copy \
-map 0 -map 1 \
-f webm_dash_manifest -live 1 \
-adaptation_sets "id=0,streams=0 id=1,streams=1" \
-chunk_start_index 1 \
-chunk_duration_ms 2000 \
-time_shift_buffer_depth 7200 \
-minimum_update_period 7200 \
"${TARGET_PATH}/glass_live_manifest.mpd"My server’s clock is synced to "http://time.akamai.com/?iso"
HTML5 player :
<code class="echappe-js"><script src="https://cdn.dashjs.org/latest/dash.all.min.js"></script>Live broadcast<script><br />
var url = "glass_live_manifest.mpd";<br />
var player = dashjs.MediaPlayer().create();<br />
player.initialize(document.querySelector("#videoPlayer"), url, true);<br />
<br />
</script>