
Recherche avancée
Médias (1)
-
Collections - Formulaire de création rapide
19 février 2013, par
Mis à jour : Février 2013
Langue : français
Type : Image
Autres articles (55)
-
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...) -
Selection of projects using MediaSPIP
2 mai 2011, parThe examples below are representative elements of MediaSPIP specific uses for specific projects.
MediaSPIP farm @ Infini
The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...) -
Use, discuss, criticize
13 avril 2011, parTalk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
A discussion list is available for all exchanges between users.
Sur d’autres sites (5664)
-
Using ffmpeg to record screen returns corrupted file
8 août 2020, par odddollarI'm using ffmpeg and python to record my desktop screen. I've got it working so that when I input a shortcut, it starts recording. Then I use .terminate() on the subprocess to stop recording. When outputting to an mp4, this corrupts the file and makes it unreadable. I can output the file as an flv or avi and it doesn't get corrupted, but then the video doesn't contain time/duration data, something I need.


Is there a way I can gracefully stop the recording when outputting an mp4 ?
Or is there a way I can include the time/duration data in the flv/avi ?


import keyboard
import os
from subprocess import Popen

class Main:
 def __init__(self):
 self.on = False

 def main(self):
 if not self.on:
 if os.path.isfile("output.mp4"):
 os.remove("output.mp4")

 self.process = Popen('ffmpeg -f gdigrab -framerate 30 -video_size 1920x1080 -i desktop -b:v 5M output.mp4')
 self.on = True
 else:
 self.process.terminate()

 self.on = False

run = Main()
keyboard.add_hotkey("ctrl+shift+g", lambda:run.main())

keyboard.wait()



-
FFMpeg returns error : Unrecognized option 'master_pl_name'
14 février 2021, par jonatasosI used this command (described at the processing message bellow) on my application several times before and always worked well. Now returns that error.


'/usr/bin/ffmpeg' '-y' '-threads' '12' '-i' 
'/home/vagrant/code/myapp/storage/videos/videos_disk/a3.mp4' '-map' '0' '-vcodec' 'libx264' 
'-b:v' '500k' '-g' '48' '-hls_playlist_type' 'vod' '-hls_time' '10' '-hls_segment_filename' 
'/home/vagrant/code/myapp/storage/app/public/test_0_500_%05d.ts' '-master_pl_name' 
'master_playlist_guide_0.m3u8' '-acodec' 'aac' '-b:a' '128k' 
'/home/vagrant/code/myapp/storage/app/public/test_0_500.m3u8' '-map' '0' '-vcodec' 
'libx264' '-b:v' '1500k' '-g' '48' '-hls_playlist_type' 'vod' '-hls_time' '10' '-hls_segment_filename' 
'/home/vagrant/code/myapp/storage/app/public/test_1_1500_%05d.ts' '-master_pl_name' 
'master_playlist_guide_1.m3u8' '-acodec' 'aac' '-b:a' '128k' 
'/home/vagrant/code/myapp/storage/app/public/test_1_1500.m3u8' '-map' '0' '-vcodec' 
'libx264' '-b:v' '3000k' '-g' '48' '-hls_playlist_type' 'vod' '-hls_time' '10' '-hls_segment_filename' 
'/home/vagrant/code/myapp/storage/app/public/test_2_3000_%05d.ts' '-master_pl_name' 
'master_playlist_guide_2.m3u8' '-acodec' 'aac' '-b:a' '128k' 
'/home/vagrant/code/myapp/storage/app/public/test_2_3000.m3u8'



(single line:) '/usr/bin/ffmpeg' '-y' '-threads' '12' '-i' '/home/vagrant/code/myapp/storage/videos/videos_disk/a3.mp4' '-map' '0' '-vcodec' 'libx264' '-b:v' '500k' '-g' '48' '-hls_playlist_type' 'vod' '-hls_time' '10' '-hls_segment_filename' '/home/vagrant/code/myapp/storage/app/public/test_0_500_%05d.ts' '-master_pl_name' 'master_playlist_guide_0.m3u8' '-acodec' 'aac' '-b:a' '128k' '/home/vagrant/code/myapp/storage/app/public/test_0_500.m3u8' '-map' '0' '-vcodec' 'libx264' '-b:v' '1500k' '-g' '48' '-hls_playlist_type' 'vod' '-hls_time' '10' '-hls_segment_filename' '/home/vagrant/code/myapp/storage/app/public/test_1_1500_%05d.ts' '-master_pl_name' 'master_playlist_guide_1.m3u8' '-acodec' 'aac' '-b:a' '128k' '/home/vagrant/code/myapp/storage/app/public/test_1_1500.m3u8' '-map' '0' '-vcodec' 'libx264' '-b:v' '3000k' '-g' '48' '-hls_playlist_type' 'vod' '-hls_time' '10' '-hls_segment_filename' '/home/vagrant/code/myapp/storage/app/public/test_2_3000_%05d.ts' '-master_pl_name' 'master_playlist_guide_2.m3u8' '-acodec' 'aac' '-b:a' '128k' '/home/vagrant/code/myapp/storage/app/public/test_2_3000.m3u8':




