
Recherche avancée
Médias (91)
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#4 Emo Creates
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#2 Typewriter Dance
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#1 The Wires
11 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
ED-ME-5 1-DVD
11 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Audio
-
Revolution of Open-source and film making towards open film making
6 octobre 2011, par
Mis à jour : Juillet 2013
Langue : English
Type : Texte
Autres articles (64)
-
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)
-
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
Sur d’autres sites (10173)
-
Buffered encoded images not saved
26 mars 2021, par xyfixI have an issue with the first 12 images not being saved to file. I have attached the relevant files in this issue. I have also attached a log file to show that the first 12 images aren't written to the file that is generated. The frame rate is 24 fps and the recording is 5 sec, so there should be 120 frames written to the output file. This can be seen in the 4th column. The lines in the log files are as follows :


image num [unique num from camera] [temp image num for recording seq] [time in ms]


The image class is actually a simple wrapper around OpenCV's mat class with some additional members. The output file that I currently get is around 10 MB and when I open it in VLC it doesn't run for 5 seconds but more like 1 - 2 seconds but I can see whatever I have recorded. Can anyone explain to me why the files not written and the duration isn't 5 secs (minus 12 frames missing) as expected . As you can see I have tried with "av_interleaved_write_frame" but that didn't help


xcodec.h


#ifndef XCODEC_H
#define XCODEC_H

#include "image/Image.h"

extern "C"
{
 #include "Codec/include/libavcodec/avcodec.h"
 #include "Codec/include/libavdevice/avdevice.h"
 #include "Codec/include/libavformat/avformat.h"
 #include "Codec/include/libavutil/avutil.h"
 #include "Codec/include/libavformat/avio.h"
 #include "Codec/include/libavutil/imgutils.h"
 #include "Codec/include/libavutil/opt.h"
 #include "Codec/include/libswscale/swscale.h"
}


class XCodec
{
public:

 XCodec(const char *filename);

 ~XCodec();

 void encodeImage( const Image& image );

 void encode( AVFrame *frame, AVPacket *pkt );

 void add_stream();

 void openVideoCodec();

 void write_video_frame(const Image &image);

 void createFrame( const Image& image );

 void close();

private:

 static int s_frameCount;

 int m_timeVideo = 0;

 std::string m_filename;


 AVCodec* m_encoder = NULL;

 AVOutputFormat* m_outputFormat = NULL;

 AVFormatContext* m_formatCtx = NULL;

 AVCodecContext* m_codecCtx = NULL;

 AVStream* m_streamOut = NULL;

 AVFrame* m_frame = NULL;

 AVPacket* m_packet = NULL;

};

#endif



xcodec.cpp


#include "XCodec.h"

#include <qdebug>


#define STREAM_DURATION 5.0
#define STREAM_FRAME_RATE 24
#define STREAM_NB_FRAMES ((int)(STREAM_DURATION * STREAM_FRAME_RATE))
#define STREAM_PIX_FMT AV_PIX_FMT_YUV420P /* default pix_fmt */
#define OUTPUT_CODEC AV_CODEC_ID_H264

int XCodec::s_frameCount = 0;

XCodec::XCodec( const char* filename ) :
 m_filename( filename ),
 m_encoder( avcodec_find_encoder( OUTPUT_CODEC ))
{
 av_log_set_level(AV_LOG_VERBOSE);

 int ret(0);


 // allocate the output media context
 ret = avformat_alloc_output_context2( &m_formatCtx, m_outputFormat, NULL, m_filename.c_str());

 if (!m_formatCtx)
 return;

 m_outputFormat = m_formatCtx->oformat;

 // Add the video stream using H264 codec
 add_stream();

 // Open video codec and allocate the necessary encode buffers
 if (m_streamOut)
 openVideoCodec();

 // Print detailed information about input and output
 av_dump_format( m_formatCtx, 0, m_filename.c_str(), 1);

 // Open the output media file, if needed
 if (!( m_outputFormat->flags & AVFMT_NOFILE))
 {
 ret = avio_open( &m_formatCtx->pb, m_filename.c_str(), AVIO_FLAG_WRITE);

 if (ret < 0)
 {
 char error[255];
 ret = av_strerror( ret, error, 255);
 fprintf(stderr, "Could not open '%s': %s\n", m_filename.c_str(), error);
 return ;
 }
 }
 else
 {
 return;
 }

 // Write media header
 ret = avformat_write_header( m_formatCtx, NULL );

 if (ret < 0)
 {
 char error[255];
 av_strerror(ret, error, 255);
 fprintf(stderr, "Error occurred when opening output file: %s\n", error);
 return;
 }

 if ( m_frame )
 m_frame->pts = 0;
}



XCodec::~XCodec()
{}

