
Recherche avancée
Autres articles (72)
-
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...) -
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 -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (9245)
-
avformat_seek_file timestamps not using the correct time base
19 juin 2021, par CharlieI am in the process of creating a memory loader for ffmpeg to add more functionality. I have audio playing and working, but am having an issue with
avformat_seek_file
timestamps using the wrong format.

avformat.avformat_seek_file(file.context, -1, 0, timestamp, timestamp, 0)



From looking at the docs it says if the stream index is -1 that the time should be based on
AV_TIME_BASE
. When I load the file throughavformat_open_input
with a nullAVFormatContext
and a filename, this works as expected.

However when I create my own
AVIOContext
andAVFormatContext
throughavio_alloc_context
andavformat_alloc_context
respectively, the timestamps are no longer based onAV_TIME_BASE
. When testing I received an access violation when I first tried seeking, and upon investigating, it seems that the timestamps are based on actual seconds now. How can I make these custom contexts time based onAV_TIME_BASE
?

The only difference between the two are the custom loading of
AVIOContext
andAVFormatContext
:

data = fileobject.read()

 ld = len(data)

 buf = libavutil.avutil.av_malloc(ld)
 ptr_buf = cast(buf, c_char_p)

 ptr = ctypes.create_string_buffer(ld)
 memmove(ptr, data, ld)

 seeker = libavformat.ffmpeg_seek_func(seek_data)
 reader = libavformat.ffmpeg_read_func(read_data)
 writer = libavformat.ffmpeg_read_func(write_data)

 format = libavformat.avformat.avio_alloc_context(ptr_buf, buf_size, 0,
 ptr_data,
 reader,
 writer,
 seeker
 )

 file.context = libavformat.avformat.avformat_alloc_context()
 file.context.contents.pb = format
 file.context.contents.flags |= AVFMT_FLAG_CUSTOM_IO

 result = avformat.avformat_open_input(byref(file.context),
 b"",
 None,
 None)

 if result != 0:
 raise FFmpegException('avformat_open_input in ffmpeg_open_filename returned an error opening file '
 + filename.decode("utf8")
 + ' Error code: ' + str(result))

 result = avformat.avformat_find_stream_info(file.context, None)
 if result < 0:
 raise FFmpegException('Could not find stream info')

 return file




Here is the filename code that does work :


result = avformat.avformat_open_input(byref(file.context),
 filename,
 None,
 None)
 if result != 0:
 raise FFmpegException('avformat_open_input in ffmpeg_open_filename returned an error opening file '
 + filename.decode("utf8")
 + ' Error code: ' + str(result))

 result = avformat.avformat_find_stream_info(file.context, None)
 if result < 0:
 raise FFmpegException('Could not find stream info')

 return file



I am new to ffmpeg, but any help fixing this discrepancy is greatly appreciated.


-
Extracting frames from video with correct DateTimeOriginal exif information
3 juin 2021, par MatthiasI have an MP4 file with the
creation_time
exif information. Now I want to extract each frame from that video and write them into JPG files, however, I also need the correctDateTimeOriginal
exif tag in each of these images. So I tried to extract all those frames from the video like this :

ffmpeg -i video.mp4 frames/frame-%05d.jpg



That basically works, but when I now look into a new JPG image it seems there is not
DateTimeOriginal
exif information. I was hoping thatffmpeg
is able to write that tag, based on the position of the extracted frame in the video.

Is that possible ?

I am also willing to use another program ifffmpeg
is not the right tool for this job.

-
Can Linux buffer UDP packets to correct the sequence
6 avril 2021, par QuickPrototypeGood Day,


I am transmitting MP3 audio using UDP through the Internet. Yes, it's most likely a bad idea for various reasons, however my use case limits me to this setup. To expand further based on comments below, my source device connects over a very high latency link with low and limited throughput as these devices are located in rural/remote areas. My latency is up to 1 seconds (shocking yes). Using TCP will therefore degrade my service due to its two way coms, acks, resends and the likes.


The issue I'm trying to resolve is that on the receiver server (Linux Ubuntu 18.04), I am seeing all the packets but many times slightly out of sequence. I.e. packet 5 comes before packet 4.


