Recherche avancée

Médias (0)

Mot : - Tags -/protocoles

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (80)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

Sur d’autres sites (4573)

  • HTTP Livestreaming with ffmpeg

    12 décembre 2020, par Hugo

    Some context : I have an MKV file, I am attempting to stream it to http://localhost:8090/test.flv as an flv file.

    



    The stream begins and then immediately ends.

    



    The command I am using is :

    



    sudo ffmpeg -re -i input.mkv -c:v libx264 -maxrate 1000k -bufsize 2000k -an -bsf:v h264_mp4toannexb -g 50 http://localhost:8090/test.flv


    



    A breakdown of what I believe these options do incase this post becomes useful for someone else :

    



    sudo


    



    Run as root

    



    ffmpeg


    



    The stream command thingy

    



    -re


    



    Stream in real-time

    



    -i input.mkv


    



    Input option and path to input file

    



    -c:v libx264


    



    Use codec libx264 for conversion

    



    -maxrate 1000k -bufsize 2000k


    



    No idea, some options for conversion, seems to help

    



    -an -bsf:v h264_mp4toannexb


    



    Audio options I think, not sure really. Also seems to help

    



    -g 50


    



    Still no idea, maybe frame rateframerateframerateframerate ?

    



    http://localhost:8090/test.flv


    



    Output using http protocol to localhost on port 8090 as a file called test.flv

    



    Anyway the actual issue I have is that it begins to stream for about a second and then immediately ends.

    



    The mpeg command result :

    



    ffmpeg version N-80901-gfebc862 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
  configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 48.101 / 57. 48.101
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 47.100 /  6. 47.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Input #0, matroska,webm, from 'input.mkv':
  Metadata:
    encoder         : libebml v1.3.0 + libmatroska v1.4.0
    creation_time   : 1970-01-01 00:00:02
  Duration: 00:01:32.26, start: 0.000000, bitrate: 4432 kb/s
    Stream #0:0(eng): Video: h264 (High 10), yuv420p10le, 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0:1(nor): Audio: flac, 48000 Hz, stereo, s16 (default)
[libx264 @ 0x2e1c380] using SAR=1/1
[libx264 @ 0x2e1c380] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x2e1c380] profile High, level 4.0
[libx264 @ 0x2e1c380] 264 - core 148 r2643 5c65704 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=50 keyint_min=5 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=1000 vbv_bufsize=2000 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
[flv @ 0x2e3f0a0] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Output #0, flv, to 'http://localhost:8090/test.flv':
  Metadata:
    encoder         : Lavf57.41.100
    Stream #0:0(eng): Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 23.98 fps, 1k tbn, 23.98 tbc (default)
    Metadata:
      encoder         : Lavc57.48.101 libx264
    Side data:
      cpb: bitrate max/min/avg: 1000000/0/0 buffer size: 2000000 vbv_delay: -1
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
Killed   26 fps= 26 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A speed=   0x  


    



    The ffserver outputs :

    



    Sat Aug 20 12:40:11 2016 File '/test.flv' not found