/* Add an output stream. */
void XCodec::add_stream()
{
 AVCodecID codecId = OUTPUT_CODEC;

 if (!( m_encoder ))
 {
 fprintf(stderr, "Could not find encoder for '%s'\n",
 avcodec_get_name(codecId));
 return;
 }

 // Get the stream for codec
 m_streamOut = avformat_new_stream(m_formatCtx, m_encoder);

 if (!m_streamOut) {
 fprintf(stderr, "Could not allocate stream\n");
 return;
 }

 m_streamOut->id = m_formatCtx->nb_streams - 1;

 m_codecCtx = avcodec_alloc_context3( m_encoder);

 switch (( m_encoder)->type)
 {
 case AVMEDIA_TYPE_VIDEO:
 m_streamOut->codecpar->codec_id = codecId;
 m_streamOut->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
 m_streamOut->codecpar->bit_rate = 400000;
 m_streamOut->codecpar->width = 800;
 m_streamOut->codecpar->height = 640;
 m_streamOut->codecpar->format = STREAM_PIX_FMT;
 m_streamOut->time_base = { 1, STREAM_FRAME_RATE };

 avcodec_parameters_to_context( m_codecCtx, m_streamOut->codecpar);

 m_codecCtx->gop_size = 12; /* emit one intra frame every twelve frames at most */
 m_codecCtx->max_b_frames = 1;
 m_codecCtx->time_base = { 1, STREAM_FRAME_RATE };
 m_codecCtx->framerate = { STREAM_FRAME_RATE, 1 };
 m_codecCtx->pix_fmt = STREAM_PIX_FMT;
 m_codecCtx->profile = FF_PROFILE_H264_HIGH;

 break;

 default:
 break;
 }

 if (m_streamOut->codecpar->codec_id == OUTPUT_CODEC)
 {
 av_opt_set( m_codecCtx, "preset", "ultrafast", 0 );
 }

/
// /* Some formats want stream headers to be separate. */
 if (m_formatCtx->oformat->flags & AVFMT_GLOBALHEADER)
 m_codecCtx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;


 int ret = avcodec_parameters_from_context( m_streamOut->codecpar, m_codecCtx );

 if (ret < 0)
 {
 char error[255];
 av_strerror(ret, error, 255);
 fprintf(stderr, "avcodec_parameters_from_context returned (%d) - %s", ret, error);
 return;
 }
}


void XCodec::openVideoCodec()
{
 int ret;

 /* open the codec */
 ret = avcodec_open2(m_codecCtx, m_encoder, NULL);

 if (ret < 0)
 {
 char error[255];
 av_strerror(ret, error, 255);
 fprintf(stderr, "Could not open video codec: %s\n", error);
 return;
 }

 /* allocate and init a re-usable frame */
// m_frame = av_frame_alloc();

}


void XCodec::encodeImage(const Image &image)
{
 // Compute video time from last added video frame
 m_timeVideo = image.timeStamp(); //(double)m_frame->pts) * av_q2d(m_streamOut->time_base);

 // Stop media if enough time
 if (!m_streamOut /*|| m_timeVideo >= STREAM_DURATION*/)
 return;


 // Add a video frame
 write_video_frame( image );

}


void XCodec::write_video_frame( const Image& image )
{
 int ret;

qDebug() << "image num " << image.uniqueImageNumber() << " " << s_frameCount;

 if ( s_frameCount >= STREAM_NB_FRAMES)
 {
 /* No more frames to compress. The codec has a latency of a few
 * frames if using B-frames, so we get the last frames by
 * passing the same picture again. */
 int p( 0 ) ;
 }
 else
 {
 createFrame( image );
 }

 // Increase frame pts according to time base
// m_frame->pts += av_rescale_q(1, m_codecCtx->time_base, m_streamOut->time_base);
 m_frame->pts = int64_t( image.timeStamp()) ;


 if (m_formatCtx->oformat->flags & 0x0020 )
 {
 /* Raw video case - directly store the picture in the packet */
 AVPacket pkt;
 av_init_packet(&pkt);

 pkt.flags |= AV_PKT_FLAG_KEY;
 pkt.stream_index = m_streamOut->index;
 pkt.data = m_frame->data[0];
 pkt.size = sizeof(AVPicture);

// ret = av_interleaved_write_frame(m_formatCtx, &pkt);
 ret = av_write_frame( m_formatCtx, &pkt );
 }
 else
 {
 AVPacket pkt;
 av_init_packet(&pkt);

 /* encode the image */
 ret = avcodec_send_frame(m_codecCtx, m_frame);

 if (ret < 0)
 {
 char error[255];
 av_strerror(ret, error, 255);
 fprintf(stderr, "Error encoding video frame: %s\n", error);
 return;
 }

 /* If size is zero, it means the image was buffered. */
 ret = avcodec_receive_packet(m_codecCtx, &pkt);

 if( !ret && pkt.size)
 {
qDebug() << "write frame " << m_frame->display_picture_number;
 pkt.stream_index = m_streamOut->index;

 /* Write the compressed frame to the media file. */
// ret = av_interleaved_write_frame(m_formatCtx, &pkt);
 ret = av_write_frame( m_formatCtx, &pkt );
 }
 else
 {
 ret = 0;
 }
 }

 if (ret != 0)
 {
 char error[255];
 av_strerror(ret, error, 255);
 fprintf(stderr, "Error while writing video frame: %s\n", error);
 return;
 }

 s_frameCount++;
}


