
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (101)
-
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...) -
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)
Sur d’autres sites (9391)
-
How to save the video stream as h264
16 mars 2023, par aaadddzxcI pull the stream through ffmpeg, and then save the video of this stream as an h264 file, but the saved file cannot be played. Why is this ?


The h264 saved by the following code cannot be played,i dont know why...


i try to vlc play, but cant play the h264 file.


can be save to h264 without avformat_alloc_output_context2 function ?


#include <thread>
#include <iostream>
#include <fstream>
extern "C"
{
#include <libavcodec></libavcodec>avcodec.h>
#include <libavcodec></libavcodec>bsf.h>
#include <libavformat></libavformat>avformat.h>
}

#pragma comment(lib,"avcodec.lib")
#pragma comment(lib,"avdevice.lib")
#pragma comment(lib,"avfilter.lib")
#pragma comment(lib,"avformat.lib")
#pragma comment(lib,"avutil.lib")
#pragma comment(lib,"swresample.lib")
#pragma comment(lib,"swscale.lib")

int mp4toannexb(AVBSFContext* bsf_ctx, AVPacket* pkt, std::ofstream& out)
{
 int ret;

 ret = av_bsf_send_packet(bsf_ctx, pkt);
 if (ret < 0) {
 std::cout << "bsf send packet failed, errno:" << ret << std::endl;
 return -1;
 }

 for (;;) {
 ret = av_bsf_receive_packet(bsf_ctx, pkt);
 if (AVERROR_EOF == ret || AVERROR(EAGAIN) == ret) {
 return 0;
 }
 if (ret < 0) {
 std::cout << "Could not receive packet, errno:" << ret << std::endl;
 return -1;
 }
 out.write((const char*)pkt->data, pkt->size);
 }
 return 0;
}


int main()
{
 AVOutputFormat* ofmt = NULL;
 AVFormatContext* ifmt_ctx = NULL;
 AVBSFContext* bsf_ctx = NULL;
 AVPacket* pkt = NULL;
 const char* in_filename = "http://192.168.1.12:8088/live/123.flv";
 int ret = -1;
 int video_index = -1;
 std::ofstream outh264("D:\\ConsoleApplication1\\Debug\\out.h264", std::ios::binary | std::ios::trunc);

 avformat_network_init();

 if ((ifmt_ctx = avformat_alloc_context()) == NULL) {
 std::cout << "avformat_alloc_context failed." << std::endl;
 exit(1);
 }

 if ((ret = avformat_open_input(&ifmt_ctx, in_filename, 0, 0)) < 0) {
 std::cout << "Could not open input file." << std::endl;
 exit(1);
 }

 if ((ret = avformat_find_stream_info(ifmt_ctx, 0)) < 0) {
 std::cout << "Failed to retrieve input stream information" << std::endl;
 return -1;
 }

 if (!(pkt = av_packet_alloc())) {
 std::cout << "Could not allocate packet" << std::endl;
 return -1;
 }

 video_index = av_find_best_stream(ifmt_ctx, AVMEDIA_TYPE_VIDEO, -1, -1, NULL, 0);
 if (video_index < 0) {
 std::cout << "Could not find stream " << std::string(av_get_media_type_string(AVMEDIA_TYPE_VIDEO)) << std::endl;
 return -1;
 }

 av_dump_format(ifmt_ctx, 0, in_filename, 0);

 const AVBitStreamFilter* filter = av_bsf_get_by_name("h264_mp4toannexb");
 if (NULL == filter) {
 std::cout << "Could not create filter" << std::endl;
 return -1;
 }

 ret = av_bsf_alloc(filter, &bsf_ctx);
 if (ret < 0) {
 printf("Could not alloc bitstream filter \n");
 return -1;
 }

 // avcodec_parameters_from_context
 ret = avcodec_parameters_copy(bsf_ctx->par_in, ifmt_ctx->streams[video_index]->codecpar);
 if (ret < 0) {
 printf("Parameter copy filed, errno: %d \n", ret);
 return -1;
 }

 ret = av_bsf_init(bsf_ctx);
 if (ret < 0) {
 printf("BSF init failed, errno: %d \n", ret);
 return -1;
 }

 while (av_read_frame(ifmt_ctx, pkt) >= 0) {
 if (pkt->stream_index == video_index)
 {
 mp4toannexb(bsf_ctx, pkt, outh264);
 }
 av_packet_unref(pkt);
 }
 outh264.close();
 avformat_close_input(&ifmt_ctx);
 av_packet_free(&pkt);
 av_bsf_free(&bsf_ctx);

 return 0;
}
</fstream></iostream></thread>


-
x86/vp9lpf : save a few mov in flat8in/hev masks calc.
5 février 2014, par Clément Bœsch -
Revision 2a03d0d22b : change to save rdmult value correctly This commit moves the position where rdmu
14 mars 2014, par Yaowu XuChanged Paths :
Modify /vp9/encoder/vp9_encodeframe.c
change to save rdmult value correctlyThis commit moves the position where rdmult is saved to make sure it
is the correct value. Prior, an uninitialized value may be saved and
restored.This addresses issue :
https://code.google.com/p/webm/issues/detail?id=733Change-Id : I436407f289169bc63da3c5a6bf609bed16cb71b5