This is the error returned :


ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
 configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
 libavutil 55. 78.100 / 55. 78.100
 libavcodec 57.107.100 / 57.107.100
 libavformat 57. 83.100 / 57. 83.100
 libavdevice 57. 10.100 / 57. 10.100
 libavfilter 6.107.100 / 6.107.100
 libavresample 3. 7. 0 / 3. 7. 0
 libswscale 4. 8.100 / 4. 8.100
 libswresample 2. 9.100 / 2. 9.100
 libpostproc 54. 7.100 / 54. 7.100
Unrecognized option 'master_pl_name'.
Error splitting the argument list: Option not found



I`ve reinstalled the ffmpeg, also tested in a virtual machine and the same error happens.


Live server : CentOS 7 / Apache2 / PHP-fpm 7.3 ;
Virtual machine : Ubuntu 20.04 / nginx / PHP-fpm 7.4.5


I really have no clue about what to do about it now.


-
Discord bot returns ffmpeg error despite being added to PATH
22 février 2024, par SamI am creating a Discord bot to play music via Youtube as practice with APIs. Every time I run the command to play a Youtube video I am met with "ffmpeg was not found". I have downloaded ffmpeg (as I'm on Windows) and moved the folder to my C : drive. Once done, I've added it to the path within environment variables. The error persists.


- 

- I've added ffmpeg to my PATH as described in this video.
- Additionally, I've found forums where the suggested answer is to add ffmpeg to your PATH.






In command prompt, if I type "ffmpeg" it returns "'FFmpeg' is not recognized as an internal or external command, operable program or batch file."


Here is my code :


from typing import Final
import os
from dotenv import load_dotenv
from discord import Intents, Client, Message
from responses import get_response
import asyncio
import yt_dlp
import discord

#Step 0: Load our token from somewhere safe
load_dotenv()
#Final decorator makes it so that this cannot be overwritten or have subclasses
TOKEN: Final[str] = os.getenv('DISCORD_TOKEN')


voice_clients = {}
#Settings for the video download.
yt_dl_opts = {'format': 'bestaudio/best'}
ytdl = yt_dlp.YoutubeDL(yt_dl_opts)

#Settings for ffmpeg. 
ffmpeg_options = {'options': '-vn'}

# Step 1: Bot Setup - activate intents
intents: Intents = Intents.default()
intents.message_content = True #NOQA
client: Client = Client(intents=intents)

#Step 2: Message Functionality
async def send_message(message: Message, user_message: str):
 if not user_message:
 print('Message was empty because intents were not enabled... probably')
 return
 
 # The := "Walrus Operator" is used to prompt for input.
 if is_private := user_message[0] == '?':
 user_message = user_message[1:]
 
 try:
 response: str = get_response(user_message)
 await message.author.send(response) if is_private else await message.channel.send(response)
 except Exception as e:
 print(e)

#Step 3: Handling the startup for our bot.
 
@client.event
async def on_ready() -> None:
 print(f"{client.user} is now running")

#Step 4: Handle incoming messages
@client.event
async def on_message(message: Message) -> None:
 if message.author == client.user:
 return
 
 username: str = str(message.author)
 user_message: str = message.content
 channel: str = str(message.channel)

 print(f"[{channel}] {username}: '{user_message}")
 await send_message(message, user_message)

 if message.content.startswith("!play"):
 try:
 url = message.content.split()[1]
 
 #Handles the voice connection that a bot has to a certain channel
 voice_client = await message.author.voice.channel.connect()
 voice_clients[voice_client.guild.id] = voice_client

 loop = asyncio.get_event_loop()
 data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download=False))

 song = data['url']
 player = discord.FFmpegPCMAudio(song, **ffmpeg_options)

 voice_client.play(player)



 except Exception as err:
 print(err)

# Step 5: Main entry point
def main() -> None:
 client.run(token=TOKEN)

if __name__ == '__main__':
 main()```