
Recherche avancée
Autres articles (53)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Les vidéos
21 avril 2011, parComme les documents de type "audio", Mediaspip affiche dans la mesure du possible les vidéos grâce à la balise html5 .
Un des inconvénients de cette balise est qu’elle n’est pas reconnue correctement par certains navigateurs (Internet Explorer pour ne pas le nommer) et que chaque navigateur ne gère en natif que certains formats de vidéos.
Son avantage principal quant à lui est de bénéficier de la prise en charge native de vidéos dans les navigateur et donc de se passer de l’utilisation de Flash et (...) -
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)
Sur d’autres sites (7742)
-
Decode opus audio using ffmpeg lib not giving proper audio
31 octobre 2018, par Harshpal GosaviThis is my code in this code all data is printing correct and there is no error but its not playing correctly. I am getting audio like radio voice. Human voice is not audible as it is continuosly playing radio like sound. I am not sure whether all values are correct or not. But if I change it then it wont work. Please help me how can I get proper audio voice.
Opus.cpp
{ void Opus::Decode1_working(int8_t *inBuf, int inLen , int16_t *outBuf, int *decodedLen)
{
AVPacket avpkt;
AVFrame *decoded_frame = NULL;
av_init_packet(&avpkt);
avpkt.data = (uint8_t*)inBuf;
avpkt.size = inLen;
decoded_frame = av_frame_alloc();
av_frame_unref(decoded_frame);
int len = avcodec_send_packet(c, &avpkt);
if (len < 0)
{
//Error
return;
}
else
{
int retval = avcodec_receive_frame(c, decoded_frame);
if(retval >= 0)
{
const AVCodecDescriptor *codesc = avcodec_descriptor_get(c->codec_id);
int planeSize;
int data_size = av_samples_get_buffer_size
(&planeSize,
c->channels,
decoded_frame->nb_samples,
c->sample_fmt,
1);
if(data_size < AUDIO_MAXBUF_SIZE)
{
memcpy(outBuf, decoded_frame->data[0], (data_size));// * sizeof(uint8_t)));
*decodedLen = data_size;
}
else
{
//Not copied
}
}
}
av_frame_free(&decoded_frame);
}
int Opus::init(void *args) {
i_sampleRate = 0;
i_channels = 0;
avcodec_register_all();
codec = avcodec_find_decoder(AV_CODEC_ID_OPUS);
if(codec ==NULL)
{
//Codec not open
}
c= avcodec_alloc_context3(codec);
c->sample_rate = 48000;
c->channels = 1;
c->bit_rate = 48000;
av_opt_set_int(c, "refcounted_frames", 1, 0);
int codecOpen = 0;
codecOpen = avcodec_open2(c, codec,NULL);//,&audioOptionsDict) ;
if (codecOpen < 0)
{
//return error;
}
return 0;
}
int Opus::decode(Packet *packet) {
int8_t *data = new int8_t[packet->size];
memcpy(data, packet->data, (packet->size * sizeof(int8_t)));
long length = packet->size;
int16_t *pcmdata = new int16_t[AUDIO_MAXBUF_SIZE];//[outLen];
i_sampleRate = 48000;
i_channels = 1;
int decodedLen = 0;
Decode1_working(data,length,pcmdata, &decodedLen);
if (p_callback)
{
++i_framesDecoded;
p_callback->AfterAudioDecode((u8*)pcmdata,
//length * sizeof(u8),
decodedLen,//* sizeof(u8),
packet->pts);
}
return 1;
}
} -
lavc/htmlsubtitles : improve handling broken garbage
29 juillet 2017, par Clément Bœschlavc/htmlsubtitles : improve handling broken garbage
This commit switches off forced correct nesting of tags and only keeps
it for font tags. See long explanations in the code for the rationale.This results in various FATE changes which I'll explain here :
various swapping in font attributes, this is mostly noise due to the
old reverse stack way of printing them. The new one is more correct as
the last attribute takes over the previous ones.unrecognized tags disappears
invalid tags that were previously displayed aren't anymore (instead,
we have a warning). This is better for the end userThe main benefit of this commit is to be more tolerant to error, leading
to a better handling of badly nested tags or random wrong formatting for
the end user. -
Animating a 2D plot (2D brownian motion) not working in Python
8 avril 2020, par Thamu MnyulwaI am trying to plot a 2D Brownian motion in Python but my plot plots the grid but does not animate the line.



Attempted at performing this plot is below,



!apt install ffmpeg

import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import matplotlib.animation as animation


np.random.seed(5)


# Set up formatting for the movie files
Writer = animation.writers['ffmpeg']
writer = Writer(fps=15, metadata=dict(artist='Me'), bitrate=1800)


def generateRandomLines(dt, N):
 dX = np.sqrt(dt) * np.random.randn(1, N)
 X = np.cumsum(dX, axis=1)

 dY = np.sqrt(dt) * np.random.randn(1, N)
 Y = np.cumsum(dY, axis=1)

 lineData = np.vstack((X, Y))

 return lineData


# Returns Line2D objects
def updateLines(num, dataLines, lines):
 for u, v in zip(lines, dataLines):
 u.set_data(v[0:2, :num])

 return lines

N = 501 # Number of points
T = 1.0
dt = T/(N-1)


fig, ax = plt.subplots()

data = [generateRandomLines(dt, N)]

ax = plt.axes(xlim=(-2.0, 2.0), ylim=(-2.0, 2.0))

ax.set_xlabel('X(t)')
ax.set_ylabel('Y(t)')
ax.set_title('2D Discretized Brownian Paths')

## Create a list of line2D objects
lines = [ax.plot(dat[0, 0:1], dat[1, 0:1])[0] for dat in data]


## Create the animation object
anim = animation.FuncAnimation(fig, updateLines, N+1, fargs=(data, lines), interval=30, repeat=True, blit=False)

plt.tight_layout()
plt.show()

## Uncomment to save the animation
#anim.save('brownian2d_1path.mp4', writer=writer)




However, instead of performing the plot the program is printing,




How do I animate this plot ? I am new to python so I apologize in advanced if this is an easy question.



I found this question on http://people.bu.edu/andasari/courses/stochasticmodeling/lecture5/stochasticlecture5.html , there is a walkthrough of how this code came to being.