Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP

Autres articles (111)

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

  • 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 (...)

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

Sur d’autres sites (6505)

  • How to Implement Cross-Channel Analytics : A Guide for Marketers

    17 avril 2024, par Erin

    Every modern marketer knows they have to connect with consumers across several channels. But do you know how well Instagram works alongside organic traffic or your email list ? Are you even tracking the impacts of these channels in one place ?

    You need a cross-channel analytics solution if you answered no to either of these questions. 

    In this article, we’ll explain cross-channel analytics, why your company probably needs it and how to set up a cross-channel analytics solution as quickly and easily as possible.

    What is cross-channel analytics ? 

    Cross-channel analytics is a form of marketing analytics that collects and analyses data from every channel and campaign you use.

    The result is a comprehensive view of your customer’s journey and each channel’s role in converting customers. 

    Cross-channel analytics lets you track every channel you use to convert customers, including :

    • Your website
    • Social media profiles
    • Email
    • Paid search
    • E-commerce
    • Retargeting campaigns

    Cross-channel analytics solves one of the most significant issues of cross-channel or multi-channel marketing efforts : measurement. 

    Research shows that only 16% of marketing tech stacks allow for accurate measurement of multi-channel initiatives across channels. 

    That’s a problem, given the staggering number of touchpoints in a typical buyer’s conversion path. However, it can be fixed using a cross-channel analytics approach that lets you measure the performance of every channel and assign a dollar value to its role in every conversion. 

    The difference between cross-channel analytics and multi-channel analytics

    Cross-channel analytics and multi-channel analytics sound very similar, but there’s one key difference you need to know. Multi-channel analytics measures the performance of several channels, but not necessarily all of them, nor the extent to which they work together to drive conversions. Conversely, cross-channel analytics measures the performance of all your marketing channels and how they work together. 

    What are the benefits of cross-channel analytics 

    Cross-channel analytics offers a lot of marketing and business benefits. Here are the ones marketing managers love most.

    Get a complete view of the customer journey

    Implementing a cross-channel analytics solution is the only way to get a complete view of your customer journey. 

    Cross-channel marketing analytics lets you see your customer journey in high definition, allowing you to build comprehensive customer profiles using data from multiple sources across every touchpoint

    A diagram showing how complex customer journeys are

    The result ? You get to understand how every customer behaves at every point of the customer journey, why they convert or leave your funnel, and which channels play the biggest role. 

    In short, you get to see why customers convert so you can learn how to convert more of them.

    Personalise the customer experience

    According to a McKinsey study, customers demand personalisation, and brands that excel at it generate 40% more revenue. Deliver the personalisation they desire and reap the benefits with cross-channel analytics. 

    When you understand the customer journey in detail, it becomes much easier to personalise your website and marketing efforts to their preferences and behaviours.

    Identify your most effective marketing channels

    Cross-channel marketing helps you understand your marketing efforts to see how every channel impacts conversions. 

    Take a look at the screenshot from Matomo below. Cross-channel analytics lets you get incredibly granular — we can see the number of conversions of organic search drives and the performance of individual search engines. 

    A Matomo screenshot showing channel attribution

    This makes it easy to identify your most effective marketing channels and allocate your resources appropriately. It also allows you to ask (and answer) which channels are the most effective.

    Try Matomo for Free

    Get the web insights you need, without compromising data accuracy.

    No credit card required

    Attribute conversions accurately 

    An attribution model decides how you assign credit for each customer conversion to different touchpoints on the customer journey. Without a cross-channel analytics solution, you’re stuck using a standard attribution model like first or last click. 

    These models will show you how customers first found your brand or which channel finally convinced them to convert, but it doesn’t help you understand the role all your channels played in the conversion. 

    Cross-channel analytics solves this attribution problem. Rather than attributing a conversion to the touchpoint that directly led to the sale, cross-channel data gives you the real picture and allows you to use multi-touch attribution to understand which touchpoints generate the most revenue.

    How to set up cross-channel analytics

    Now that you know what cross-channel analytics is and why you should use it, here’s how to set up your solution. 

    1. Determine your objectives

    Defining your marketing goals will help you build a more relevant and actionable cross-channel analytics solution. 

    If you want to improve marketing attribution, for example, you can choose a platform with that feature built-in. If you care about personalisation, you could choose a platform with A/B testing capabilities to measure the impact of your personalisation efforts. 

    1. Set relevant KPIs

    You’ll want to track relevant KPIs to measure the marketing effectiveness of each channel. Put top-of-the-funnel metrics aside and focus on conversion metrics

    These include :

    • Conversion rate
    • Average visit duration
    • Bounce rate
    1. Implement tracking and analytics tools

    Gathering customer data from every channel and centralising it in a single location is one of the biggest challenges of cross-channel analytics. Still, it’s made easier with the right tracking tool or analytics platform. 

    The trick is to choose a platform that lets you measure as many of your channels as possible in a single platform. With Matomo, for example, you can track search, paid search, social and email campaigns and your website analytics.

    1. Set up a multi-touch attribution model

    Now that you have all of your data in one place, you can set up a multi-touch attribution model that lets you understand the extent to which each marketing channel contributes to your overall success. 

    There are several attribution models to choose from, including :

    Image of six different attribution models

    Each model has benefits and drawbacks, so choosing the right model for your organisation can be tricky. Rather than take a wild guess, evaluate each model against your marketing objectives, sales length cycle and data availability.

    For example, if you want to focus on optimising customer acquisition costs, a model that prioritises earlier touchpoints will be better. If you care about conversions, you might try a time decay model. 

    1. Turn data into insights with reports

    One of the big benefits of choosing a tool like Matomo, which consolidates data in one place, is that it significantly speeds up and simplifies reporting.

    When all the data is stored in one platform, you don’t need to spend hours combing through your social media platforms and copying and pasting analytics data into a spreadsheet. It’s all there and ready for you to run reports.

    Try Matomo for Free

    Get the web insights you need, without compromising data accuracy.

    No credit card required

    1. Take action

    There’s no point implementing a cross-channel analytics system if you aren’t going to take action. 

    But where should you start ?

    Optimising your budgets and prioritising marketing spend is a great starting point. Use your cross-channel insights to find your most effective marketing channels (they’re the ones that convert the most customers or have the highest ROI) and allocate more of your budget to them. 

    You can also optimise the channels that aren’t pulling their weight if social media is letting you down ; for example, experiment with tactics like social commerce that could drive more conversions. Alternatively, you could choose to stop investing entirely in these channels.

    Cross-channel analytics best practices

    If you already have a cross-channel analytics solution, take things to the next level with the following best practices. 

    Use a centralised solution to track everything

    Centralising your data in one analytics tool can streamline your marketing efforts and help you stay on top of your data. It won’t just save you from tabbing between different browsers or copying and pasting everything into a spreadsheet, but it can also make it easier to create reports. 

    Think about consumer privacy 

    If you are looking at a new cross-channel analytics tool, consider how it accounts for data privacy regulations in your area. 

    You’re going to be collecting a lot of data, so it’s important to respect their privacy wishes. 

    It’s best to choose a platform like Matomo that complies with the strictest privacy laws (CCPA, GDPR, etc.).

    Monitor data in real time

    So, you’ve got a holistic view of your marketing efforts by integrating all your channels into a single tool ?

    Great, now go further by monitoring the impact of your marketing efforts in real time.

    A screenshot of Matomo's real-time visitor log

    With a web analytics platform like Matomo, you can see who visits your site, what they do, and where they come from through features like the visits log report, which even lets you view individual user sessions. This lets you measure the impact of posting on a particular social channel or launching a new offer. 

    Try Matomo for Free

    Get the web insights you need, without compromising data accuracy.

    No credit card required

    Reallocate marketing budgets based on performance

    When you track every channel, you can use a multi-touch attribution model like position-based or time-decay to give every channel the credit it deserves. But don’t just credit each channel ; turn your valuable insights into action. 

    Use cross-channel attribution analytics data to reallocate your marketing budget to the most profitable channels or spend time optimising the channels that aren’t pulling their weight. 

    Cross-channel analytics platforms to get started with 

    The marketing analytics market is huge. Mordor Intelligence valued it at $6.31 billion in 2024 and expects it to reach $11.54 billion by 2029. Many of these platforms offer cross-channel analytics, but few can track the impact of multiple marketing channels in one place. 

    So, rather than force you to trawl through confusing product pages, we’ve shortlisted three of the best cross-channel analytics solutions. 

    Matomo

    Screenshot example of the Matomo dashboard

    Matomo is a web analytics platform that lets you collect and centralise your marketing data while giving you 100% accurate data. That includes search, social, e-commerce, campaign tracking data and comprehensive website analytics.

    Better still, you get the necessary tools to turn those insights into action. Custom reporting lets you track and visualise the metrics that matter, while conversion optimisation tools like built-in A/B testing, heatmaps, session recordings and more let you test your theories. 

    Google Analytics

    A screenshot of Google Analytics 4 UI

    Google Analytics is the most popular and widely used tool on the market. The level of analysis and customisation you can do with it is impressive for a free tool. That includes tracking just about any event and creating reports from scratch. 

    Google Analytics provides some cross-channel marketing features and lets you track the impact of various channels, such as social and search, but there are a couple of drawbacks. 

    Privacy can be a concern because Google Analytics collects data from your customers for its own remarketing purposes. 

    It also uses data sampling to generate wider insights from a small subset of your data. This lack of accurate data reporting can cause you to generate false insights.

    With Google Analytics, you’ll also need to subscribe to additional tools to gain advanced insights into the user experience. So, consider that while this tool is free, you’ll need to pay for heatmaps, session recording and A/B testing tools to optimise effectively.

    Improvado

    A screenshot of Improvado's homepage

    Improvado is an analytics tool for sales and marketing teams that extracts thousands of metrics from hundreds of sources. It centralises data in data warehouses, from which you can create a range of marketing dashboards.

    While Improvado does have analytics capabilities, it is primarily an ETL (extraction, transform, load) tool for organisations that want to centralise all their data. That means marketers who aren’t familiar with data transformations may struggle to get their heads around the complexity of the platform.

    Make the most of cross-channel analytics with Matomo

    Cross-channel analytics is the only way to get a comprehensive view of your customer journey and understand how your channels work together to drive conversions.

    Then you’re dealing with so many channels and data ; keeping things as simple as possible is the key to success. That’s why over 1 million websites choose Matomo. 

    Our all-in-one analytics solution measures traditional web analytics, behavioural analytics, attribution and SEO, so you have 100% accurate data in one place. 

    Try it free for 21 days. No credit card required.

  • Error transcoding with FFmpeg : Error : Output format hls is not available

    6 mai 2024, par asif mohmd

    I am using FFmpeg library to transcode a video file into multiple resolutions and create an HLS (HTTP Live Streaming) master playlist.

    


    It takes a video file as input but its does give me the output with HLS playlist.I got a error called "Output format hls is not available". Only the Output directory is creating

    


    I am using FFMpeg 7.0 full build version and also tried older versions and ffmpeg essentials and also tried chocolatey.

    


    if i remove the implementation of HLS from this code.it will create 4 different resolution videos in my output.

    


    Note:I just tried this same code on my friend MAC Book by only changing the setffmpegPath : "ffmpeg.setFfmpegPath("C :\ffmpeg\bin\ffmpeg.exe") ;" to his ffmpeg directory.
