
Recherche avancée
Médias (1)
-
The Great Big Beautiful Tomorrow
28 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Texte
Autres articles (76)
-
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...) -
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...) -
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)
Sur d’autres sites (6923)
-
Modifying incorrect h.264 dimension in existing video file
11 juin 2015, par RichyJAfter searching a lot, I’m more confused than ever !! To summarise :
I recorded a video using my HTC One M8, using 1920x1088 resolution, and it came out fine. The next day, for some reason, in the settings I changed to 1920x1080 and the next video was weird - green bar across the top, diagonal green lines throughout and odd colour stripes. The underlying image was fine, although there seem to be some ’frame jumps’ at times. Unfortunately, this second video contained a section I would like to keep, so I’m trying to fix it...
I’ve learned a bit about AVC/H.264, but it’s pretty confusing. Essentially, I wonder whether I can just change the ’1080’ in the file info to ’1088’ and salvage the footage - there’s no audio to worry about. I read that since 1080 is not directly divisible by 16, most encoders actually do 1088 then the player discards the remaining 8 lines at playback time. I wonder whether this is the root of the problem ? I tried to get into NALs, SPS/PPS etc, but couldn’t really fathom whether this was even relevant to my problem. A hex search didn’t even find anything that looked like the NALs given as examples elsewhere :
What does this NAL header data mean ?
Fetching dimensions of a video
I’ve loaded both files into a Hex editor and compared as best I can (around the moov and avcC parts), but haven’t fixed it yet. One of the single byte changes I made and saved to a new ’test’ file brought up additional info in the mediainfo program, showing that the original recording was at 1088 - this hadn’t been there before, but it still played wrongly. I found info regarding the encoding of height and width (units-1 * 16) but couldn’t work out how to use this info in practice.
I tried ffmpeg and dumping to raw video, but couldn’t make this play at all as a yuv file.
So, my question is, will I be able to change just one byte (or a few) in the file, to make it read as 1088 to the player, or am I looking in totally the wrong direction ?!? Is this even possible ? As I say, the actual images look intact throughout, just the colours are wrong and the lines are there, so I believe it’s something to do with YCrCb problems, but at this point, I’m lost...
I know this isn’t specifically about programming, but the above links were all from this site, so thought it might be OK to ask here. Any help would be much appreciated !!
I’ve recreated the conditions and done 2 short clips at 1080 and 1088 for you to see the problem but as I’m new, I can’t post them here yet. They’re on my Photobucket page if you are willing to look at them (hope this isn’t breaking the rules !!). The blueish line at the bottom is the windowsill...
-
ffmpeg C API (libswscale) : Scale a frame into an output frame with given width/height preserving aspect ratio, fill out the rest with transparency
12 juin 2015, par nik4emniyNote : I need to use ffmpeg’s C API in my project.
Input : video(let’s say,first frame)/image, output_width, output_height
Output : PNG image with output_width/output_height.What I’ve done so far :
a) decoded a frame from input into frame1
b) sws_scale frame1 with needed context (output_width, output_height) into frame2
c) initialized AVCodec CODEC_ID_PNG
d) encoded frame2 into initialized AVPacket
e) wrote AVPacket’s data into file
So I have a working cycle that produces a PNG image, but it doesn’t save the aspect ratio (obviously).
What I want to achieve is do the same thing preserving aspect ratio (which would change the frame2’s width||height), but then "centring" that image and filling out the "empty" parts with tranparent layer in the final PNG.Does anyone have an idea on how this can be achieved ?
Again, I need to use C API, not command line. -
Best / simplest way to display FFmpeg frames in Qt5 [Solved]
15 juin 2015, par user412I need to display ffmpeg frames on Qt widget. I know about QtFFmpegWrapper, but it seems outdated. I tried to use
memcpy()
to copy data from RGB ffmpeg frame to QImage and got unhandled exception inside it.QImage lastFrame;
lastFrame = QImage( screen_w, screen_h, QImage::Format_RGB888 );
for( int y = 0; y < screen_h; ++y )
memcpy( lastFrame.scanLine(y),
frameRGB -> data[0] + y * frameRGB -> linesize[0],
screen_w * 3 );I tried
sws_getContext()
andsws_getCachedContext()
,AV_PIX_FMT_BGR24
andAV_PIX_FMT_RGB24
in all parts of ffmpeg processing. All ffmpeg code is from popular tutorials and works fine withSDL
andPIX_FMT_YUV420P
.Any ideas ?
Maybe it’s not the best/simplest way to display ffmpeg frames on Qt widget ?Edit.
Ok, I used Murat Şeker’s solution with
QImage::copy()
but nowQImage::isNull()
returnstrue
.Some of my ffmpeg code :
out_buffer = (uint8_t*)av_malloc( avpicture_get_size( AV_PIX_FMT_RGB32,
codecCtx -> width, codecCtx -> height ));
avpicture_fill((AVPicture *)frameRGB, out_buffer, AV_PIX_FMT_RGB32,
codecCtx -> width, codecCtx -> height);
img_convert_ctx = sws_getContext( codecCtx -> width, codecCtx -> height,
codecCtx -> pix_fmt, codecCtx -> width,
codecCtx -> height, AV_PIX_FMT_RGB32,
SWS_BICUBIC, NULL, NULL, NULL );
/* ... */
if( got_picture ){
sws_scale( img_convert_ctx, (const uint8_t* const*)frame -> data,
frame -> linesize, 0, codecCtx -> height, frameRGB -> data,
frameRGB -> linesize );
QImage imgFrame = QImage( frameRGB -> data[0], frameRGB -> width,
frameRGB -> height, frameRGB -> linesize[0],
QImage::Format_RGB32 ).copy();
if( imgFrame.isNull()){} // true
// But I can write this frame to hard disk using BITMAPFILEHEADER
SaveBMP( frameRGB, codecCtx -> width, codecCtx -> height ); // it works
}