Is there a way in Linux to buffer the incoming UDP stream such that consumers (FFMPEG in my case) is able to get stream in order (being a buffer, with an expected delay, that would be linked to buffer size).


Tcpdump example of issue (note : ids are out of sequence) :


16:04:48.648448 IP (tos 0x0, ttl 24, id 25335, offset 0, flags [DF], proto UDP (17), length 108)
 xx.xx.xx.xx.2011 > 172.xx.xx.xx.2011: UDP, length 80
16:04:48.648503 IP (tos 0x0, ttl 24, id 25334, offset 0, flags [DF], proto UDP (17), length 1228)
 xx.xx.xx.xx.2011 > 172.xx.xx.xx.2011: UDP, length 1200
16:04:48.884324 IP (tos 0x0, ttl 24, id 25336, offset 0, flags [DF], proto UDP (17), length 1228)
 xx.xx.xx.xx.2011 > 172.xx.xx.xx.2011: UDP, length 1200
16:04:48.884357 IP (tos 0x0, ttl 24, id 25337, offset 0, flags [DF], proto UDP (17), length 108)
 xx.xx.xx.xx.2011 > 172.xx.xx.xx.2011: UDP, length 80
16:04:49.145213 IP (tos 0x0, ttl 24, id 25339, offset 0, flags [DF], proto UDP (17), length 108)
 xx.xx.xx.xx.2011 > 172.xx.xx.xx.2011: UDP, length 80
16:04:49.145257 IP (tos 0x0, ttl 24, id 25338, offset 0, flags [DF], proto UDP (17), length 1228)
 xx.xx.xx.xx.2011 > 172.xx.xx.xx.2011: UDP, length 1200
16:04:49.406068 IP (tos 0x0, ttl 24, id 25340, offset 0, flags [DF], proto UDP (17), length 1228)
 xx.xx.xx.xx.2011 > 172.xx.xx.xx.2011: UDP, length 1200
16:04:49.406125 IP (tos 0x0, ttl 24, id 25341, offset 0, flags [DF], proto UDP (17), length 108)
 xx.xx.xx.xx.2011 > 172.xx.xx.xx.2011: UDP, length 80
16:04:49.667095 IP (tos 0x0, ttl 24, id 25342, offset 0, flags [DF], proto UDP (17), length 1228)
 xx.xx.xx.xx.2011 > 172.xx.xx.xx.2011: UDP, length 1200
16:04:49.667175 IP (tos 0x0, ttl 24, id 25343, offset 0, flags [DF], proto UDP (17), length 108)
 xx.xx.xx.xx.2011 > 172.xx.xx.xx.2011: UDP, length 80
16:04:49.929139 IP (tos 0x0, ttl 24, id 25344, offset 0, flags [DF], proto UDP (17), length 1228)
 xx.xx.xx.xx.2011 > 172.xx.xx.xx.2011: UDP, length 1200
16:04:49.929200 IP (tos 0x0, ttl 24, id 25345, offset 0, flags [DF], proto UDP (17), length 108)
 xx.xx.xx.xx.2011 > 172.xx.xx.xx.2011: UDP, length 80
16:04:50.164307 IP (tos 0x0, ttl 24, id 25346, offset 0, flags [DF], proto UDP (17), length 1228)
 xx.xx.xx.xx.2011 > 172.xx.xx.xx.2011: UDP, length 1200
16:04:50.164385 IP (tos 0x0, ttl 24, id 25347, offset 0, flags [DF], proto UDP (17), length 108)
 xx.xx.xx.xx.2011 > 172.xx.xx.xx.2011: UDP, length 80
16:04:50.425221 IP (tos 0x0, ttl 24, id 25348, offset 0, flags [DF], proto UDP (17), length 1228)
 xx.xx.xx.xx.2011 > 172.xx.xx.xx.2011: UDP, length 1200
16:04:50.425285 IP (tos 0x0, ttl 24, id 25349, offset 0, flags [DF], proto UDP (17), length 108)
 xx.xx.xx.xx.2011 > 172.xx.xx.xx.2011: UDP, length 80