void XCodec::createFrame( const Image& image /*, AVFrame *m_frame, int frame_index, int width, int height*/)
{
 /**
 * \note allocate frame
 */
 m_frame = av_frame_alloc();
 int ret = av_frame_make_writable( m_frame );

 m_frame->format = STREAM_PIX_FMT;
 m_frame->width = image.width();
 m_frame->height = image.height();
// m_frame->pict_type = AV_PICTURE_TYPE_I;
 m_frame->display_picture_number = image.uniqueImageNumber();

 ret = av_image_alloc(m_frame->data, m_frame->linesize, m_frame->width, m_frame->height, STREAM_PIX_FMT, 1);

 if (ret < 0)
 {
 return;
 }

 struct SwsContext* sws_ctx = sws_getContext((int)image.width(), (int)image.height(), AV_PIX_FMT_RGB24,
 (int)image.width(), (int)image.height(), STREAM_PIX_FMT, 0, NULL, NULL, NULL);

 const uint8_t* rgbData[1] = { (uint8_t* )image.getData() };
 int rgbLineSize[1] = { 3 * image.width() };

 sws_scale(sws_ctx, rgbData, rgbLineSize, 0, image.height(), m_frame->data, m_frame->linesize);

//cv::Mat yuv420p( m_frame->height + m_frame->height/2, m_frame->width, CV_8UC1, m_frame->data[0]);
//cv::Mat cvmIm;
//cv::cvtColor(yuv420p,cvmIm,CV_YUV420p2BGR);
//std::ostringstream ss;
//ss << "c:\\tmp\\YUVoriginal_" << image.uniqueImageNumber() << ".png";
//cv::imwrite( ss.str().c_str(), cvmIm);
}


void XCodec::close()
{
 /* reset the framecount */
 s_frameCount = 0 ;

 int ret( 0 );

 /* flush the encoder */
 while( ret >= 0 )
 ret = avcodec_send_frame(m_codecCtx, NULL);

 // Write media trailer
 if( m_formatCtx )
 ret = av_write_trailer( m_formatCtx );

 /* Close each codec. */
 if ( m_streamOut )
 {
 if( m_frame )
 {
 av_free( m_frame->data[0]);
 av_frame_free( &m_frame );
 }

 if( m_packet )
 av_packet_free( &m_packet );
 }

 if (!( m_outputFormat->flags & AVFMT_NOFILE))
 /* Close the output file. */
 ret = avio_close( m_formatCtx->pb);


 /* free the stream */
 avformat_free_context( m_formatCtx );

 fflush( stdout );
}
</qdebug>


image.h


#ifndef IMAGE_H
#define IMAGE_H

#include 

class Image 
{
public:

 Image();

 Image( const cv::Mat& mat );

 Image(const Image& other) = default;

 Image(Image&& other) = default;

 ~Image();


 inline const cv::Mat& matrix() const{ return m_matrix; }

 inline const int uniqueImageNumber() const{ return m_uniqueId; }

 inline const int timeStamp() const { return m_timeStamp; }

 inline const int width() const { return m_matrix.cols(); }
 
 inline const int height() const { return m_matrix.rows(); }

private:

 cv::Mat m_matrix;

 int m_timeStamp;

 int m_uniqueId;

};

#endif



logtxt


