
Recherche avancée
Médias (1)
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (6)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Menus personnalisés
14 novembre 2010, parMediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
Menus créés à l’initialisation du site
Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...) -
Mise à disposition des fichiers
14 avril 2011, parPar défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)
Sur d’autres sites (3965)
-
Making my Discord Bot automatically play music from WAV on loop
5 décembre 2022, par Mativ9So I was trying to make a Discord Bot in Python, which would atomatically join a voice channel and play my own music from a list in a loop. So far it's joining the channel, shuffling the list so the music is on random, but when I try to write a code so after one song it will play the next one it crushes and doesn't play anything (tho it's joining the channel)


import discord
import random
from discord.ext import commands
from discord import FFmpegPCMAudio

#playlist as a list
queue = [FFmpegPCMAudio('Iceland1.wav'), FFmpegPCMAudio('Iceland2.wav'), FFmpegPCMAudio('Iceland3.wav'), FFmpegPCMAudio('Iceland4.wav'),
 FFmpegPCMAudio('Iceland5.wav'), FFmpegPCMAudio('Iceland6.wav'), FFmpegPCMAudio('Iceland7.wav'), FFmpegPCMAudio('Iceland8.wav'),
 FFmpegPCMAudio('Iceland9.wav'), FFmpegPCMAudio('Iceland10.wav'), FFmpegPCMAudio('Norway1.wav'), FFmpegPCMAudio('Norway2.wav'),
 FFmpegPCMAudio('Norway3.wav'), FFmpegPCMAudio('Norway4.wav'), FFmpegPCMAudio('Norway5.wav'), FFmpegPCMAudio('Norway6.wav'),
 FFmpegPCMAudio('Norway7.wav'), FFmpegPCMAudio('Norway8.wav'), FFmpegPCMAudio('Norway9.wav'), FFmpegPCMAudio('Norway10.wav'),
 FFmpegPCMAudio('Norway11.wav'), FFmpegPCMAudio('Presents1.wav'), FFmpegPCMAudio('Presents2.wav'), FFmpegPCMAudio('Presents3.wav'),
 FFmpegPCMAudio('Presents4.wav'), FFmpegPCMAudio('Presents5.wav'), FFmpegPCMAudio('Presents6.wav'), FFmpegPCMAudio('Presents7.wav'),
 FFmpegPCMAudio('Presents8.wav'), FFmpegPCMAudio('Presents9.wav'), FFmpegPCMAudio('Presents10.wav'), FFmpegPCMAudio('Autumn1.wav'),
 FFmpegPCMAudio('Autumn2.wav'), FFmpegPCMAudio('Autumn3.wav'), FFmpegPCMAudio('Autumn4.wav'), FFmpegPCMAudio('Autumn5.wav'),
 FFmpegPCMAudio('Autumn6.wav'), FFmpegPCMAudio('Autumn7.wav'), FFmpegPCMAudio('Autumn8.wav'), FFmpegPCMAudio('Covers1.wav'),
 FFmpegPCMAudio('Covers2.wav'), FFmpegPCMAudio('Covers3.wav'), FFmpegPCMAudio('Covers4.wav'), FFmpegPCMAudio('Covers5.wav'),
 FFmpegPCMAudio('Covers6.wav'), FFmpegPCMAudio('Covers7.wav'), FFmpegPCMAudio('Covers8.wav'), FFmpegPCMAudio('Covers9.wav'),
 FFmpegPCMAudio('Covers10.wav'), FFmpegPCMAudio('Covers11.wav'), FFmpegPCMAudio('Covers12.wav')]

intents = discord.Intents.default()
intents.message_content = True
client = commands.Bot(command_prefix='>', intents=intents)

@client.event
async def on_ready():
 global voice
 print("The Matt Bot is ready")
 print("--------------------------")
 await client.change_presence(activity=discord.Game('Matt Krupa')) #makes my bot play Matt Krupa
 channel = client.get_channel(thechannelid) #geting channel ID
 voice = await channel.connect() #connecting to channel
 random.shuffle(queue) #randomazing the playlist
 def after_song(): #moving the first song to the end so its on loop, and playling the next one
 queue.append(queue[0])
 del queue[0]
 player = await voice.play(queue[0], after=await after_song())
 player = await voice.play(queue[0], after=await after_song()) #plays song from the playlist, after the song doing the after_song() function

client.run(mytokenidontwanttoshowitsry)



I wanted it to play all the songs on the infinite loop, i can't find how to correctly detect the end of a song...


-
rgb32 data resource mapping. using directx memcpy
17 janvier 2019, par Sang Hun KimI have been trying to solve the problem for a month with googling.
But Now I have to ask for help here.I want to render using ffmpeg decoded frame.
and using frame(it converted to RGB32 format), I try to render frame with DX2D texture.ZeroMemory(&TextureDesc, sizeof(TextureDesc));
TextureDesc.Height = pFrame->height;
TextureDesc.Width = pFrame->width;
TextureDesc.MipLevels = 1;
TextureDesc.ArraySize = 1;
TextureDesc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; //size 16
TextureDesc.SampleDesc.Count = 1;
TextureDesc.SampleDesc.Quality = 0;
TextureDesc.Usage = D3D11_USAGE_DYNAMIC;
TextureDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
TextureDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
TextureDesc.MiscFlags = 0;
result = m_device->CreateTexture2D(&TextureDesc, NULL, &m_2DTex);
if (FAILED(result)) return false;
ShaderResourceViewDesc.Format = TextureDesc.Format;
ShaderResourceViewDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
ShaderResourceViewDesc.Texture2D.MostDetailedMip = 0;
ShaderResourceViewDesc.Texture2D.MipLevels = 1;
D3D11_MAPPED_SUBRESOURCE S_mappedResource_tt = { 0, };
ZeroMemory(&S_mappedResource_tt, sizeof(D3D11_MAPPED_SUBRESOURCE));
result = m_deviceContext->Map(m_2DTex, 0, D3D11_MAP_WRITE_DISCARD, 0, &S_mappedResource_tt);
if (FAILED(result)) return false;
BYTE* mappedData = reinterpret_cast<byte>(S_mappedResource_tt.pData);
for (auto i = 0; i < pFrame->height; ++i) {
memcpy(mappedData, pFrame->data, pFrame->linesize[0]);
mappedData += S_mappedResource_tt.RowPitch;
pFrame->data[0] += pFrame->linesize[0];
}
m_deviceContext->Unmap(m_2DTex, 0);
result = m_device->CreateShaderResourceView(m_2DTex, &ShaderResourceViewDesc, &m_ShaderResourceView);
if (FAILED(result)) return false;
m_deviceContext->PSSetShaderResources(0, 1, &m_ShaderResourceView);
</byte>but it shows me just black screen(nothing render).
I guess it’s wrong memcpy size.
The biggest problem is that I don’t know what is the problem.Question 1 :
It has any problem creating 2D texture for mapping ?Question 2 :
What size of the memcpy parameters should I enter (related to formatting) ?I based on the link below.
[1]https://www.gamedev.net/forums/topic/667097-copy-2d-array-into-texture2d/
[2]https://www.gamedev.net/forums/topic/645514-directx-11-maping-id3d11texture2d/
[3]https://www.gamedev.net/forums/topic/606100-solved-dx11-updating-texture-data/Thank U for watching, Please reply.
-
Is using timestamp in FFmpeg output a valid way to check video integrity
1er janvier 2023, par GaryI am using the timestamps that FFmpeg outputs to get information about the video integrity. So far I have tested this on about 50 videos and only had one "Unusual time skip" false positive.


Is this method of checking a valid way to do this, could there be legitimate reasons why the time skip would significantly increase and is there a more accurate way to determine an invalid time skip than
$dif*2
?

ffmpegIntegrityCheck() {
 local frame=0
 local prevFrame=0
 local duration=0
 local timestamp=0
 local seconds=0
 local prevSeconds=0
 local dif=0
 local line=""

 ffmpeg -v debug -progress - -nostats -i "$1" -f null - 2>&1 \
 | while read -r line; do
 # Get the video duration
 if [[ "$duration" = 0 && "$line" =~ "Duration: " ]]; then
 duration=${line#* }
 duration=${duration%, start*}
 duration=${duration%.*}
 echo "Duration $duration"

 # Check if the frame number stops increasing
 elif [[ "$line" =~ "frame=" ]]; then
 frame=${line#*=}

 if [ "$frame" = "$prevFrame" ]; then
 echo "No frame change at $timestamp frame $frame"
 fi
 prevFrame="$frame"

 # Check the increase in seconds between each timestamp,
 elif [[ "$line" =~ "out_time=" ]]; then
 timestamp=${line#*=}
 timestamp=${timestamp%.*}
 seconds=$(echo "$timestamp" \
 | awk -F: '{ print ($1 * 3600) + ($2 * 60) + $3 }')

 if [ "$dif" != 0 ] && (( $seconds-$prevSeconds > $dif*2 )); then
 echo "Unusual time skip at $timestamp"
 else
 dif=$(($seconds-$prevSeconds))
 fi
 prevSeconds="$seconds"

 # Check if the last timestamp matches the duration 
 elif [[ "$line" = "progress=end" ]]; then
 if [ "$duration" != "$timestamp" ]; then
 duration=$(echo "$duration" \
 | awk -F: '{ print ($1 * 3600) + ($2 * 60) + $3 }')

 if (( $seconds < $duration-1 || $seconds > $duration+1 )); then
 echo "End time mismatch at $timestamp"
 fi
 fi
 fi
 done
}



The reason I am trying to check with more than just
ffmpeg -v error
is because I have found corrupted files where ffmpeg has reported no errors. I have also found files where FFmpeg reports errors but when I watch the video there are no problems so I would like to try and check whether there are any playback problems without watching it.

The logic behind looking at the timestamp jumps was that if the file all of a sudden starts processing significantly faster, I assume it is having errors and skipping some processing. This assumption does seem to match my results with files where
ffmpeg -v error
is reporting errors but it does produce some false positives

The log from a file producing errors in FFmpeg :


Duration 01:36:32
No frame change at 00:48:29 frame 69673
Unusual time skip at 00:49:42
No frame change at 00:49:42 frame 69673
Unusual time skip at 00:50:58
No frame change at 00:50:58 frame 69673
Unusual time skip at 00:51:44
No frame change at 00:51:44 frame 69673
Unusual time skip at 00:53:09
No frame change at 00:53:09 frame 69673
Unusual time skip at 00:54:04
No frame change at 00:54:04 frame 69673
Unusual time skip at 00:55:25
No frame change at 00:55:25 frame 69673
Unusual time skip at 00:56:32
No frame change at 00:56:32 frame 69673
Unusual time skip at 00:57:30
No frame change at 00:57:30 frame 69673
Unusual time skip at 00:58:08
No frame change at 00:58:08 frame 69673
Unusual time skip at 00:59:37
No frame change at 00:59:37 frame 69673
No frame change at 01:00:02 frame 69673
Unusual time skip at 01:01:19
No frame change at 01:01:19 frame 69673
Unusual time skip at 01:02:33
No frame change at 01:02:33 frame 69673
Unusual time skip at 01:03:39
No frame change at 01:03:39 frame 69673
No frame change at 01:03:39 frame 69673
No frame change at 01:06:02 frame 69673
No frame change at 01:06:25 frame 69673
Unusual time skip at 01:08:18
No frame change at 01:08:18 frame 69673
Unusual time skip at 01:09:19
No frame change at 01:09:19 frame 69673
Unusual time skip at 01:10:19
No frame change at 01:10:19 frame 69673
Unusual time skip at 01:11:26
No frame change at 01:11:26 frame 69673
Unusual time skip at 01:12:39
No frame change at 01:12:39 frame 69673
Unusual time skip at 01:13:53
No frame change at 01:13:53 frame 69673
Unusual time skip at 01:14:55
No frame change at 01:14:55 frame 69673
No frame change at 01:14:59 frame 69673
Unusual time skip at 01:17:04
No frame change at 01:17:04 frame 69673
No frame change at 01:17:04 frame 69673
No frame change at 01:19:01 frame 69673
No frame change at 01:19:25 frame 69673
Unusual time skip at 01:21:07
No frame change at 01:21:07 frame 69673
No frame change at 01:21:40 frame 69673
Unusual time skip at 01:23:34
No frame change at 01:23:34 frame 69673
No frame change at 01:24:18 frame 69673
No frame change at 01:25:34 frame 69673
No frame change at 01:26:41 frame 69673
No frame change at 01:27:48 frame 69673
No frame change at 01:28:06 frame 69673
Unusual time skip at 01:29:01
No frame change at 01:29:01 frame 69673
Unusual time skip at 01:30:38
No frame change at 01:30:38 frame 69673
No frame change at 01:30:38 frame 69673
No frame change at 01:33:15 frame 69673
No frame change at 01:33:51 frame 69673
Unusual time skip at 01:35:24
No frame change at 01:35:24 frame 69673
End time mismatch at 01:36:16