
Recherche avancée
Médias (91)
-
Head down (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Echoplex (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Discipline (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
Letting you (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
1 000 000 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
-
999 999 (wav version)
26 septembre 2011, par
Mis à jour : Avril 2013
Langue : English
Type : Audio
Autres articles (63)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
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" (...) -
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs
Sur d’autres sites (10540)
-
libav : Store h264 frames in mp4 container
25 janvier 2024, par ImJustACowLolI'm making a C++ application that retrieves frames from a camera and then encodes each frame with a H264 encoder (not using libav). This encoded H264 frame is then kept in memory as a
void *mem
as I need to do several things with the encoded frame.

One of the things I need to do, is store the frames (so the
void *mem
pointers) in a.mp4
container usinglibavcodec
/libavformat
. I do NOT want to transcode each frame, I just want to store them directly into the mp4 container.

Preferably for each individual frame that I push through, I get the resulting data as a return type from the function (not sure if this is possible ?). If this is not possible, then writing to a file directly is OK as well.


How does one go about doing this with libav ?


The only part I have got so far, and where I'm getting stuck, is this :


/*
some private fields accessible in MP4Muxer:
int frameWidth_, frameHeight_, frameRate_, srcBitRate_;
*/


void MP4Muxer::muxFrame(void *mem, size_t len, int64_t timestamp, bool keyFrame) {
 const AVOutputFormat* outputFormat = av_guess_format("mp4", NULL, NULL);
 AVFormatContext* outputFormatContext = avformat_alloc_context();
 outputFormatContext->oformat = outputFormat;
 AVStream* videoStream = avformat_new_stream(outputFormatContext, NULL);

 videoStream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
 videoStream->codecpar->codec_id = AV_CODEC_ID_H264;
 videoStream->codecpar->width = frameWidth_;
 videoStream->codecpar->height = frameHeight_;
 videoStream->avg_frame_rate = (AVRational) {frameRate_, 1};
 videoStream->time_base = (AVRational) {1, 90000};

}



How do I continue from here ? Are there any good resources I can follow ? There are some resources I found online, but all of them either write the output directly to a file, read input directly from streams/files etc. so I have a hard time translating them to my needs.


-
aarch64 : Add NEON optimizations for 10 and 12 bit vp9 loop filter
5 janvier 2017, par Martin Storsjöaarch64 : Add NEON optimizations for 10 and 12 bit vp9 loop filter
This work is sponsored by, and copyright, Google.
This is similar to the arm version, but due to the larger registers
on aarch64, we can do 8 pixels at a time for all filter sizes.Examples of runtimes vs the 32 bit version, on a Cortex A53 :
ARM AArch64
vp9_loop_filter_h_4_8_10bpp_neon : 213.2 172.6
vp9_loop_filter_h_8_8_10bpp_neon : 281.2 244.2
vp9_loop_filter_h_16_8_10bpp_neon : 657.0 444.5
vp9_loop_filter_h_16_16_10bpp_neon : 1280.4 877.7
vp9_loop_filter_mix2_h_44_16_10bpp_neon : 397.7 358.0
vp9_loop_filter_mix2_h_48_16_10bpp_neon : 465.7 429.0
vp9_loop_filter_mix2_h_84_16_10bpp_neon : 465.7 428.0
vp9_loop_filter_mix2_h_88_16_10bpp_neon : 533.7 499.0
vp9_loop_filter_mix2_v_44_16_10bpp_neon : 271.5 244.0
vp9_loop_filter_mix2_v_48_16_10bpp_neon : 330.0 305.0
vp9_loop_filter_mix2_v_84_16_10bpp_neon : 329.0 306.0
vp9_loop_filter_mix2_v_88_16_10bpp_neon : 386.0 365.0
vp9_loop_filter_v_4_8_10bpp_neon : 150.0 115.2
vp9_loop_filter_v_8_8_10bpp_neon : 209.0 175.5
vp9_loop_filter_v_16_8_10bpp_neon : 492.7 345.2
vp9_loop_filter_v_16_16_10bpp_neon : 951.0 682.7This is significantly faster than the ARM version in almost
all cases except for the mix2 functions.Based on START_TIMER/STOP_TIMER wrapping around a few individual
functions, the speedup vs C code is around 2-3x.Signed-off-by : Martin Storsjö <martin@martin.st>
-
Moviepy has issues when concatenating ImageClips of different dimensions
22 mars 2021, par Lysander CoxExample of the issues : https://drive.google.com/file/d/1WxfYtDTD0kc_4WQzzvB6QXkZWo-e2Vuk/view?usp=sharing


Here's the code that led to the issue :


def fragmentConcat(comment, filePrefix):
 finalClips = []
 dirName = filePrefix + comment['id']
 vidClips = [mpy.VideoFileClip(dirName + '/' + file) for file 
 in natsorted(os.listdir(dirName))]
 
 finalClip = mpy.concatenate_videoclips(vidClips, method = "compose")
 finalClips.append(finalClip)
 
 if 'replies' in comment:
 for reply in comment['replies']:
 finalClips += fragmentConcat(reply, filePrefix)
 
 return finalClips

def finalVideoMaker(thread):
 fragmentGen(thread)
 filePrefix = thread['id'] + '/videos/'

 #Clips of comments and their children being read aloud.
 commentClips = []

 for comment in thread['comments']:
 commentClipFrags = fragmentConcat(comment, filePrefix)
 commentClip = mpy.concatenate_videoclips(commentClipFrags, method = "compose")
 commentClips.append(commentClip)

 #1 second of static to separate clips.
 staticVid = mpy.VideoFileClip('assets/static.mp4')
 commentClips.append(staticVid)

 finalVid = mpy.concatenate_videoclips(commentClips)
 finalVid.write_videofile(thread['id'] + '/final.mp4')



I'm certain that these issues appear somewhere in here, because the individual video "fragments" (which are concatenated here) do not exhibit the issue with the clip I showed.


I have tried adding and removing the
method = "compose"
parameter. It does not seem to have an affect. How can I resolve this ? Thanks.