
Recherche avancée
Autres articles (58)
-
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 (...) -
Contribute to a better visual interface
13 avril 2011MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community. -
Contribute to translation
13 avril 2011You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
MediaSPIP is currently available in French and English (...)
Sur d’autres sites (4144)
-
My discord music bot is not playing the entire music
21 décembre 2024, par james12My discord music bot based on discord.py, yt_dlp and ffmpeg is not working.
I downloaded every module that is required and added environmental variables.
But, my discord bot is not working properly.
The bot plays the music properly at first, but the music ends before the song finishes.


Full code below :


import discord
from discord.ext import commands
import yt_dlp

app = commands.Bot(command_prefix='!', intents=discord.Intents.all())
ydl_opts = {
 'format': 'bestaudio/best',
 'extractaudio': True,
 'audioformat': 'mp3',
 'outtmpl': 'downloads/%(title)s.%(ext)s',
 'quiet': True,
}

@app.event
async def on_ready():
 print('Done')
 await app.change_presence(status=discord.Status.online, activity=None)

@app.command()
async def play(ctx, *, search: str):
 channel = ctx.author.voice.channel
 voice_client = discord.utils.get(app.voice_clients, guild=ctx.guild)

 if not voice_client:
 voice_client = await channel.connect()

 with yt_dlp.YoutubeDL(ydl_opts) as ydl:
 info = ydl.extract_info(f"ytsearch:{search}", download=False)['entries'][0]
 url = info['url']
 title = info['title']

 # 음악 재생
 voice_client.play(discord.FFmpegPCMAudio(url, executable="ffmpeg"), after=lambda e: print("재생 완료"))
 await ctx.send(f"{ctx.author.mention}님이 요청하신 {title} 노래 재생 중")

@app.command()
async def stop(ctx):
 voice_client = discord.utils.get(app.voice_clients, guild=ctx.guild)
 if voice_client and voice_client.is_playing():
 voice_client.stop()
 await voice_client.disconnect()
 
app.run('token')



I tried to add options in FFmpeg like this :
options="-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5"

but it doesn't work.
I also added extra yt-dlp options.
I hope the bot properly plays the full version of music from youtube in discord.

-
FFmpeg trying to concat two like videos but the timing is off
9 avril 2022, par video487y43I am trying to concat two videos together using FFMPEG, but the output of the second video plays slow with no audio, but not only that, the time elapsed counter in the windows player counts slower as well. When I play it in VLC the timing is right but the audio is still missing.


For a better explanation of this effect please watch this video. Notice how slow the counter is




https://youtube.com/shorts/k6QD_oqTRyE?feature=share




I know the videos have to be the same type and they are both 30 fps, mp4, same size, same tbn. Here is the ffprobe results. My goal is to make compilation videos using ffmpeg since it can combine videos very fast without re-rendering them. I get the videos from tiktok. Please let me know if I can clarify this anymore. Thanks


Video 1


>Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m/bt470bg/smpte170m, progressive), 1024x576 [SAR 1:1 DAR 16:9], 622 kb/s, 30 fps, 30 tbr, 15360 tbn (default)



Video 2


>Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1024x576 [SAR 1:1 DAR 16:9], 760 kb/s, 30 fps, 30 tbr, 15360 tbn (default)



Output video


>Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1024x576 [SAR 1:1 DAR 16:9], 655 kb/s, 29.92 fps, 30 tbr, 15360 tbn (default)



And here is the code during the concat process sorry for the weird format


libavutil 57. 24.101 / 57. 24.101
libavcodec 59. 25.100 / 59. 25.100
libavformat 59. 20.101 / 59. 20.101
libavdevice 59. 6.100 / 59. 6.100
libavfilter 8. 29.100 / 8. 29.100
libswscale 6. 6.100 / 6. 6.100
libswresample 4. 6.100 / 4. 6.100
libpostproc 56. 5.100 / 56. 5.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001e74b5668c0] Auto-inserting h264_mp4toannexb bitstream filter
Input #0, concat, from 'mylist.txt':
 Duration: N/A, start: 0.000000, bitrate: 792 kb/s
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1024x576 [SAR 1:1 DAR 16:9], 760 kb/s, 30 fps, 30 tbr, 15360 tbn
 Metadata:
 handler_name : VideoHandler
 vendor_id : [0][0][0][0]
 Stream #0:1(und): Audio: aac (HE-AACv2) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 32 kb/s
Metadata:
 handler_name : SoundHandler
 vendor_id : [0][0][0][0]
Output #0, mp4, to 'output.mp4':
 Metadata:
 encoder : Lavf59.20.101
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1024x576 [SAR 1:1 DAR 16:9], q=2-31, 760 kb/s, 30 fps, 30 tbr, 15360 tbn
 Metadata:
 handler_name : VideoHandler
 vendor_id : [0][0][0][0]
 Stream #0:1(und): Audio: aac (HE-AACv2) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 32 kb/s
 Metadata:
 handler_name : SoundHandler
 vendor_id : [0][0][0][0]



Stream mapping:
 Stream #0:0 -> #0:0 (copy)
 Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mov,mp4,m4a,3gp,3g2,mj2 @ 000001e74b579400] Auto-inserting h264_mp4toannexb bitstream filter

frame= 1737 fps=0.0 q=-1.0 Lsize= 5442kB time=00:00:58.14 bitrate= 766.8kbits/s speed=1.01e+03x
video:4647kB audio:736kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.084181%



-
ffmpeg QSV hardware encoder with x11grab screen capture
11 janvier 2020, par Toby EggittI believe I have built ffmpeg with support for my motherboard’s Intel graphics processor chip, but I have not succeeded in showing this working in any way. My goal is to use it for screen capture (the ffmpeg I built does capture screen successfully using the software encoding, but this is far too slow to be useful—it manages about 12fps at a very modest quality).
My main problem—I think—is that I don’t know how to use these encoders, the examples I found all fail, which makes me suspect that what I’ve built is broken in some way. However, I also have no idea how I can verify that I built this correctly, but the following are true :
- The five components that I built to get to this all compiled without
errors (they were libva, gmmlib, intel-media-driver, libmfx, and
ffmpeg - The output of ffmpeg -encoders includes four encoders with _qsv in
their names including h264_qsv - Most of the commands I have tried result in output of this form :
[h264_qsv @ 0x55ef1dc72040] Low power mode is unsupported
[h264_qsv @ 0x55ef1dc72040] Current frame rate is unsupported
[h264_qsv @ 0x55ef1dc72040] Current picture structure is unsupported
[h264_qsv @ 0x55ef1dc72040] Current resolution is unsupported
[h264_qsv @ 0x55ef1dc72040] Current pixel format is unsupported
[h264_qsv @ 0x55ef1dc72040] some encoding parameters are not supported by the QSV runtime. Please double check the input parameters.
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or heightI have the impression this thing might be fussy about many parameters of this sort but have no idea where to find out what it would like. Any suggestions at all, how to verify it, or better yet, how to issue a command that captures screen and encodes with the hardware, would be most welcome.
- The five components that I built to get to this all compiled without