Its working perfectly in his mac book

    


    import "dotenv/config";&#xA;import * as fs from "fs";&#xA;import * as path from "path";&#xA;import ffmpeg from "fluent-ffmpeg";&#xA;import crypto from "crypto";&#xA;&#xA;ffmpeg.setFfmpegPath("C:\\ffmpeg\\bin\\ffmpeg.exe");&#xA;&#xA;export const FFmpegTranscoder = async (file: any): Promise<any> => {&#xA;  try {&#xA;    console.log("Starting script");&#xA;    console.time("req_time");&#xA;&#xA;    const randomName = (bytes = 32) =>&#xA;      crypto.randomBytes(bytes).toString("hex");&#xA;    const fileName = randomName();&#xA;    const directoryPath = path.join(__dirname, "..", "..", "input");&#xA;    const filePath = path.join(directoryPath, `${fileName}.mp4`);&#xA;&#xA;    if (!fs.existsSync(directoryPath)) {&#xA;      fs.mkdirSync(directoryPath, { recursive: true });&#xA;    }&#xA;&#xA;    const paths = await new Promise<any>((resolve, reject) => {&#xA;      fs.writeFile(filePath, file, async (err) => {&#xA;        if (err) {&#xA;          console.error("Error saving file:", err);&#xA;          throw err;&#xA;        }&#xA;        console.log("File saved successfully:", filePath);&#xA;&#xA;        try {&#xA;          const outputDirectoryPath = await transcodeWithFFmpeg(&#xA;            fileName,&#xA;            filePath&#xA;          );&#xA;          resolve({ directoryPath, filePath, fileName, outputDirectoryPath });&#xA;        } catch (error) {&#xA;          console.error("Error transcoding with FFmpeg:", error);&#xA;        }&#xA;      });&#xA;    });&#xA;    return paths;&#xA;  } catch (e: any) {&#xA;    console.log(e);&#xA;  }&#xA;};&#xA;&#xA;const transcodeWithFFmpeg = async (fileName: string, filePath: string) => {&#xA;  const directoryPath = path.join(&#xA;    __dirname,&#xA;    "..",&#xA;    "..",&#xA;    `output/hls/${fileName}`&#xA;  );&#xA;&#xA;  if (!fs.existsSync(directoryPath)) {&#xA;    fs.mkdirSync(directoryPath, { recursive: true });&#xA;  }&#xA;&#xA;  const resolutions = [&#xA;    {&#xA;      resolution: "256x144",&#xA;      videoBitrate: "200k",&#xA;      audioBitrate: "64k",&#xA;    },&#xA;    {&#xA;      resolution: "640x360",&#xA;      videoBitrate: "800k",&#xA;      audioBitrate: "128k",&#xA;    },&#xA;    {&#xA;      resolution: "1280x720",&#xA;      videoBitrate: "2500k",&#xA;      audioBitrate: "192k",&#xA;    },&#xA;    {&#xA;      resolution: "1920x1080",&#xA;      videoBitrate: "5000k",&#xA;      audioBitrate: "256k",&#xA;    },&#xA;  ];&#xA;&#xA;  const variantPlaylists: { resolution: string; outputFileName: string }[] = [];&#xA;&#xA;  for (const { resolution, videoBitrate, audioBitrate } of resolutions) {&#xA;    console.log(`HLS conversion starting for ${resolution}`);&#xA;    const outputFileName = `${fileName}_${resolution}.m3u8`;&#xA;    const segmentFileName = `${fileName}_${resolution}_%03d.ts`;&#xA;&#xA;    await new Promise<void>((resolve, reject) => {&#xA;      ffmpeg(filePath)&#xA;        .outputOptions([&#xA;          `-c:v h264`,&#xA;          `-b:v ${videoBitrate}`,&#xA;          `-c:a aac`,&#xA;          `-b:a ${audioBitrate}`,&#xA;          `-vf scale=${resolution}`,&#xA;          `-f hls`,&#xA;          `-hls_time 10`,&#xA;          `-hls_list_size 0`,&#xA;          `-hls_segment_filename ${directoryPath}/${segmentFileName}`,&#xA;        ])&#xA;        .output(`${directoryPath}/${outputFileName}`)&#xA;        .on("end", () => resolve())&#xA;        .on("error", (err) => reject(err))&#xA;        .run();&#xA;    });&#xA;    const variantPlaylist = {&#xA;      resolution,&#xA;      outputFileName,&#xA;    };&#xA;    variantPlaylists.push(variantPlaylist);&#xA;    console.log(`HLS conversion done for ${resolution}`);&#xA;  }&#xA;  console.log(`HLS master m3u8 playlist generating`);&#xA;&#xA;  let masterPlaylist = variantPlaylists&#xA;    .map((variantPlaylist) => {&#xA;      const { resolution, outputFileName } = variantPlaylist;&#xA;      const bandwidth =&#xA;        resolution === "256x144"&#xA;          ? 264000&#xA;          : resolution === "640x360"&#xA;          ? 1024000&#xA;          : resolution === "1280x720"&#xA;          ? 3072000&#xA;          : 5500000;&#xA;      ``;&#xA;      return `#EXT-X-STREAM-INF:BANDWIDTH=${bandwidth},RESOLUTION=${resolution}\n${outputFileName}`;&#xA;    })&#xA;    .join("\n");&#xA;  masterPlaylist = `#EXTM3U\n` &#x2B; masterPlaylist;&#xA;&#xA;  const masterPlaylistFileName = `${fileName}_master.m3u8`;&#xA;&#xA;  const masterPlaylistPath = `${directoryPath}/${masterPlaylistFileName}`;&#xA;  fs.writeFileSync(masterPlaylistPath, masterPlaylist);&#xA;  console.log(`HLS master m3u8 playlist generated`);&#xA;  return directoryPath;&#xA;};&#xA;</void></any></any>

    &#xA;

    My console.log is :

    &#xA;

        Starting script&#xA;    HLS conversion starting for 256x144&#xA;    Error transcoding with FFmpeg: Error: Output format hls is not available&#xA;        at C:\Users\asifa\Desktop\Genius Grid\Transcode-service\node_modules\fluent-ffmpeg\lib\capabilities.js:589:21&#xA;        at nextTask (C:\Users\asifa\Desktop\Genius Grid\Transcode-service\node_modules\async\dist\async.js:5791:13)&#xA;        at next (C:\Users\asifa\Desktop\Genius Grid\Transcode-service\node_modules\async\dist\async.js:5799:13)&#xA;        at C:\Users\asifa\Desktop\Genius Grid\Transcode-service\node_modules\async\dist\async.js:329:20&#xA;        at C:\Users\asifa\Desktop\Genius Grid\Transcode-service\node_modules\fluent-ffmpeg\lib\capabilities.js:549:7&#xA;        at handleExit (C:\Users\asifa\Desktop\Genius Grid\Transcode-service\node_modules\fluent-ffmpeg\lib\processor.js:170:11)&#xA;        at ChildProcess.<anonymous> (C:\Users\asifa\Desktop\Genius Grid\Transcode-service\node_modules\fluent-ffmpeg\lib\processor.js:184:11)&#xA;        at ChildProcess.emit (node:events:518:28)&#xA;        at ChildProcess.emit (node:domain:488:12)&#xA;        at Process.ChildProcess._handle.onexit (node:internal/child_process:294:12) &#xA;</anonymous>

    &#xA;

    I am using Windows 11 and FFMpeg version 7.0. I repeatedly checked, using CMD commands, that my FFMpeg was installed correctly and confirmed the environment variables path, experimented with various FFMpeg versions, and tried with FFMpeg full build Chocolatey package.

    &#xA;

    In Command Line its working perfectly :

    &#xA;

    PS C:\Users\asifa\Desktop\test fmmpeg> ffmpeg -hide_banner -y -i .\SampleVideo_1280x720_30mb.mp4 -vf scale=w=640:h=360:force_original_aspect_ratio=decrease -c:a aac -b:v 800k -c:v h264 -b:a 128k -f hls -hls_time 14 -hls_list_size 0 -hls_segment_filename beach/480p_%03d.ts beach/480p.m3u8&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;.\SampleVideo_1280x720_30mb.mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2avc1mp41&#xA;    creation_time   : 1970-01-01T00:00:00.000000Z&#xA;    encoder         : Lavf53.24.2&#xA;  Duration: 00:02:50.86, start: 0.000000, bitrate: 1474 kb/s&#xA;  Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], 1086 kb/s, 25 fps, 25 tbr, 12800 tbn (default)&#xA;      Metadata:&#xA;        creation_time   : 1970-01-01T00:00:00.000000Z&#xA;        handler_name    : VideoHandler&#xA;        vendor_id       : [0][0][0][0]&#xA;  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 383 kb/s (default)&#xA;      Metadata:&#xA;        creation_time   : 1970-01-01T00:00:00.000000Z&#xA;        handler_name    : SoundHandler&#xA;        vendor_id       : [0][0][0][0]&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))&#xA;  Stream #0:1 -> #0:1 (aac (native) -> aac (native))&#xA;Press [q] to stop, [?] for help&#xA;[libx264 @ 000001ef1288ec00] using SAR=1/1&#xA;[libx264 @ 000001ef1288ec00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2&#xA;[libx264 @ 000001ef1288ec00] profile High, level 3.0, 4:2:0, 8-bit&#xA;[libx264 @ 000001ef1288ec00] 264 - core 164 r3190 7ed753b - H.264/MPEG-4 AVC codec - Copyleft 2003-2024 - 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=11 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=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=800 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00&#xA;Output #0, hls, to &#x27;beach/480p.m3u8&#x27;:&#xA;  Metadata:&#xA;    major_brand     : isom&#xA;    minor_version   : 512&#xA;    compatible_brands: isomiso2avc1mp41&#xA;    encoder         : Lavf61.1.100&#xA;  Stream #0:0(und): Video: h264, yuv420p(progressive), 640x360 [SAR 1:1 DAR 16:9], q=2-31, 800 kb/s, 25 fps, 90k tbn (default)&#xA;      Metadata:&#xA;        creation_time   : 1970-01-01T00:00:00.000000Z&#xA;        handler_name    : VideoHandler&#xA;        vendor_id       : [0][0][0][0]&#xA;        encoder         : Lavc61.3.100 libx264&#xA;      Side data:&#xA;        cpb: bitrate max/min/avg: 0/0/800000 buffer size: 0 vbv_delay: N/A&#xA;  Stream #0:1(und): Audio: aac (LC), 48000 Hz, 5.1, fltp, 128 kb/s (default)&#xA;      Metadata:&#xA;        creation_time   : 1970-01-01T00:00:00.000000Z&#xA;        handler_name    : SoundHandler&#xA;        vendor_id       : [0][0][0][0]&#xA;        encoder         : Lavc61.3.100 aac&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p_000.ts&#x27; for writing speed=15.5x&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p.m3u8.tmp&#x27; for writing&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p_001.ts&#x27; for writing speed=17.9x&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p.m3u8.tmp&#x27; for writing&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p_002.ts&#x27; for writing speed=17.3x&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p.m3u8.tmp&#x27; for writing&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p_003.ts&#x27; for writing speed=19.4x&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p.m3u8.tmp&#x27; for writing&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p_004.ts&#x27; for writing speed=19.3x&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p.m3u8.tmp&#x27; for writing&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p_005.ts&#x27; for writing speed=19.2x&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p.m3u8.tmp&#x27; for writing&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p_006.ts&#x27; for writing&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p.m3u8.tmp&#x27; for writing&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p_007.ts&#x27; for writing speed=19.4x&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p.m3u8.tmp&#x27; for writing&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p_008.ts&#x27; for writing speed=19.5x&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p.m3u8.tmp&#x27; for writing&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p_009.ts&#x27; for writing speed=19.5x&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p.m3u8.tmp&#x27; for writing&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p_010.ts&#x27; for writing speed=19.4x&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p.m3u8.tmp&#x27; for writing&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p_011.ts&#x27; for writing/A    =19.4x&#xA;[hls @ 000001ef12482040] Opening &#x27;beach/480p.m3u8.tmp&#x27; for writing&#xA;[out#0/hls @ 000001ef11d4e880] video:17094KiB audio:2680KiB subtitle:0KiB other streams:0KiB global headers:0KiB muxing overhead: unknown&#xA;frame= 4271 fps=485 q=-1.0 Lsize=N/A time=00:02:50.76 bitrate=N/A speed=19.4x&#xA;[libx264 @ 000001ef1288ec00] frame I:45    Avg QP:10.29  size: 60418&#xA;[libx264 @ 000001ef1288ec00] frame P:1914  Avg QP:14.53  size:  5582&#xA;[libx264 @ 000001ef1288ec00] frame B:2312  Avg QP:20.63  size:  1774&#xA;[libx264 @ 000001ef1288ec00] consecutive B-frames: 22.9% 11.9%  8.6% 56.6%&#xA;[libx264 @ 000001ef1288ec00] mb I  I16..4: 15.6% 32.1% 52.2%&#xA;[libx264 @ 000001ef1288ec00] mb P  I16..4:  0.3%  3.4%  1.2%  P16..4: 20.3% 10.0% 13.1%  0.0%  0.0%    skip:51.8%&#xA;[libx264 @ 000001ef1288ec00] mb B  I16..4:  0.1%  0.9%  0.4%  B16..8: 17.2%  5.6%  2.8%  direct: 2.0%  skip:71.0%  L0:41.5% L1:44.1% BI:14.4%&#xA;[libx264 @ 000001ef1288ec00] final ratefactor: 16.13&#xA;[libx264 @ 000001ef1288ec00] 8x8 transform intra:58.4% inter:51.7%&#xA;[libx264 @ 000001ef1288ec00] coded y,uvDC,uvAC intra: 86.7% 94.3% 78.8% inter: 12.6% 15.0% 4.5%&#xA;[libx264 @ 000001ef1288ec00] i16 v,h,dc,p: 17% 42% 14% 28%&#xA;[libx264 @ 000001ef1288ec00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 19% 11%  6%  7%  8%  8%  9%  9%&#xA;[libx264 @ 000001ef1288ec00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 18% 12%  6%  9%  9%  8%  8%  7%&#xA;[libx264 @ 000001ef1288ec00] i8c dc,h,v,p: 44% 24% 20% 12%&#xA;[libx264 @ 000001ef1288ec00] Weighted P-Frames: Y:0.0% UV:0.0%&#xA;[libx264 @ 000001ef1288ec00] ref P L0: 78.3%  9.7%  8.8%  3.2%&#xA;[libx264 @ 000001ef1288ec00] ref B L0: 92.5%  6.0%  1.5%&#xA;[libx264 @ 000001ef1288ec00] ref B L1: 97.1%  2.9%&#xA;[libx264 @ 000001ef1288ec00] kb/s:819.63&#xA;[aac @ 000001ef128f7c80] Qavg: 452.137&#xA;

    &#xA;

    When I use the .on(&#x27;start&#x27;, (cmdline) => console.log(cmdline))} code with the -f hls command, the error "Output format hls is not available" appears, as previously mentioned. But my Console.log looks like this if I run my code without using -f hls command :

    &#xA;

    Without -f hls command

    &#xA;

    await new Promise<void>((resolve, reject) => {&#xA;  ffmpeg(filePath)&#xA;    .outputOptions([&#xA;      `-c:v h264`,&#xA;      `-b:v ${videoBitrate}`,&#xA;      `-c:a aac`,&#xA;      `-b:a ${audioBitrate}`,&#xA;      `-vf scale=${resolution}`,&#xA; &#xA;      `-hls_time 10`,&#xA;      `-hls_list_size 0`,&#xA;      `-hls_segment_filename ${directoryPath}/${segmentFileName}`,&#xA;    ])&#xA;    .output(`${directoryPath}/${outputFileName}`)&#xA;    .on(&#x27;start&#x27;, (cmdline) => console.log(cmdline)) &#xA;    .on("end", () => resolve())&#xA;    .on("error", (err) => reject(err))&#xA;    .run();&#xA;});&#xA;</void>

    &#xA;

    Console.log is :

    &#xA;

    `Starting script&#xA;File saved successfully: C:\Users\asifa\Desktop\Genius Grid\Transcode-service\input\c9fcf43726e617a295b203d5acb7b81658b5f05f80eafc74cee21b053422fef1.mp4&#xA;HLS conversion starting for 256x144&#xA;ffmpeg -i C:\Users\asifa\Desktop\Genius Grid\Transcode-service\input\c9fcf43726e617a295b203d5acb7b81658b5f05f80eafc74cee21b053422fef1.mp4 -y -c:v h264 -b:v 200k -c:a aac -b:a 64k -vf scale=256x144 -hls_time 10 -hls_list_size 0 -hls_segment_filename C:\Users\asifa\Desktop\Genius Grid\Transcode-service\output\hls\c9fcf43726e617a295b203d5acb7b81658b5f05f80eafc74cee21b053422fef1/c9fcf43726e617a295b203d5acb7b81658b5f05f80eafc74cee21b053422fef1_256x144_%03d.ts C:\Users\asifa\Desktop\Genius Grid\Transcode-service\output\hls\c9fcf43726e617a295b203d5acb7b81658b5f05f80eafc74cee21b053422fef1/c9fcf43726e617a295b203d5acb7b81658b5f05f80eafc74cee21b053422fef1_256x144.m3u8&#xA;Error transcoding with FFmpeg: Error: ffmpeg exited with code 2880417800: Unrecognized option &#x27;hls_segment_filename C:\Users\asifa\Desktop\Genius Grid\Transcode-service\output\hls\c9fcf43726e617a295b203d5acb7b81658b5f05f80eafc74cee21b053422fef1/c9fcf43726e617a295b203d5acb7b81658b5f05f80eafc74cee21b053422fef1_256x144_%03d.ts&#x27;.&#xA;Error splitting the argument list: Option not found`&#xA;

    &#xA;

  • (C_UDP Socket Programming) How can I convert binary file to video format ?

    30 avril 2024, par user24723398

    I am practicing UDP socket programming. My code's functions are below.

    &#xA;

      &#xA;
    1. Connect Server-Client and send "hello" message each other (it is working).
    2. &#xA;

    3. Then Server is sending video file to client (problem).
    4. &#xA;

    &#xA;

    Transfer video file to client is working. But it is written in binary so I can't open the video.

    &#xA;

    So I try to use ffmpeg to convert the video, but it doesn't work.

    &#xA;

    Is there something wrong in my code ? How can I transfer a received file to a video file ?

    &#xA;

    My environment is MacOs.

    &#xA;

    Server.c (Server Code) :

    &#xA;

    #include &#xA;#include &#xA;#include &#xA;#include <arpa></arpa>inet.h>&#xA;#include &#xA;#include <sys></sys>socket.h>&#xA;&#xA;#define PORT 8888&#xA;#define BUF_SIZE 256&#xA;&#xA;int main(){&#xA;    int serv_sock;&#xA;    char message[BUF_SIZE];&#xA;    char buf[BUF_SIZE];&#xA;    int str_len;&#xA;    socklen_t clnt_adr_sz;&#xA;&#xA;    struct sockaddr_in serv_adr, clnt_adr;&#xA;    &#xA;    //create socket&#xA;    serv_sock=socket(PF_INET, SOCK_DGRAM, 0);&#xA;    if(serv_sock == -1){&#xA;        perror("socket() error");&#xA;        exit(1);&#xA;    }&#xA;    &#xA;    //socket address&#xA;    memset(&amp;serv_adr, 0, sizeof(serv_adr));&#xA;    serv_adr.sin_family=AF_INET;&#xA;    serv_adr.sin_addr.s_addr=htonl(INADDR_ANY);&#xA;    serv_adr.sin_port=htons(PORT);&#xA;    //binding socket&#xA;    if(bind(serv_sock, (struct sockaddr*)&amp;serv_adr, sizeof(serv_adr)) == -1){&#xA;        perror("bind() error");&#xA;        exit(1);&#xA;    }&#xA;    &#xA;    while(1){&#xA;        clnt_adr_sz=sizeof(clnt_adr);&#xA;        str_len=recvfrom(serv_sock, message, BUF_SIZE, 0, (struct sockaddr *)&amp;clnt_adr, &amp;clnt_adr_sz);&#xA;         if (str_len &lt; 0) {&#xA;            perror("recvfrom error");&#xA;            exit(1);&#xA;        }&#xA;    &#xA;        char hello_message[] = "hello i am server";&#xA;        if (sendto(serv_sock, hello_message, strlen(hello_message), 0, (struct sockaddr *)&amp;clnt_adr, clnt_adr_sz) &lt; 0) {&#xA;            perror("sendto error");&#xA;            exit(1);&#xA;        }&#xA;        &#xA;        //print message&#xA;        message[str_len] = &#x27;\0&#x27;;&#xA;        printf("client say: %s\n", message);&#xA;        &#xA;        char buf[BUF_SIZE];&#xA;        ssize_t bytes_read;&#xA;        // sending viedo file&#xA;        printf("sending video file...\n");&#xA;        size_t fsize;&#xA;    &#xA;        //video file&#xA;        FILE *file;&#xA;        char *filename = "video.mp4";&#xA;        // open video file&#xA;        file = fopen(filename, "rb");&#xA;        if (file == NULL) {&#xA;            perror("File opening failed");&#xA;            exit(EXIT_FAILURE);&#xA;        }&#xA;        //calculate video file memory&#xA;        fseek(file, 0, SEEK_END);&#xA;        fsize = ftell(file);&#xA;        fseek(file,0,SEEK_SET);&#xA;    &#xA;        size_t size = htonl(fsize);&#xA;        int nsize =0;&#xA;        &#xA;        while(nsize!=fsize){&#xA;            int fpsize = fread(buf,1, BUF_SIZE, file);&#xA;            nsize &#x2B;= fpsize;&#xA;            if (sendto(serv_sock, &amp;size, sizeof(size), 0, (struct sockaddr *)&amp;clnt_adr, clnt_adr_sz) &lt; 0) {&#xA;                perror("sendto");&#xA;                exit(EXIT_FAILURE);    &#xA;            }&#xA;            fclose(file);&#xA;            /*&#xA;            while ((bytes_read = fread(buf, 1, BUF_SIZE, file)) > 0) {&#xA;                if (sendto(serv_sock, buf, bytes_read, 0,&#xA;                       (struct sockaddr *)&amp;clnt_adr, clnt_adr_sz) &lt; 0) {&#xA;                    perror("sendto");&#xA;                    exit(EXIT_FAILURE);&#xA;                }       &#xA;            }&#xA;            */&#xA;        }        &#xA;    }&#xA;    close(serv_sock);&#xA;    return 0;&#xA;}&#xA;

    &#xA;

    Client.c (Client code)

    &#xA;

    #include &#xA;#include &#xA;#include &#xA;#include <arpa></arpa>inet.h>&#xA;#include &#xA;#include <sys></sys>socket.h>&#xA;&#xA;#define BUFSIZE 256&#xA;#define PORT 8888&#xA;&#xA;int main(){&#xA;    int sock;&#xA;    char message[BUFSIZE];&#xA;    int str_len;&#xA;    socklen_t adr_sz;&#xA;&#xA;    struct sockaddr_in serv_addr, client_addr;   &#xA;    &#xA;    sock = socket(PF_INET, SOCK_DGRAM, 0);&#xA;    if(sock == -1){&#xA;        printf("socket() error\n");&#xA;        exit(1);&#xA;    }&#xA;&#xA;    memset(&amp;serv_addr, 0, sizeof(serv_addr));&#xA;    serv_addr.sin_family = AF_INET;&#xA;    serv_addr.sin_addr.s_addr = inet_addr("127.0.0.1");&#xA;    serv_addr.sin_port = htons(PORT);&#xA;&#xA;    char hello_message[] = "hello i am client";&#xA;    sendto(sock, hello_message, strlen(hello_message), 0, (struct sockaddr*)&amp;serv_addr, sizeof(serv_addr));&#xA;    adr_sz = sizeof(client_addr);&#xA;    str_len=recvfrom(sock,message,BUFSIZE,0,(struct sockaddr*)&amp;client_addr,&amp;adr_sz);&#xA;   &#xA;    message[str_len] = &#x27;\0&#x27;;&#xA;    printf("client say: %s\n", message);&#xA;    &#xA;    /*&#xA;    char buf[BUFSIZE];&#xA;    ssize_t bytes_received;&#xA;    socklen_t serv_len = sizeof(serv_addr);&#xA;    while ((bytes_received = recvfrom(sock, buf, BUFSIZE, 0,&#xA;                                      (struct sockaddr *)&amp;serv_addr, &amp;serv_len)) > 0) {&#xA;        fwrite(buf, 1, bytes_received, file);&#xA;    }&#xA;    */&#xA;     &#xA;    FILE *file = fopen("received_test.mp4", "wb");&#xA;&#xA;    int nbyte = BUFSIZE;&#xA;    while(nbyte>= BUFSIZE){&#xA;        nbyte = recvfrom(sock, message, BUFSIZE, 0, (struct sockaddr*)&amp;serv_addr, &amp;adr_sz);&#xA;        fwrite(message, sizeof(char), nbyte, file);&#xA;    }&#xA;&#xA;    if (file == NULL) {&#xA;        perror("File opening failed");&#xA;        exit(EXIT_FAILURE);&#xA;    }&#xA;&#xA;    fclose(file);&#xA;    close(sock);&#xA;    printf("File received successfully\n");&#xA;    &#xA;    return 0;&#xA;}&#xA;

    &#xA;

    I try to convert the binary file to an .mp4 file using ffmpeg&#xA;but it doesn't work :

    &#xA;

    ffmpeg -i received_test.mp4 output.mp4&#xA;ffmpeg version 7.0 Copyright (c) 2000-2024 the FFmpeg developers&#xA;  built with Apple clang version 15.0.0 (clang-1500.3.9.4)&#xA;  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/7.0 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags=&#x27;-Wl,-ld_classic&#x27; --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopenvino --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon&#xA;  libavutil      59.  8.100 / 59.  8.100&#xA;  libavcodec     61.  3.100 / 61.  3.100&#xA;  libavformat    61.  1.100 / 61.  1.100&#xA;  libavdevice    61.  1.100 / 61.  1.100&#xA;  libavfilter    10.  1.100 / 10.  1.100&#xA;  libswscale      8.  1.100 /  8.  1.100&#xA;  libswresample   5.  1.100 /  5.  1.100&#xA;  libpostproc    58.  1.100 / 58.  1.100&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x12a62bdb0] Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible!&#xA;[mov,mp4,m4a,3gp,3g2,mj2 @ 0x12a62bdb0] moov atom not found&#xA;[in#0 @ 0x12b0043c0] Error opening input: Invalid data found when processing input&#xA;Error opening input file received_test.mp4.&#xA;Error opening input files: Invalid data found when processing input&#xA;

    &#xA;