Sat Aug 20 12:40:11 2016 [SERVER IP] - - [POST] "/test.flv HTTP/1.1" 404 189


    



    The config file is :

    



    #Sample ffserver configuration file&#xA;&#xA;# Port on which the server is listening. You must select a different&#xA;# port from your standard HTTP web server if it is running on the same&#xA;# computer.&#xA;Port 8090&#xA;&#xA;# Address on which the server is bound. Only useful if you have&#xA;# several network interfaces.&#xA;BindAddress 0.0.0.0&#xA;&#xA;# Number of simultaneous HTTP connections that can be handled. It has&#xA;# to be defined *before* the MaxClients parameter, since it defines the&#xA;# MaxClients maximum limit.&#xA;MaxHTTPConnections 2000&#xA;&#xA;# Number of simultaneous requests that can be handled. Since FFServer&#xA;# is very fast, it is more likely that you will want to leave this high&#xA;# and use MaxBandwidth, below.&#xA;MaxClients 1000&#xA;&#xA;# This the maximum amount of kbit/sec that you are prepared to&#xA;# consume when streaming to clients.&#xA;MaxBandwidth 1000&#xA;&#xA;# Access log file (uses standard Apache log file format)&#xA;# &#x27;-&#x27; is the standard output.&#xA;CustomLog -&#xA;&#xA;# Suppress that if you want to launch ffserver as a daemon.&#xA;#NoDaemon&#xA;&#xA;&#xA;##################################################################&#xA;# Definition of the live feeds. Each live feed contains one video&#xA;# and/or audio sequence coming from an ffmpeg encoder or another&#xA;# ffserver. This sequence may be encoded simultaneously with several&#xA;# codecs at several resolutions.&#xA;&#xA;<feed>&#xA;&#xA;ACL allow 192.168.0.0 192.168.255.255&#xA;&#xA;# You must use &#x27;ffmpeg&#x27; to send a live feed to ffserver. In this&#xA;# example, you can type:&#xA;#&#xA;#ffmpeg http://localhost:8090/test.ffm&#xA;&#xA;# ffserver can also do time shifting. It means that it can stream any&#xA;# previously recorded live stream. The request should contain:&#xA;# "http://xxxx?date=[YYYY-MM-DDT][[HH:]MM:]SS[.m...]".You must specify&#xA;# a path where the feed is stored on disk. You also specify the&#xA;# maximum size of the feed, where zero means unlimited. Default:&#xA;# File=/tmp/feed_name.ffm FileMaxSize=5M&#xA;File /tmp/feed1.ffm&#xA;FileMaxSize 200m&#xA;&#xA;# You could specify&#xA;# ReadOnlyFile /saved/specialvideo.ffm&#xA;# This marks the file as readonly and it will not be deleted or updated.&#xA;&#xA;# Specify launch in order to start ffmpeg automatically.&#xA;# First ffmpeg must be defined with an appropriate path if needed,&#xA;# after that options can follow, but avoid adding the http:// field&#xA;#Launch ffmpeg&#xA;&#xA;# Only allow connections from localhost to the feed.&#xA;    ACL allow 127.0.0.1&#xA;&#xA;</feed>&#xA;&#xA;&#xA;##################################################################&#xA;# Now you can define each stream which will be generated from the&#xA;# original audio and video stream. Each format has a filename (here&#xA;# &#x27;test1.mpg&#x27;). FFServer will send this stream when answering a&#xA;# request containing this filename.&#xA;&#xA;<stream>&#xA;&#xA;# coming from live feed &#x27;feed1&#x27;&#xA;Feed feed1.ffm&#xA;&#xA;# Format of the stream : you can choose among:&#xA;# mpeg       : MPEG-1 multiplexed video and audio&#xA;# mpegvideo  : only MPEG-1 video&#xA;# mp2        : MPEG-2 audio (use AudioCodec to select layer 2 and 3 codec)&#xA;# ogg        : Ogg format (Vorbis audio codec)&#xA;# rm         : RealNetworks-compatible stream. Multiplexed audio and video.&#xA;# ra         : RealNetworks-compatible stream. Audio only.&#xA;# mpjpeg     : Multipart JPEG (works with Netscape without any plugin)&#xA;# jpeg       : Generate a single JPEG image.&#xA;# asf        : ASF compatible streaming (Windows Media Player format).&#xA;# swf        : Macromedia Flash compatible stream&#xA;# avi        : AVI format (MPEG-4 video, MPEG audio sound)&#xA;Format mpeg&#xA;&#xA;# Bitrate for the audio stream. Codecs usually support only a few&#xA;# different bitrates.&#xA;AudioBitRate 32&#xA;&#xA;# Number of audio channels: 1 = mono, 2 = stereo&#xA;AudioChannels 2&#xA;&#xA;# Sampling frequency for audio. When using low bitrates, you should&#xA;# lower this frequency to 22050 or 11025. The supported frequencies&#xA;# depend on the selected audio codec.&#xA;AudioSampleRate 44100&#xA;&#xA;# Bitrate for the video stream&#xA;VideoBitRate 64&#xA;&#xA;# Ratecontrol buffer size&#xA;VideoBufferSize 40&#xA;&#xA;# Number of frames per second&#xA;VideoFrameRate 3&#xA;&#xA;# Size of the video frame: WxH (default: 160x128)&#xA;# The following abbreviations are defined: sqcif, qcif, cif, 4cif, qqvga,&#xA;# qvga, vga, svga, xga, uxga, qxga, sxga, qsxga, hsxga, wvga, wxga, wsxga,&#xA;# wuxga, woxga, wqsxga, wquxga, whsxga, whuxga, cga, ega, hd480, hd720,&#xA;# hd1080&#xA;VideoSize hd1080&#xA;&#xA;# Transmit only intra frames (useful for low bitrates, but kills frame rate).&#xA;#VideoIntraOnly&#xA;&#xA;# If non-intra only, an intra frame is transmitted every VideoGopSize&#xA;# frames. Video synchronization can only begin at an intra frame.&#xA;VideoGopSize 12&#xA;&#xA;# More MPEG-4 parameters&#xA;# VideoHighQuality&#xA;# Video4MotionVector&#xA;&#xA;# Choose your codecs:&#xA;#AudioCodec mp2&#xA;#VideoCodec mpeg1video&#xA;&#xA;# Suppress audio&#xA;#NoAudio&#xA;&#xA;# Suppress video&#xA;#NoVideo&#xA;&#xA;#VideoQMin 3&#xA;#VideoQMax 31&#xA;&#xA;# Set this to the number of seconds backwards in time to start. Note that&#xA;# most players will buffer 5-10 seconds of video, and also you need to allow&#xA;# for a keyframe to appear in the data stream.&#xA;#Preroll 15&#xA;&#xA;# ACL:&#xA;&#xA;# You can allow ranges of addresses (or single addresses)&#xA;ACL ALLOW localhost&#xA;&#xA;# You can deny ranges of addresses (or single addresses)&#xA;#ACL DENY <first address="address"> &#xA;&#xA;# You can repeat the ACL allow/deny as often as you like. It is on a per&#xA;# stream basis. The first match defines the action. If there are no matches,&#xA;# then the default is the inverse of the last ACL statement.&#xA;#&#xA;# Thus &#x27;ACL allow localhost&#x27; only allows access from localhost.&#xA;# &#x27;ACL deny 1.0.0.0 1.255.255.255&#x27; would deny the whole of network 1 and&#xA;# allow everybody else.&#xA;&#xA;</first></stream>&#xA;&#xA;&#xA;##################################################################&#xA;# Example streams&#xA;&#xA;&#xA;# Multipart JPEG&#xA;&#xA;#<stream>&#xA;#Feed feed1.ffm&#xA;#Format mpjpeg&#xA;#VideoFrameRate 2&#xA;#VideoIntraOnly&#xA;#NoAudio&#xA;#Strict -1&#xA;#</stream>&#xA;&#xA;&#xA;# Single JPEG&#xA;&#xA;#<stream>&#xA;#Feed feed1.ffm&#xA;#Format jpeg&#xA;#VideoFrameRate 2&#xA;#VideoIntraOnly&#xA;##VideoSize 352x240&#xA;#NoAudio&#xA;#Strict -1&#xA;#</stream>&#xA;&#xA;&#xA;# Flash&#xA;&#xA;#<stream>&#xA;#Feed feed1.ffm&#xA;#Format swf&#xA;#VideoFrameRate 2&#xA;#VideoIntraOnly&#xA;#NoAudio&#xA;#</stream>&#xA;&#xA;&#xA;# ASF compatible&#xA;&#xA;<stream>&#xA;Feed feed1.ffm&#xA;Format asf&#xA;VideoFrameRate 15&#xA;VideoSize 352x240&#xA;VideoBitRate 256&#xA;VideoBufferSize 40&#xA;VideoGopSize 30&#xA;AudioBitRate 64&#xA;StartSendOnKey&#xA;</stream>&#xA;&#xA;&#xA;# MP3 audio&#xA;&#xA;#<stream>&#xA;#Feed feed1.ffm&#xA;#Format mp2&#xA;#AudioCodec mp3&#xA;#AudioBitRate 64&#xA;#AudioChannels 1&#xA;#AudioSampleRate 44100&#xA;#NoVideo&#xA;#</stream>&#xA;&#xA;&#xA;# Ogg Vorbis audio&#xA;&#xA;#<stream>&#xA;#Feed feed1.ffm&#xA;#Title "Stream title"&#xA;#AudioBitRate 64&#xA;#AudioChannels 2&#xA;#AudioSampleRate 44100&#xA;#NoVideo&#xA;#</stream>&#xA;&#xA;&#xA;# Real with audio only at 32 kbits&#xA;&#xA;#<stream>&#xA;#Feed feed1.ffm&#xA;#Format rm&#xA;#AudioBitRate 32&#xA;#NoVideo&#xA;#NoAudio&#xA;#</stream>&#xA;&#xA;&#xA;# Real with audio and video at 64 kbits&#xA;&#xA;#<stream>&#xA;#Feed feed1.ffm&#xA;#Format rm&#xA;#AudioBitRate 32&#xA;#VideoBitRate 128&#xA;#VideoFrameRate 25&#xA;#VideoGopSize 25&#xA;#NoAudio&#xA;#</stream>&#xA;&#xA;&#xA;##################################################################&#xA;# A stream coming from a file: you only need to set the input&#xA;# filename and optionally a new format. Supported conversions:&#xA;#    AVI -> ASF&#xA;&#xA;#<stream>&#xA;#File "/usr/local/httpd/htdocs/tlive.rm"&#xA;#NoAudio&#xA;#</stream>&#xA;&#xA;#<stream>&#xA;#File "/usr/local/httpd/htdocs/test.asf"&#xA;#NoAudio&#xA;#Author "Me"&#xA;#Copyright "Super MegaCorp"&#xA;#Title "Test stream from disk"&#xA;#Comment "Test comment"&#xA;#</stream>&#xA;&#xA;&#xA;##################################################################&#xA;# RTSP examples&#xA;#&#xA;# You can access this stream with the RTSP URL:&#xA;#   rtsp://localhost:5454/test1-rtsp.mpg&#xA;#&#xA;# A non-standard RTSP redirector is also created. Its URL is:&#xA;#   http://localhost:8090/test1-rtsp.rtsp&#xA;&#xA;#<stream>&#xA;#Format rtp&#xA;#File "/usr/local/httpd/htdocs/test1.mpg"&#xA;#</stream>&#xA;&#xA;&#xA;# Transcode an incoming live feed to another live feed,&#xA;# using libx264 and video presets&#xA;&#xA;#<stream>&#xA;#Format rtp&#xA;#Feed feed1.ffm&#xA;#VideoCodec libx264&#xA;#VideoFrameRate 24&#xA;#VideoBitRate 100&#xA;#VideoSize 480x272&#xA;#AVPresetVideo default&#xA;#AVPresetVideo baseline&#xA;#AVOptionVideo flags &#x2B;global_header&#xA;#&#xA;#AudioCodec libfaac&#xA;#AudioBitRate 32&#xA;#AudioChannels 2&#xA;#AudioSampleRate 22050&#xA;#AVOptionAudio flags &#x2B;global_header&#xA;#</stream>&#xA;&#xA;##################################################################&#xA;# SDP/multicast examples&#xA;#&#xA;# If you want to send your stream in multicast, you must set the&#xA;# multicast address with MulticastAddress. The port and the TTL can&#xA;# also be set.&#xA;#&#xA;# An SDP file is automatically generated by ffserver by adding the&#xA;# &#x27;sdp&#x27; extension to the stream name (here&#xA;# http://localhost:8090/test1-sdp.sdp). You should usually give this&#xA;# file to your player to play the stream.&#xA;#&#xA;# The &#x27;NoLoop&#x27; option can be used to avoid looping when the stream is&#xA;# terminated.&#xA;&#xA;#<stream>&#xA;#Format rtp&#xA;#File "/usr/local/httpd/htdocs/test1.mpg"&#xA;#MulticastAddress 224.124.0.1&#xA;#MulticastPort 5000&#xA;#MulticastTTL 16&#xA;#NoLoop&#xA;#</stream>&#xA;&#xA;&#xA;##################################################################&#xA;# Special streams&#xA;&#xA;# Server status&#xA;&#xA;<stream>&#xA;Format status&#xA;&#xA;# Only allow local people to get the status&#xA;ACL allow localhost&#xA;ACL allow 192.168.0.0 192.168.255.255&#xA;&#xA;#FaviconURL http://pond1.gladstonefamily.net:8080/favicon.ico&#xA;</stream>&#xA;&#xA;&#xA;# Redirect index.html to the appropriate site&#xA;&#xA;<redirect>&#xA;URL http://www.ffmpeg.org/&#xA;</redirect>&#xA;&#xA;&#xA;#http://www.ffmpeg.org/&#xA;

    &#xA;&#xA;

    Any help is greatly appreciated, I will do my best draw a picture of the best answer based on their username.

    &#xA;

  • IplImage crop and rotate - Android

    26 février 2015, par Ganesh

    I’m using ffmpeg to video capture for 30 seconds.

    @Override
           public void onPreviewFrame(byte[] data, Camera camera) {
               if (yuvIplimage != null &amp;&amp; recording &amp;&amp; rec)
                   {
                       new SaveFrame().execute(data);
                   }
               }
           }

    save frame class is below

    private class SaveFrame extends AsyncTask {
               long t;
               protected File doInBackground(byte[]... arg) {

                   t = 1000 * (System.currentTimeMillis() - firstTime - pausedTime);
                   toSaveFrames++;
                   File pathCache = new File(Environment.getExternalStorageDirectory()+"/DCIM", (System.currentTimeMillis() / 1000L)+ "_" + toSaveFrames + ".tmp");
                   BufferedOutputStream bos;
                   try {
                       bos = new BufferedOutputStream(new FileOutputStream(pathCache));
                       bos.write(arg[0]);
                       bos.flush();
                       bos.close();
                   } catch (FileNotFoundException e) {
                       e.printStackTrace();
                       pathCache = null;
                       toSaveFrames--;
                   } catch (IOException e) {
                       e.printStackTrace();
                       pathCache = null;
                       toSaveFrames--;
                   }
                   return pathCache;


               }
               @Override
               protected void onPostExecute(File filename)
               {
                   if(filename!=null)
                   {
                       savedFrames++;
                       tempList.add(new FileFrame(t,filename));
                   }
               }
           }

    finally i add all frames with crop and rotation

    private class AddFrame extends AsyncTask {
           private int serial = 0;
           @Override
           protected Void doInBackground(Void... params) {

               for(int i=0; i/                                      final int startY = 640*(480-480)/2;
    //                                      final int lenY = 640*480;
    //                                      yuvIplimage.getByteBuffer().put(bytes, startY, lenY);
    //                                      final int startVU = 640*480+ 640*(480-480)/4;
    //                                      final int lenVU = 640* 480/2;
    //                                      yuvIplimage.getByteBuffer().put(bytes, startVU, lenVU);

                       if (tempList.get(i).time > recorder.getTimestamp()) {
                           recorder.setTimestamp(tempList.get(i).time);
                       }

                       image = cropImage(image);
                       image = rotate(image, 270);
    //                                       image = rotateImage(image);
                       recorder.record(image);
                       Log.i(LOG_TAG, "record " + i);
                       image = null;
                       serial++;
                       publishProgress(serial);
                   } catch (FileNotFoundException e) {
                       e.printStackTrace();
                   } catch (IOException e) {
                       e.printStackTrace();
                   } catch (com.googlecode.javacv.FrameRecorder.Exception e) {
                       e.printStackTrace();
                   }
               }
               return null;
           }
           @Override
           protected void onProgressUpdate(Integer... serial) {
               int value = serial[0];
               creatingProgress.setProgress(value);
           }
           @Override
           protected void onPostExecute(Void v)
           {
               creatingProgress.dismiss();
               if (recorder != null &amp;&amp; recording) {
                   recording = false;
                   Log.v(LOG_TAG,"Finishing recording, calling stop and release on recorder");
                   try {
                       recorder.stop();
                       recorder.release();
                       finish();
                       startActivity(new Intent(RecordActivity.this,AnswerViewActivity.class));
                   } catch (FFmpegFrameRecorder.Exception e) {
                       e.printStackTrace();
                   }
                   recorder = null;
               }
           }
       }

    my crop and rotate method are below

    private IplImage cropImage(IplImage src)
       {
           cvSetImageROI(src, r);
           IplImage cropped = IplImage.create(imageHeight, imageHeight, IPL_DEPTH_8U, 2);
           cvCopy(src, cropped);
           return cropped;
       }

       public static IplImage rotate(IplImage image, double angle) {        
           IplImage copy = opencv_core.cvCloneImage(image);

           IplImage rotatedImage = opencv_core.cvCreateImage(opencv_core.cvGetSize(copy), copy.depth(), copy.nChannels());
           CvMat mapMatrix = opencv_core.cvCreateMat( 2, 3, opencv_core.CV_32FC1 );

           //Define Mid Point
           CvPoint2D32f centerPoint = new CvPoint2D32f();
           centerPoint.x(copy.width()/2);
           centerPoint.y(copy.height()/2);

           //Get Rotational Matrix
           opencv_imgproc.cv2DRotationMatrix(centerPoint, angle, 1.0, mapMatrix);

           //Rotate the Image
           opencv_imgproc.cvWarpAffine(copy, rotatedImage, mapMatrix, opencv_imgproc.CV_INTER_CUBIC +  opencv_imgproc.CV_WARP_FILL_OUTLIERS, opencv_core.cvScalarAll(170));
           opencv_core.cvReleaseImage(copy);
           opencv_core.cvReleaseMat(mapMatrix);        
           return rotatedImage;
       }

    my final video crop and rotate but green frames and colored frames mixed with this.

    How to fix this problem. I’m not aware of iplimage. In some blogs they mention its YUV format. first u need to convert Y and then convert UV.

    How to solve this problem ?

  • How to set audio format from an ffmpeg filter ?

    4 août 2020, par Vadim Kantorov

    Is it possible to set the audio format just with an ffmpeg filter ?

    &#xA;

    My usecase is programmatic usage, so if it's possible to do with filters, that would simplify everything.

    &#xA;

    # create sample s16 audio&#xA;ffmpeg -f lavfi -i "sine=frequency=1000:duration=5" -c:a pcm_s16le -ar 8000 test.wav&#xA;&#xA;# works&#xA;ffmpeg -i test.wav -y -af &#x27;aresample=osf=flt,aformat=sample_fmts=flt&#x27; -f f32le test_f32.raw&#xA;&#xA;# fails&#xA;ffmpeg -i test.wav -y -af &#x27;aresample=osf=flt,aformat=sample_fmts=flt&#x27; test_f32.raw&#xA;# [NULL @ 0x56042863d980] Unable to find a suitable output format for &#x27;test_f32.raw&#x27;&#xA;

    &#xA;