image num 1725 0 0
 image num 1727 1 40
 image num 1729 2 84
 image num 1730 3 126
 image num 1732 4 169
 image num 1734 5 211
 image num 1736 6 259
 image num 1738 7 297
 image num 1740 8 340
 image num 1742 9 383
 image num 1744 10 425
 image num 1746 11 467
 image num 1748 12 511
 image num 1750 13 553
 write frame 1750
 image num 1752 14 600
 write frame 1752
 image num 1753 15 637
 write frame 1753
 image num 1755 16 680
 write frame 1755
 image num 1757 17 723
 write frame 1757
 image num 1759 18 766
 write frame 1759
 image num 1761 19 808
 write frame 1761
 image num 1763 20 854
 write frame 1763
 image num 1765 21 893
 write frame 1765
 image num 1767 22 937
 write frame 1767
 image num 1769 23 979
 write frame 1769
 image num 1770 24 1022
 write frame 1770
 image num 1772 25 1064
 write frame 1772
 image num 1774 26 1108
 write frame 1774
 image num 1776 27 1150
 write frame 1776
 image num 1778 28 1192
 write frame 1778
 image num 1780 29 1235
 write frame 1780
 image num 1782 30 1277
 write frame 1782
 image num 1784 31 1320
 write frame 1784
 image num 1786 32 1362
 write frame 1786
 image num 1787 33 1405
 write frame 1787
 image num 1789 34 1450
 write frame 1789
 image num 1791 35 1493
 write frame 1791
 image num 1793 36 1536
 write frame 1793
 image num 1795 37 1578
 write frame 1795
 image num 1797 38 1621
 write frame 1797
 image num 1799 39 1663
 write frame 1799
 image num 1801 40 1709
 write frame 1801
 image num 1803 41 1748
 write frame 1803
 image num 1805 42 1791
 write frame 1805
 image num 1807 43 1833
 write frame 1807
 image num 1808 44 1876
 write frame 1808
 image num 1810 45 1920
 write frame 1810
 image num 1812 46 1962
 write frame 1812
 image num 1814 47 2004
 write frame 1814
 image num 1816 48 2048
 write frame 1816
 image num 1818 49 2092
 write frame 1818
 image num 1820 50 2133
 write frame 1820
 image num 1822 51 2175
 write frame 1822
 image num 1824 52 2221
 write frame 1824
 image num 1826 53 2277
 write frame 1826
 image num 1828 54 2319
 write frame 1828
 image num 1830 55 2361
 write frame 1830
 image num 1832 56 2405
 write frame 1832
 image num 1833 57 2447
 write frame 1833
 image num 1835 58 2491
 write frame 1835
 image num 1837 59 2533
 write frame 1837
 image num 1839 60 2576
 write frame 1839
 image num 1841 61 2619
 write frame 1841
 image num 1843 62 2662
 write frame 1843
 image num 1845 63 2704
 write frame 1845
 image num 1847 64 2746
 write frame 1847
 image num 1849 65 2789
 write frame 1849
 image num 1851 66 2831
 write frame 1851
 image num 1852 67 2874
 write frame 1852
 image num 1854 68 2917
 write frame 1854
 image num 1856 69 2959
 write frame 1856
 image num 1858 70 3003
 write frame 1858
 image num 1860 71 3045
 write frame 1860
 image num 1862 72 3088
 write frame 1862
 image num 1864 73 3130
 write frame 1864
 image num 1866 74 3173
 write frame 1866
 image num 1868 75 3215
 write frame 1868
 image num 1870 76 3257
 write frame 1870
 image num 1872 77 3306
 write frame 1872
 image num 1873 78 3347
 write frame 1873
 image num 1875 79 3389
 write frame 1875
 image num 1877 80 3433
 write frame 1877
 image num 1879 81 3475
 write frame 1879
 image num 1883 82 3562
 write frame 1883
 image num 1885 83 3603
 write frame 1885
 image num 1887 84 3660
 write frame 1887
 image num 1889 85 3704
 write frame 1889
 image num 1891 86 3747
 write frame 1891
 image num 1893 87 3789
 write frame 1893
 image num 1895 88 3832
 write frame 1895
 image num 1897 89 3874
 write frame 1897
 image num 1899 90 3917
 write frame 1899
 image num 1900 91 3959
 write frame 1900
 image num 1902 92 4001
 write frame 1902
 image num 1904 93 4044
 write frame 1904
 image num 1906 94 4086
 write frame 1906
 image num 1908 95 4130
 write frame 1908
 image num 1910 96 4174
 write frame 1910
 image num 1912 97 4216
 write frame 1912
 image num 1914 98 4257
 write frame 1914
 image num 1915 99 4303
 write frame 1915
 image num 1918 100 4344
 write frame 1918
 image num 1919 101 4387
 write frame 1919
 image num 1922 102 4451
 write frame 1922
 image num 1924 103 4494
 write frame 1924
 image num 1926 104 4541
 write frame 1926
 image num 1927 105 4588
 write frame 1927
 image num 1931 106 4665
 write frame 1931
 image num 1933 107 4707
 write frame 1933
 image num 1935 108 4750
 write frame 1935
 image num 1937 109 4794
 write frame 1937
 image num 1939 110 4836
 write frame 1939
 image num 1941 111 4879
 write frame 1941
 image num 1943 112 4922
 write frame 1943
 image num 1945 113 4965
 write frame 1945
 image num 1947 114 5007
 write frame 1947
 image num 1948 115 5050
 write frame 1948
 image num 1950 116 5093
 write frame 1950
 image num 1952 117 5136
 write frame 1952
 image num 1954 118 5178
 write frame 1954
 image num 1956 119 5221
 write frame 1956
 MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
