Recherche avancée

Médias (1)

Mot : - Tags -/lev manovitch

Autres articles (4)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

Sur d’autres sites (3524)

  • Ffmpeg/Fluent-Ffmpeg : Output File Does Not Reflect Input Parameters

    17 août 2017, par Code Sherpa

    Use Case

    When a user records an audio file and uploads to firebase storage, run a trigger that crops a clip of that file and saves it to a "preview" directory.

    Problem

    When the file arrives on the server, it is just dead air before the start time (10 seconds) and then doesn’t stop after the duration of 10 seconds is exceeded. Whatever I put in the "-t" and "-ss" arguments seems to have no impact on the output file - not cropping correctly.

    Environment

    • mac client / firebase storage
    • node v8.1.0
    • ffmpeg v3.2.2
    • fluent-ffmpeg v2.1.2

    Node Code

     var command = new ffmpeg({ source: tempFilePath, timeout: 0 })
         .setFfmpegPath(ffmpegPath)
         .setFfprobePath(ffprobePath)
         .inputOption('-t', '10')
         .inputOption('-ss', '10')
         .outputOption('-acodec', 'copy')
         .on('start', function(commandLine) {
               console.log('Spawned Ffmpeg with command: ', commandLine);
          })
         .on('end', function() {
             console.log('Preview file cropping done successfully');
          })
         .on('error', function(err, stdout, stderr) {
             var build = err;
             if (!stdout === '') { build = build + '\n' + stdout; }
             build = build + '\n' + stderr;

             console.log(build);
          }).save(tempFilePath);

    Ffmpeg Command

    Spawned Ffmpeg with command : ffmpeg -t 10 -i
    /tmp/2EB100B0-6C1E-4D51-9087-764CA653AFC720170711232034.aac -y -acodec
    aac /tmp/2EB100B0-6C1E-4D51-9087-764CA653AFC720170711232034.aac

    Console Output

    $ ffmpeg -t 10 -i E506FE2E-DC81-4DD8-B751-211F7FD9A25820170816160502.aac -y -acodec aac output.aac -loglevel debug
    ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers
     built with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
     configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-libgsm --enable-libvidstab --enable-libx265 --disable-doc --arch=x86_64 --enable-runtime-cpudetect
     libavutil      55. 34.100 / 55. 34.100
     libavcodec     57. 64.101 / 57. 64.101
     libavformat    57. 56.100 / 57. 56.100
     libavdevice    57.  1.100 / 57.  1.100
     libavfilter     6. 65.100 /  6. 65.100
     libswscale      4.  2.100 /  4.  2.100
     libswresample   2.  3.100 /  2.  3.100
     libpostproc    54.  1.100 / 54.  1.100
    Splitting the commandline.
    Reading option '-t' ... matched as option 't' (record or transcode "duration" seconds of audio/video) with argument '10'.
    Reading option '-i' ... matched as input url with argument 'E506FE2E-DC81-4DD8-B751-211F7FD9A25820170816160502.aac'.
    Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
    Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'aac'.
    Reading option 'output.aac' ... matched as output url.
    Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
    Finished splitting the commandline.
    Parsing a group of options: global .
    Applying option y (overwrite output files) with argument 1.
    Applying option loglevel (set logging level) with argument debug.
    Successfully parsed a group of options.
    Parsing a group of options: input url E506FE2E-DC81-4DD8-B751-211F7FD9A25820170816160502.aac.
    Applying option t (record or transcode "duration" seconds of audio/video) with argument 10.
    Successfully parsed a group of options.
    Opening an input file: E506FE2E-DC81-4DD8-B751-211F7FD9A25820170816160502.aac.
    [file @ 0x7fe42f700420] Setting default whitelist 'file,crypto'
    [aac @ 0x7fe431000000] Format aac probed with size=2048 and score=51
    [aac @ 0x7fe431000000] Before avformat_find_stream_info() pos: 0 bytes read:32928 seeks:4 nb_streams:1
    [aac @ 0x7fe431000000] All info found
    [aac @ 0x7fe431000000] Estimating duration from bitrate, this may be inaccurate
    [aac @ 0x7fe431000000] After avformat_find_stream_info() pos: 37888 bytes read:98464 seeks:4 frames:50
    Input #0, aac, from 'E506FE2E-DC81-4DD8-B751-211F7FD9A25820170816160502.aac':
     Duration: 00:01:24.28, bitrate: 335 kb/s
       Stream #0:0, 50, 1/28224000: Audio: aac (LC), 44100 Hz, stereo, fltp, 335 kb/s
    Successfully opened the file.
    Parsing a group of options: output url output.aac.
    Applying option acodec (force audio codec ('copy' to copy stream)) with argument aac.
    Successfully parsed a group of options.
    Opening an output file: output.aac.
    [file @ 0x7fe42f7016e0] Setting default whitelist 'file,crypto'
    Successfully opened the file.
    detected 4 logical cores
    [graph 0 input from stream 0:0 @ 0x7fe42f701880] Setting 'time_base' to value '1/44100'
    [graph 0 input from stream 0:0 @ 0x7fe42f701880] Setting 'sample_rate' to value '44100'
    [graph 0 input from stream 0:0 @ 0x7fe42f701880] Setting 'sample_fmt' to value 'fltp'
    [graph 0 input from stream 0:0 @ 0x7fe42f701880] Setting 'channel_layout' to value '0x3'
    [graph 0 input from stream 0:0 @ 0x7fe42f701880] tb:1/44100 samplefmt:fltp samplerate:44100 chlayout:0x3
    [audio format for output stream 0:0 @ 0x7fe42f702060] Setting 'sample_fmts' to value 'fltp'
    [audio format for output stream 0:0 @ 0x7fe42f702060] Setting 'sample_rates' to value '96000|88200|64000|48000|44100|32000|24000|22050|16000|12000|11025|8000|7350'
    [AVFilterGraph @ 0x7fe42f6101a0] query_formats: 5 queried, 12 merged, 0 already done, 0 delayed
    Output #0, adts, to 'output.aac':
     Metadata:
       encoder         : Lavf57.56.100
       Stream #0:0, 0, 1/44100: Audio: aac (LC), 44100 Hz, stereo, fltp, delay 1024, 128 kb/s
       Metadata:
         encoder         : Lavc57.64.101 aac
    Stream mapping:
     Stream #0:0 -> #0:0 (aac (native) -> aac (native))
    Press [q] to stop, [?] for help
    cur_dts is invalid (this is harmless if it occurs once at the start per stream)
       Last message repeated 1 times
    [output stream 0:0 @ 0x7fe42f701ee0] EOF on sink link output stream 0:0:default.
    No more output streams to write to, finishing.
    [aac @ 0x7fe431001200] Trying to remove 344 more samples than there are in the queue
    size=     160kB time=00:00:10.00 bitrate= 130.9kbits/s speed=20.2x    
    video:0kB audio:157kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.881580%
    Input file #0 (E506FE2E-DC81-4DD8-B751-211F7FD9A25820170816160502.aac):
     Input stream #0:0 (audio): 432 packets read (398208 bytes); 432 frames decoded (442368 samples);
     Total: 432 packets (398208 bytes) demuxed
    Output file #0 (output.aac):
     Output stream #0:0 (audio): 431 frames encoded (441000 samples); 432 packets muxed (160716 bytes);
     Total: 432 packets (160716 bytes) muxed
    432 frames successfully decoded, 0 decoding errors
    [AVIOContext @ 0x7fe42f611040] Statistics: 0 seeks, 432 writeouts
    [aac @ 0x7fe431001200] Qavg: 4508.253
    [AVIOContext @ 0x7fe42f7004c0] Statistics: 458912 bytes read, 4 seeks
  • all : Replace if (ARCH_FOO) checks by #if ARCH_FOO

    12 juin 2022, par Andreas Rheinhardt
    all : Replace if (ARCH_FOO) checks by #if ARCH_FOO
    

    This is more spec-compliant because it does not rely
    on dead-code elimination by the compiler. Especially
    MSVC has problems with this, as can be seen in
    https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/296373.html
    or
    https://ffmpeg.org/pipermail/ffmpeg-devel/2022-May/297022.html

    This commit does not eliminate every instance where we rely
    on dead code elimination : It only tackles branching to
    the initialization of arch-specific dsp code, not e.g. all
    uses of CONFIG_ and HAVE_ checks. But maybe it is already
    enough to compile FFmpeg with MSVC with whole-programm-optimizations
    enabled (if one does not disable too many components).

    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>

    • [DH] libavcodec/aacdec_template.c
    • [DH] libavcodec/aacenc.c
    • [DH] libavcodec/aacpsdsp_template.c
    • [DH] libavcodec/aacsbr_template.c
    • [DH] libavcodec/ac3dsp.c
    • [DH] libavcodec/acelp_filters.c
    • [DH] libavcodec/acelp_vectors.c
    • [DH] libavcodec/alacdsp.c
    • [DH] libavcodec/audiodsp.c
    • [DH] libavcodec/blockdsp.c
    • [DH] libavcodec/bswapdsp.c
    • [DH] libavcodec/cavsdsp.c
    • [DH] libavcodec/celp_filters.c
    • [DH] libavcodec/celp_math.c
    • [DH] libavcodec/cfhddsp.c
    • [DH] libavcodec/cfhdencdsp.c
    • [DH] libavcodec/dcadsp.c
    • [DH] libavcodec/dct.c
    • [DH] libavcodec/dirac_dwt.c
    • [DH] libavcodec/diracdsp.c
    • [DH] libavcodec/dnxhdenc.c
    • [DH] libavcodec/exrdsp.c
    • [DH] libavcodec/fdctdsp.c
    • [DH] libavcodec/fft_template.c
    • [DH] libavcodec/flacdsp.c
    • [DH] libavcodec/fmtconvert.c
    • [DH] libavcodec/g722dsp.c
    • [DH] libavcodec/h263dsp.c
    • [DH] libavcodec/h264chroma.c
    • [DH] libavcodec/h264dsp.c
    • [DH] libavcodec/h264pred.c
    • [DH] libavcodec/h264qpel.c
    • [DH] libavcodec/hevcdsp.c
    • [DH] libavcodec/hevcpred.c
    • [DH] libavcodec/hpeldsp.c
    • [DH] libavcodec/huffyuvdsp.c
    • [DH] libavcodec/huffyuvencdsp.c
    • [DH] libavcodec/idctdsp.c
    • [DH] libavcodec/iirfilter.c
    • [DH] libavcodec/jpeg2000dsp.c
    • [DH] libavcodec/lossless_audiodsp.c
    • [DH] libavcodec/lossless_videodsp.c
    • [DH] libavcodec/lossless_videoencdsp.c
    • [DH] libavcodec/lpc.c
    • [DH] libavcodec/mdct15.c
    • [DH] libavcodec/me_cmp.c
    • [DH] libavcodec/mlpdsp.c
    • [DH] libavcodec/mpegaudiodsp.c
    • [DH] libavcodec/mpegvideo.c
    • [DH] libavcodec/mpegvideo_enc.c
    • [DH] libavcodec/mpegvideodsp.c
    • [DH] libavcodec/mpegvideoencdsp.c
    • [DH] libavcodec/opus_pvq.c
    • [DH] libavcodec/opusdsp.c
    • [DH] libavcodec/pixblockdsp.c
    • [DH] libavcodec/pngdsp.c
    • [DH] libavcodec/proresdsp.c
    • [DH] libavcodec/qpeldsp.c
    • [DH] libavcodec/rdft.c
    • [DH] libavcodec/rv34dsp.c
    • [DH] libavcodec/rv40dsp.c
    • [DH] libavcodec/sbcdsp.c
    • [DH] libavcodec/sbrdsp_template.c
    • [DH] libavcodec/snow_dwt.c
    • [DH] libavcodec/svq1enc.c
    • [DH] libavcodec/synth_filter.c
    • [DH] libavcodec/takdsp.c
    • [DH] libavcodec/ttadsp.c
    • [DH] libavcodec/ttaencdsp.c
    • [DH] libavcodec/utvideodsp.c
    • [DH] libavcodec/v210dec_init.h
    • [DH] libavcodec/v210enc_init.h
    • [DH] libavcodec/vc1dsp.c
    • [DH] libavcodec/videodsp.c
    • [DH] libavcodec/vorbisdsp.c
    • [DH] libavcodec/vp3dsp.c
    • [DH] libavcodec/vp56dsp.c
    • [DH] libavcodec/vp8dsp.c
    • [DH] libavcodec/vp9dsp.c
    • [DH] libavcodec/wmv2dsp.c
    • [DH] libavcodec/x86/mdct15_init.c
    • [DH] libavcodec/xvididct.c
    • [DH] libavfilter/af_afirdsp.h
    • [DH] libavfilter/af_anlmdn.c
    • [DH] libavfilter/af_volume.c
    • [DH] libavfilter/avf_showcqt.c
    • [DH] libavfilter/colorspacedsp.c
    • [DH] libavfilter/scene_sad.c
    • [DH] libavfilter/vf_atadenoise.c
    • [DH] libavfilter/vf_blend_init.h
    • [DH] libavfilter/vf_bwdif.c
    • [DH] libavfilter/vf_eq.h
    • [DH] libavfilter/vf_framerate.c
    • [DH] libavfilter/vf_fspp.c
    • [DH] libavfilter/vf_gblur_init.h
    • [DH] libavfilter/vf_gradfun.c
    • [DH] libavfilter/vf_hflip_init.h
    • [DH] libavfilter/vf_hqdn3d.c
    • [DH] libavfilter/vf_idet.c
    • [DH] libavfilter/vf_limiter.c
    • [DH] libavfilter/vf_lut3d.c
    • [DH] libavfilter/vf_maskedclamp.c
    • [DH] libavfilter/vf_maskedmerge.c
    • [DH] libavfilter/vf_nlmeans_init.h
    • [DH] libavfilter/vf_noise.c
    • [DH] libavfilter/vf_overlay.c
    • [DH] libavfilter/vf_pp7.c
    • [DH] libavfilter/vf_psnr.c
    • [DH] libavfilter/vf_pullup.c
    • [DH] libavfilter/vf_removegrain.c
    • [DH] libavfilter/vf_spp.c
    • [DH] libavfilter/vf_ssim.c
    • [DH] libavfilter/vf_stereo3d.c
    • [DH] libavfilter/vf_threshold_init.h
    • [DH] libavfilter/vf_tinterlace.c
    • [DH] libavfilter/vf_transpose.c
    • [DH] libavfilter/vf_v360.c
    • [DH] libavfilter/vf_w3fdif.c
    • [DH] libavfilter/vf_yadif.c
    • [DH] libavutil/cpu.c
    • [DH] libavutil/fixed_dsp.c
    • [DH] libavutil/float_dsp.c
    • [DH] libavutil/lls.c
    • [DH] libswresample/audioconvert.c
    • [DH] libswresample/rematrix.c
    • [DH] libswresample/resample_dsp.c
    • [DH] libswscale/rgb2rgb.c
    • [DH] libswscale/swscale.c
    • [DH] libswscale/swscale_unscaled.c
    • [DH] libswscale/utils.c
    • [DH] libswscale/yuv2rgb.c
  • GRAY16 stream with over network ffmpeg

    9 novembre 2023, par Norbert P.

    Im working in a school project where we need to use depth cameras. The camera produces color and depth (in other words 16bit grayscale image). We decided to use ffmpeg, as later on compression could be very useful. For now we got some basic stream running form one PC to other. These settings include :

    &#xA;

      &#xA;
    • rtmp
    • &#xA;

    • flv as container
    • &#xA;

    • pixel format AV_PIX_FMT_YUV420P
    • &#xA;

    • codec AV_CODEC_ID_H264
    • &#xA;

    &#xA;

    The problem we are having is with grayscale image. Not every codec is able to cope with this format, so as not every protocol able to work with given codec. I got some settings "working" but receiver side is just stuck on avformat_open_input() method.&#xA;I have also tested it with commandline where ffmpeg is listening for connection and same happens.

    &#xA;

    I include a minimum "working" example of client code. Server can be tested with "ffmpeg.exe -f apng -listen 1 -i rtmp ://localhost:9999/stream/stream1 -c copy -f apng -listen 1 rtmp ://localhost:2222/live/l" or code below. I get no warnings, ffmpeg is newest version installed with "vcpkg install —triplet x64-windows ffmpeg[ffmpeg,ffprobe,zlib]" on windows or packet manager on linux.

    &#xA;

    The question : Did I miss something ? How do I get it to work ? If you have any better ideas I would very gladly consider them. In the end I need 16 bits of lossless transmission, could be split between channels etc. which I also tried with same effect.

    &#xA;

    Client code that would have camera and connect to server :

    &#xA;

    extern "C" {&#xA;#include <libavutil></libavutil>opt.h>&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavutil></libavutil>channel_layout.h>&#xA;#include <libavutil></libavutil>common.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavutil></libavutil>imgutils.h>&#xA;}&#xA;&#xA;int main() {&#xA;&#xA;    std::string container = "apng";&#xA;    AVCodecID codec_id = AV_CODEC_ID_APNG;&#xA;    AVPixelFormat pixFormat = AV_PIX_FMT_GRAY16BE;&#xA;&#xA;    AVFormatContext* format_ctx;&#xA;    AVCodec* out_codec;&#xA;    AVStream* out_stream;&#xA;    AVCodecContext* out_codec_ctx;&#xA;    AVFrame* frame;&#xA;    uint8_t* data;&#xA;&#xA;    std::string server = "rtmp://localhost:9999/stream/stream1";&#xA;&#xA;    int width = 1280, height = 720, fps = 30, bitrate = 1000000;&#xA;&#xA;    //initialize format context for output with flv and no filename&#xA;    avformat_alloc_output_context2(&amp;format_ctx, nullptr, container.c_str(), server.c_str());&#xA;    if (!format_ctx) {&#xA;        return 1;&#xA;    }&#xA;&#xA;    //AVIOContext for accessing the resource indicated by url&#xA;    if (!(format_ctx->oformat->flags &amp; AVFMT_NOFILE)) {&#xA;        int avopen_ret = avio_open(&amp;format_ctx->pb, server.c_str(),&#xA;            AVIO_FLAG_WRITE);// , nullptr, nullptr);&#xA;        if (avopen_ret &lt; 0) {&#xA;            fprintf(stderr, "failed to open stream output context, stream will not work\n");&#xA;            return 1;&#xA;        }&#xA;    }&#xA;&#xA;&#xA;    const AVCodec* tmp_out_codec = avcodec_find_encoder(codec_id);&#xA;    //const AVCodec* tmp_out_codec = avcodec_find_encoder_by_name("hevc");&#xA;    out_codec = const_cast(tmp_out_codec);&#xA;    if (!(out_codec)) {&#xA;        fprintf(stderr, "Could not find encoder for &#x27;%s&#x27;\n",&#xA;            avcodec_get_name(codec_id));&#xA;&#xA;        return 1;&#xA;    }&#xA;&#xA;    out_stream = avformat_new_stream(format_ctx, out_codec);&#xA;    if (!out_stream) {&#xA;        fprintf(stderr, "Could not allocate stream\n");&#xA;        return 1;&#xA;    }&#xA;&#xA;    out_codec_ctx = avcodec_alloc_context3(out_codec);&#xA;&#xA;    const AVRational timebase = { 60000, fps };&#xA;    const AVRational dst_fps = { fps, 1 };&#xA;    av_log_set_level(AV_LOG_VERBOSE);&#xA;    //codec_ctx->codec_tag = 0;&#xA;    //codec_ctx->codec_id = codec_id;&#xA;    out_codec_ctx->codec_type = AVMEDIA_TYPE_VIDEO;&#xA;    out_codec_ctx->width = width;&#xA;    out_codec_ctx->height = height;&#xA;    out_codec_ctx->gop_size = 1;&#xA;    out_codec_ctx->time_base = timebase;&#xA;    out_codec_ctx->pix_fmt = pixFormat;&#xA;    out_codec_ctx->framerate = dst_fps;&#xA;    out_codec_ctx->time_base = av_inv_q(dst_fps);&#xA;    out_codec_ctx->bit_rate = bitrate;&#xA;    //if (fctx->oformat->flags &amp; AVFMT_GLOBALHEADER)&#xA;    //{&#xA;    //    codec_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;&#xA;    //}&#xA;&#xA;    out_stream->time_base = out_codec_ctx->time_base; //will be set afterwards by avformat_write_header to 1/1000&#xA;&#xA;    int ret = avcodec_parameters_from_context(out_stream->codecpar, out_codec_ctx);&#xA;    if (ret &lt; 0)&#xA;    {&#xA;        fprintf(stderr, "Could not initialize stream codec parameters!\n");&#xA;        return 1;&#xA;    }&#xA;&#xA;    AVDictionary* codec_options = nullptr;&#xA;    av_dict_set(&amp;codec_options, "tune", "zerolatency", 0);&#xA;&#xA;    // open video encoder&#xA;    ret = avcodec_open2(out_codec_ctx, out_codec, &amp;codec_options);&#xA;    if (ret &lt; 0)&#xA;    {&#xA;        fprintf(stderr, "Could not open video encoder!\n");&#xA;        return 1;&#xA;    }&#xA;    av_dict_free(&amp;codec_options);&#xA;&#xA;    out_stream->codecpar->extradata_size = out_codec_ctx->extradata_size;&#xA;    out_stream->codecpar->extradata = static_cast(av_mallocz(out_codec_ctx->extradata_size));&#xA;    memcpy(out_stream->codecpar->extradata, out_codec_ctx->extradata, out_codec_ctx->extradata_size);&#xA;&#xA;    av_dump_format(format_ctx, 0, server.c_str(), 1);&#xA;&#xA;    frame = av_frame_alloc();&#xA;&#xA;    int sz = av_image_get_buffer_size(pixFormat, width, height, 32);&#xA;#ifdef _WIN32&#xA;    data = (uint8_t*)_aligned_malloc(sz, 32);&#xA;    if (data == NULL)&#xA;        return ENOMEM;&#xA;#else&#xA;    ret = posix_memalign(reinterpret_cast(&amp;data), 32, sz);&#xA;#endif&#xA;    av_image_fill_arrays(frame->data, frame->linesize, data, pixFormat, width, height, 32);&#xA;    frame->format = pixFormat;&#xA;    frame->width = width;&#xA;    frame->height = height;&#xA;    frame->pts = 1;&#xA;    if (avformat_write_header(format_ctx, nullptr) &lt; 0) //Header making problems!!!&#xA;    {&#xA;        fprintf(stderr, "Could not write header!\n");&#xA;        return 1;&#xA;    }&#xA;&#xA;    printf("stream time base = %d / %d \n", out_stream->time_base.num, out_stream->time_base.den);&#xA;&#xA;    double inv_stream_timebase = (double)out_stream->time_base.den / (double)out_stream->time_base.num;&#xA;    printf("Init OK\n");&#xA;    /*  Init phase end*/&#xA;    int dts = 0;&#xA;    int frameNo = 0;&#xA;&#xA;    while (true) {&#xA;        //Fill dummy frame with something&#xA;        for (int y = 0; y &lt; height; y&#x2B;&#x2B;) {&#xA;            uint16_t color = ((y &#x2B; frameNo) * 256) % (256 * 256);&#xA;            for (int x = 0; x &lt; width; x&#x2B;&#x2B;) {&#xA;                data[x&#x2B;y*width] = color;&#xA;            }&#xA;        }&#xA;&#xA;        memcpy(frame->data[0], data, 1280 * 720 * sizeof(uint16_t));&#xA;        AVPacket* pkt = av_packet_alloc();&#xA;&#xA;        int ret = avcodec_send_frame(out_codec_ctx, frame);&#xA;        if (ret &lt; 0)&#xA;        {&#xA;            fprintf(stderr, "Error sending frame to codec context!\n");&#xA;            return ret;&#xA;        }&#xA;        while (ret >= 0) {&#xA;            ret = avcodec_receive_packet(out_codec_ctx, pkt);&#xA;            if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)&#xA;                break;&#xA;            else if (ret &lt; 0) {&#xA;                fprintf(stderr, "Error during encoding\n");&#xA;                break;&#xA;            }&#xA;            pkt->dts = dts;&#xA;            pkt->pts = dts;&#xA;            dts &#x2B;= 33;&#xA;            av_write_frame(format_ctx, pkt);&#xA;            frameNo&#x2B;&#x2B;;&#xA;            av_packet_unref(pkt);&#xA;        }&#xA;        printf("Streamed %d frames\n", frameNo);&#xA;    }&#xA;    return 0;&#xA;}&#xA;

    &#xA;

    And part of server that should receive. code where is stops and waits

    &#xA;

    extern "C" {&#xA;#include <libavcodec></libavcodec>avcodec.h>&#xA;#include <libavformat></libavformat>avformat.h>&#xA;#include <libavformat></libavformat>avio.h>&#xA;}&#xA;&#xA;int main() {&#xA;    AVFormatContext* fmt_ctx = NULL;&#xA;    av_log_set_level(AV_LOG_VERBOSE);&#xA;    AVDictionary* options = nullptr;&#xA;    av_dict_set(&amp;options, "protocol_whitelist", "file,udp,rtp,tcp,rtmp,rtsp,hls", 0);&#xA;    av_dict_set(&amp;options, "timeout", "500000", 0); // Timeout in microseconds &#xA;&#xA;//Next Line hangs   &#xA;    int ret = avformat_open_input(&amp;fmt_ctx, "rtmp://localhost:9999/stream/stream1", NULL, &amp;options);&#xA;    if (ret != 0) {&#xA;        fprintf(stderr, "Could not open RTMP stream\n");&#xA;        return -1;&#xA;    }&#xA;&#xA;    // Find the first video stream&#xA;    ret = avformat_find_stream_info(fmt_ctx, nullptr);&#xA;    if (ret &lt; 0) {&#xA;        return ret;&#xA;    }&#xA;    //...&#xA;} &#xA;&#xA;

    &#xA;