0, 8-bit
Not writing 'clli' atom. No content light level info.
Not writing 'mdcv' atom. Missing mastering metadata.
 2 seeks, 41 writeouts



-
FFMPEG android is processing slow
23 novembre 2015, par jpcI’m using https://github.com/WritingMinds/ffmpeg-android-java as my framework for FFMPEG
I’m trying to convert an image to a video using this command
ffmpeg -y -loop 1 -i input.jpg -strict -2 -vcodec mpeg4 -t 5 -pix_fmt yuv420p out.mp4
It took about 32 seconds to finish the process which is very slow for my requirements.
Is there a way to speed this up ? I’m thinking of something around 5 seconds, perhaps approximately equal to the specified length of the video
here’s the log btw
11-23 12:12:13.587 4228-4228/com.lo.and.dev W/com.lo.and.util: WARNING: linker: /data/data/com.lo.and.dev/files/ffmpeg has text relocations. This is wasting memory and prevents security hardening. Please fix.
11-23 12:12:13.607 4228-4228/com.lo.and.dev W/com.lo.and.util: ffmpeg version n2.4.2 Copyright (c) 2000-2014 the FFmpeg developers
11-23 12:12:13.607 4228-4228/com.lo.and.dev W/com.lo.and.util: built on Oct 7 2014 15:08:46 with gcc 4.8 (GCC)
11-23 12:12:13.607 4228-4228/com.lo.and.dev W/com.lo.and.util: configuration: --target-os=linux --cross-prefix=/home/sb/Source-Code/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/sb/Source-Code/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/sb/Source-Code/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/sb/Source-Code/ffmpeg-android/build/armeabi-v7a-neon --extra-cflags='-I/home/sb/Source-Code/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all -mfpu=neon' --extra-ldflags='-L/home/sb/Source-Code/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=
11-23 12:12:13.607 4228-4228/com.lo.and.dev W/com.lo.and.util: libavutil 54. 7.100 / 54. 7.100
11-23 12:12:13.607 4228-4228/com.lo.and.dev W/com.lo.and.util: libavcodec 56. 1.100 / 56. 1.100
11-23 12:12:13.607 4228-4228/com.lo.and.dev W/com.lo.and.util: libavformat 56. 4.101 / 56. 4.101
11-23 12:12:13.607 4228-4228/com.lo.and.dev W/com.lo.and.util: libavdevice 56. 0.100 / 56. 0.100
11-23 12:12:13.607 4228-4228/com.lo.and.dev W/com.lo.and.util: libavfilter 5. 1.100 / 5. 1.100
11-23 12:12:13.617 4228-4228/com.lo.and.dev W/com.lo.and.util: libswscale 3. 0.100 / 3. 0.100
11-23 12:12:13.617 4228-4228/com.lo.and.dev W/com.lo.and.util: libswresample 1. 1.100 / 1. 1.100
11-23 12:12:13.617 4228-4228/com.lo.and.dev W/com.lo.and.util: libpostproc 53. 0.100 / 53. 0.100
11-23 12:12:13.707 4228-4228/com.lo.and.dev W/com.lo.and.util: Input #0, image2, from '/storage/emulated/0/DCIM/Camera/20151122_172809.jpg':
11-23 12:12:13.707 4228-4228/com.lo.and.dev W/com.lo.and.util: Duration: 00:00:00.04, start: 0.000000, bitrate: 95165 kb/s
11-23 12:12:13.717 4228-4228/com.lo.and.dev W/com.lo.and.util: Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 25 tbn, 25 tbc
11-23 12:12:13.727 4228-4228/com.lo.and.dev W/com.lo.and.util: [swscaler @ 0xb5d89000] deprecated pixel format used, make sure you did set range correctly
11-23 12:12:13.777 4228-4228/com.lo.and.dev W/com.lo.and.util: Output #0, mp4, to '/storage/emulated/0/DCIM/out.mp4':
11-23 12:12:13.777 4228-4228/com.lo.and.dev W/com.lo.and.util: Metadata:
11-23 12:12:13.777 4228-4228/com.lo.and.dev W/com.lo.and.util: encoder : Lavf56.4.101
11-23 12:12:13.777 4228-4228/com.lo.and.dev W/com.lo.and.util: Stream #0:0: Video: mpeg4 ( [0][0][0] / 0x0020), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 12800 tbn, 25 tbc
11-23 12:12:13.777 4228-4228/com.lo.and.dev W/com.lo.and.util: Metadata:
11-23 12:12:13.777 4228-4228/com.lo.and.dev W/com.lo.and.util: encoder : Lavc56.1.100 mpeg4
11-23 12:12:13.777 4228-4228/com.lo.and.dev W/com.lo.and.util: Stream mapping:
11-23 12:12:13.777 4228-4228/com.lo.and.dev W/com.lo.and.util: Stream #0:0 -> #0:0 (mjpeg (native) -> mpeg4 (native))
11-23 12:12:13.777 4228-4228/com.lo.and.dev W/com.lo.and.util: Press [q] to stop, [?] for help
11-23 12:12:14.707 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 3 fps=0.0 q=2.0 size= 343kB time=00:00:00.12 bitrate=23400.5kbits/s
11-23 12:12:15.247 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 5 fps=4.2 q=4.9 size= 345kB time=00:00:00.20 bitrate=14125.9kbits/s
11-23 12:12:15.737 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 7 fps=4.0 q=10.2 size= 347kB time=00:00:00.28 bitrate=10149.8kbits/s
11-23 12:12:16.467 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 10 fps=4.1 q=18.9 size= 350kB time=00:00:00.40 bitrate=7167.7kbits/s
11-23 12:12:17.037 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 12 fps=4.0 q=24.8 size= 352kB time=00:00:00.48 bitrate=6007.9kbits/s
11-23 12:12:17.567 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 14 fps=3.9 q=27.8 size= 403kB time=00:00:00.56 bitrate=5893.7kbits/s
11-23 12:12:18.337 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 17 fps=4.0 q=31.0 size= 406kB time=00:00:00.68 bitrate=4891.5kbits/s
11-23 12:12:18.847 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 19 fps=3.9 q=31.0 size= 408kB time=00:00:00.76 bitrate=4398.6kbits/s
11-23 12:12:19.607 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 22 fps=3.9 q=31.0 size= 411kB time=00:00:00.88 bitrate=3827.4kbits/s
11-23 12:12:20.107 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 24 fps=3.9 q=31.0 size= 413kB time=00:00:00.96 bitrate=3525.9kbits/s
11-23 12:12:20.637 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 26 fps=3.9 q=31.0 size= 460kB time=00:00:01.04 bitrate=3624.3kbits/s
11-23 12:12:21.157 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 28 fps=3.9 q=31.0 size= 462kB time=00:00:01.12 bitrate=3381.1kbits/s
11-23 12:12:21.667 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 30 fps=3.9 q=31.0 size= 464kB time=00:00:01.20 bitrate=3169.7kbits/s
11-23 12:12:22.167 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 32 fps=3.9 q=31.0 size= 466kB time=00:00:01.28 bitrate=2984.6kbits/s
11-23 12:12:22.897 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 35 fps=3.9 q=31.0 size= 469kB time=00:00:01.40 bitrate=2746.8kbits/s
11-23 12:12:23.657 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 38 fps=3.9 q=31.0 size= 517kB time=00:00:01.52 bitrate=2788.3kbits/s
11-23 12:12:24.387 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 41 fps=4.0 q=31.0 size= 521kB time=00:00:01.64 bitrate=2600.1kbits/s
11-23 12:12:24.887 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 43 fps=3.9 q=31.0 size= 523kB time=00:00:01.72 bitrate=2488.9kbits/s
11-23 12:12:25.417 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 45 fps=3.9 q=31.0 size= 525kB time=00:00:01.80 bitrate=2387.6kbits/s
11-23 12:12:25.967 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 47 fps=3.9 q=31.0 size= 527kB time=00:00:01.88 bitrate=2294.9kbits/s
11-23 12:12:26.477 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 49 fps=3.9 q=24.8 size= 572kB time=00:00:01.96 bitrate=2390.0kbits/s
11-23 12:12:27.297 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 52 fps=3.9 q=31.0 size= 577kB time=00:00:02.08 bitrate=2271.5kbits/s
11-23 12:12:27.987 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 55 fps=3.9 q=31.0 size= 580kB time=00:00:02.20 bitrate=2159.1kbits/s
11-23 12:12:28.737 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 58 fps=3.9 q=31.0 size= 583kB time=00:00:02.32 bitrate=2058.2kbits/s
11-23 12:12:29.247 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 60 fps=3.9 q=31.0 size= 585kB time=00:00:02.40 bitrate=1996.6kbits/s
11-23 12:12:30.017 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 63 fps=3.9 q=31.0 size= 633kB time=00:00:02.52 bitrate=2057.7kbits/s
11-23 12:12:30.557 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 65 fps=3.9 q=31.0 size= 635kB time=00:00:02.60 bitrate=2000.8kbits/s
11-23 12:12:31.057 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 67 fps=3.9 q=31.0 size= 637kB time=00:00:02.68 bitrate=1947.4kbits/s
11-23 12:12:31.627 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 69 fps=3.9 q=31.0 size= 639kB time=00:00:02.76 bitrate=1897.0kbits/s
11-23 12:12:32.167 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 71 fps=3.9 q=31.0 size= 641kB time=00:00:02.84 bitrate=1849.5kbits/s
11-23 12:12:32.927 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 74 fps=3.9 q=31.0 size= 689kB time=00:00:02.96 bitrate=1907.2kbits/s
11-23 12:12:33.407 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 76 fps=3.9 q=31.0 size= 691kB time=00:00:03.04 bitrate=1862.8kbits/s
11-23 12:12:34.157 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 79 fps=3.9 q=31.0 size= 694kB time=00:00:03.16 bitrate=1800.0kbits/s
11-23 12:12:34.657 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 81 fps=3.9 q=31.0 size= 696kB time=00:00:03.24 bitrate=1760.7kbits/s
11-23 12:12:35.217 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 83 fps=3.9 q=31.0 size= 698kB time=00:00:03.32 bitrate=1723.3kbits/s
11-23 12:12:35.777 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 85 fps=3.9 q=24.8 size= 744kB time=00:00:03.40 bitrate=1791.6kbits/s
11-23 12:12:36.297 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 87 fps=3.9 q=31.0 size= 747kB time=00:00:03.48 bitrate=1759.6kbits/s
11-23 12:12:36.827 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 89 fps=3.9 q=31.0 size= 750kB time=00:00:03.56 bitrate=1724.8kbits/s
11-23 12:12:37.547 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 92 fps=3.9 q=31.0 size= 753kB time=00:00:03.68 bitrate=1675.4kbits/s
11-23 12:12:38.297 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 95 fps=3.9 q=31.0 size= 756kB time=00:00:03.80 bitrate=1629.1kbits/s
11-23 12:12:38.797 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 97 fps=3.9 q=24.8 size= 801kB time=00:00:03.88 bitrate=1690.8kbits/s
11-23 12:12:39.547 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 100 fps=3.9 q=31.0 size= 806kB time=00:00:04.00 bitrate=1650.2kbits/s
11-23 12:12:40.047 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 102 fps=3.9 q=31.0 size= 808kB time=00:00:04.08 bitrate=1621.9kbits/s
11-23 12:12:40.807 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 105 fps=3.9 q=31.0 size= 811kB time=00:00:04.20 bitrate=1581.6kbits/s
11-23 12:12:41.267 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 107 fps=3.9 q=31.0 size= 813kB time=00:00:04.28 bitrate=1555.9kbits/s
11-23 12:12:42.057 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 110 fps=3.9 q=31.0 size= 861kB time=00:00:04.40 bitrate=1602.8kbits/s
11-23 12:12:42.557 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 112 fps=3.9 q=31.0 size= 863kB time=00:00:04.48 bitrate=1578.1kbits/s
11-23 12:12:43.307 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 115 fps=3.9 q=31.0 size= 866kB time=00:00:04.60 bitrate=1542.4kbits/s
11-23 12:12:43.817 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 117 fps=3.9 q=31.0 size= 868kB time=00:00:04.68 bitrate=1519.6kbits/s
11-23 12:12:44.517 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 120 fps=3.9 q=31.0 size= 871kB time=00:00:04.80 bitrate=1486.8kbits/s
11-23 12:12:45.277 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 123 fps=3.9 q=31.0 size= 919kB time=00:00:04.92 bitrate=1530.6kbits/s
11-23 12:12:45.987 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 125 fps=3.9 q=31.0 size= 921kB time=00:00:05.00 bitrate=1509.4kbits/s
11-23 12:12:45.987 4228-4228/com.lo.and.dev W/com.lo.and.util: frame= 125 fps=3.9 q=31.0 Lsize= 923kB time=00:00:05.00 bitrate=1511.6kbits/s
11-23 12:12:45.987 4228-4228/com.lo.and.dev W/com.lo.and.util: video:921kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.148301% -
Recording desktop with gdigrab ffmeg to mp4 file with too high video_size don't working
4 juillet 2016, par tagryI try to recording my desktop with ffmpeg using the command :
ffmpeg -f gdigrab -framerate 10 -video_size 1920x1200 -i desktop -pix_fmt yuv420p -vcodec libx264 -preset ultrafast output.mp4
The problem is when the video_size option is higher than some size, (for example height higher 1089), the video can’t be read with Windows Media. I noticed that with this high size, the video which be recorded doesn’t have informations about size. I don’t understand why the record don’t work with a too big size. If somebody can help me.
Thank you very much and very sorry for my English.[edit]
ffmpeg version N-78758-g5156578 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 19.100 / 55. 19.100
libavcodec 57. 27.100 / 57. 27.100
libavformat 57. 26.100 / 57. 26.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 37.100 / 6. 37.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
[gdigrab @ 00861860] Capturing whole desktop as 1920x1200x16 at (0,0)
Input #0, gdigrab, from 'desktop':
Duration: N/A, start: 1467631308.011542, bitrate: 368644 kb/s
Stream #0:0: Video: bmp, rgb555le, 1920x1200, 368644 kb/s, 10 tbr, 1000k tbn, 10 tbc
[libx264 @ 00863fe0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 00863fe0] profile Constrained Baseline, level 5.0
[libx264 @ 00863fe0] 264 - core 148 r2665 a01e339 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=10 scenecut=0 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=0
Output #0, mp4, to 'output.mp4':
Metadata:
encoder : Lavf57.26.100
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1920x1200, q=-1--1, 10 fps, 10240 tbn, 10 tbc
Metadata:
encoder : Lavc57.27.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream mapping:
Stream #0:0 -> #0:0 (bmp (native) -> h264 (libx264))
Press [q] to stop, [?] for help
frame= 6 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x
frame= 11 fps= 11 q=10.0 size= 277kB time=00:00:00.40 bitrate=5664.4kbits/s speed=0.396x
frame= 16 fps= 11 q=9.0 size= 393kB time=00:00:00.90 bitrate=3578.8kbits/s speed=0.595x
frame= 21 fps= 10 q=9.0 size= 429kB time=00:00:01.40 bitrate=2507.4kbits/s speed=0.695x
frame= 26 fps= 10 q=9.0 size= 429kB time=00:00:01.90 bitrate=1849.3kbits/s speed=0.754x
frame= 31 fps= 10 q=18.0 size= 430kB time=00:00:02.40 bitrate=1466.1kbits/s speed=0.793x
frame= 36 fps= 10 q=10.0 size= 511kB time=00:00:02.90 bitrate=1442.6kbits/s speed=0.823x
frame= 41 fps= 10 q=10.0 size= 562kB time=00:00:03.40 bitrate=1353.0kbits/s speed=0.844x
frame= 46 fps= 10 q=10.0 size= 565kB time=00:00:03.90 bitrate=1185.9kbits/s speed=0.861x
frame= 51 fps= 10 q=9.0 size= 575kB time=00:00:04.40 bitrate=1070.8kbits/s speed=0.874x
frame= 56 fps= 10 q=12.0 size= 582kB time=00:00:04.90 bitrate= 972.3kbits/s speed=0.885x
frame= 61 fps= 10 q=10.0 size= 598kB time=00:00:05.40 bitrate= 907.7kbits/s speed=0.893x
frame= 66 fps= 10 q=10.0 size= 601kB time=00:00:05.90 bitrate= 834.5kbits/s speed=0.901x
frame= 71 fps= 10 q=10.0 size= 603kB time=00:00:06.40 bitrate= 772.3kbits/s speed=0.907x
frame= 76 fps= 10 q=12.0 size= 606kB time=00:00:06.90 bitrate= 719.8kbits/s speed=0.913x
frame= 81 fps= 10 q=10.0 size= 625kB time=00:00:07.40 bitrate= 691.8kbits/s speed=0.917x
frame= 86 fps= 10 q=10.0 size= 629kB time=00:00:07.90 bitrate= 652.2kbits/s speed=0.922x
frame= 91 fps= 10 q=12.0 size= 634kB time=00:00:08.40 bitrate= 618.2kbits/s speed=0.926x
frame= 97 fps= 10 q=10.0 size= 757kB time=00:00:09.00 bitrate= 689.3kbits/s speed=0.94x
frame= 100 fps= 10 q=-1.0 Lsize= 772kB time=00:00:10.00 bitrate= 632.8kbits/s speed=0.998x
video:771kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.153975%
[libx264 @ 00863fe0] frame I:1 Avg QP:20.00 size:242961
[libx264 @ 00863fe0] frame P:99 Avg QP:10.67 size: 5517
[libx264 @ 00863fe0] mb I I16..4: 100.0% 0.0% 0.0%
[libx264 @ 00863fe0] mb P I16..4: 0.8% 0.0% 0.0% P16..4: 2.9% 0.0% 0.0% 0.0% 0.0% skip:96.3%
[libx264 @ 00863fe0] coded y,uvDC,uvAC intra: 23.6% 15.1% 13.9% inter: 1.2% 1.3% 0.8%
[libx264 @ 00863fe0] i16 v,h,dc,p: 65% 33% 1% 1%
[libx264 @ 00863fe0] i8c dc,h,v,p: 61% 25% 13% 0%
[libx264 @ 00863fe0] kb/s:631.31