Recherche avancée

Médias (1)

Mot : - Tags -/wave

Autres articles (67)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (10257)

  • Segments not loading in HLS Stream encoded with FFMPEG

    9 novembre 2023, par myfoxit

    I'm currently facing a significant issue with my transcoding pipeline. Some video files produce a corrupted m3u8 playlist, wherein a few segments load but then the process halts. Even jumping to different segments in the video player doesn't resolve the issue. However, the file in question works fine when I use third-party transcoding services that utilize ffmpeg in the background, so the problem is definitely with my FFMPEG code.

    


    To diagnose the issue, I've tried the following steps :

    


      

    • Simplifying the FFMPEG command.
    • 


    • Testing across different browsers, but the problem persists in every browser.
    • 


    • Using various video players (It works with VLC, Bitmovin, Video.js) but not with Plyr, which I usually use. This could be because they ignore the error or are less sensitive to errors.
    • 


    • My files are hosted on AWS S3, but I also tried streaming them via the Next.js public folder and a custom web server, so the issue is not related to hosting.
    • 


    • Ruled out CORS as the issue.
    • 


    • Attempted to detect errors using ffprobe, but found no results.
    • 


    • Modified the bitrate in the playlist.
    • 


    • Changed the viewing device.
    • 


    • Altered the segment length, but the issue persists : with 10s segments, it's segment 2 that causes the problem ; with 5s segments, then segment 4.
    • 


    • No error output is visible in ffmpeg, even when using verbose mode.
    • 


    


    mediastreamvalidator on Apple prints out error with provided bitrate and used bitrate but changing that also did not help.

    


    HLS Analyzer shows a buffer stalled error.

    


    const fs = require('fs');
const path = require('path');
const { v4: uuidv4 } = require('uuid');
require('dotenv').config();
const { processVideo } = require("./ffmpegHandler");


const VIDEO_PATH = process.env.VIDEO_PATH; 
const VIDEO_STATE = JSON.parse(process.env.VIDEO_STATE);
const VIDEO_SIZE = JSON.parse(process.env.VIDEO_SIZE);
const VIDEO_DURATION = process.env.VIDEO_DURATION;

const OUTPUT_DIRECTORY = '/tmp/output';

console.log("Video Path: " + VIDEO_PATH)
console.log("Video State: " + VIDEO_STATE)
console.log("Video Size: " + VIDEO_SIZE)
console.log("Video Duration: " + VIDEO_DURATION)

async function processLocalVideo(localPath) {
    const uniqueFolderName = uuidv4();  
    const localOutputDirectory = path.join(OUTPUT_DIRECTORY, uniqueFolderName);

    // Ensure the output directory exists
    if (!fs.existsSync(localOutputDirectory)) {
        fs.mkdirSync(localOutputDirectory, { recursive: true });
    }

    // Process the video locally
    processVideo(localPath, VIDEO_STATE, VIDEO_SIZE, VIDEO_DURATION, (err, message) => {
        if (err) {
            console.error('Error processing video:', err);
            return;
        }
        console.log('Video processing complete. HLS files are located at:', localOutputDirectory);
    });
}

// Start the processing
processLocalVideo(VIDEO_PATH).catch((error) => {
    console.error('An error occurred during video processing:', error);
});




    


    const {exec} = require("child_process");
const ffmpegPath = require("ffmpeg-static");
const fs = require("fs");
const path = require("path");
const {spawn} = require("child_process");
const {generateArgs} = require("./generateArgs");
const {getResolutions, printDirectoryStructure, createMasterPlaylistContent} = require("./utility");


const OUTPUT_DIR = '/tmp/output';


function processVideo(filePath, imageState, size, duration, callback) {


    if (!fs.existsSync(OUTPUT_DIR)) {
        fs.mkdirSync(OUTPUT_DIR, {recursive: true});
    }

    const resolutions = getResolutions(size);
    const outputHLSPath = path.join(OUTPUT_DIR, 'dest.m3u8');
    const segmentPattern = 'segment_%03d.ts';
    const outputSegmentPath = path.join(OUTPUT_DIR, segmentPattern);

    const ffmpegPromises = resolutions.map(resolution => {
        return new Promise((resolve, reject) => {
            const scaleFilter = `scale=w=${resolution.width}:h=${resolution.height}`;
            const outputHLSPath = path.join(OUTPUT_DIR, resolution.label, 'dest.m3u8');
            const segmentPattern = `segment_%03d.ts`;
            const outputSegmentPath = path.join(OUTPUT_DIR, resolution.label, segmentPattern);

            // Ensure resolution-specific directory exists
            if (!fs.existsSync(path.join(OUTPUT_DIR, resolution.label))) {
                fs.mkdirSync(path.join(OUTPUT_DIR, resolution.label), {recursive: true});
            }

            const args = generateArgs(filePath, imageState, size, duration, resolution);


            const resolutionArgs = [
                ...args,
                '-hls_segment_filename', outputSegmentPath,
                outputHLSPath
            ];

            console.log(resolutionArgs)

            const command = `${ffmpegPath} ${resolutionArgs.join(" ")}`;


            const ffmpeg = spawn(ffmpegPath, resolutionArgs);


            ffmpeg.on('error', (error) => {
                console.error(`Error with FFmpeg process: ${error.message}`);
                reject(error);
            });

            ffmpeg.stderr.on('data', (data) => {
                console.error(`FFmpeg stderr: ${data}`);
            });

            ffmpeg.on('close', (code) => {
                if (code !== 0) {
                    reject(new Error(`FFmpeg process exited with code ${code}`));
                } else {
                    resolve();
                }
            });
        });
    });


    Promise.all(ffmpegPromises)
        .then(() => {
            const masterPlaylistContent = createMasterPlaylistContent(resolutions, OUTPUT_DIR);
            const masterPlaylistPath = path.join(OUTPUT_DIR, 'master.m3u8');
            fs.writeFileSync(masterPlaylistPath, masterPlaylistContent);

            printDirectoryStructure('/tmp/output', (err) => {
                if (err) {
                    console.error(err);
                    callback(err);
                } else {
                    console.log('Directory structure printed successfully.');
                    callback(null, 'All files processed successfully!');
                }
            });
        })
        .catch((error) => {
            callback(error);
        });
}


module.exports = {
    processVideo,
};






    


    
const {getColorMatrixFromColorMatrices, isNumber} = require("./utility");

function generateArgs(filePath, imageState, size, duration, resolution){
    const args = [];
    const filters = [];

    args.push("-i", filePath);


    const {
        flipX,
        flipY,
        rotation,
        crop,
        trim,
        gamma,
        colorMatrix,
        convolutionMatrix,
    } = imageState;

    console.log(crop);

    // 1. Flip
    if (flipX || flipY) {
        flipX && filters.push(`hflip`);
        flipY && filters.push(`vflip`);
    }

    // 2. Rotate
    if (rotation) {
        const width =
            Math.abs(size.width * Math.sin(rotation)) +
            Math.abs(size.height * Math.cos(rotation));

        const height =
            Math.abs(size.width * Math.cos(rotation)) +
            Math.abs(size.height * Math.sin(rotation));

        filters.push(
            `rotate='${rotation}:ow=${Math.floor(width)}:oh=${Math.floor(height)}'`
        );
    }

    // 3. Crop
    if (
        !(
            crop.x === 0 &&
            crop.y === 0 &&
            crop.width === size.width &&
            crop.height === size.height
        )
    ) {
        filters.push(`crop=${crop.width}:${crop.height}:${crop.x}:${crop.y}`);
    }


    // 5. Convolution Matrix
    if (convolutionMatrix && convolutionMatrix.clarity) {
        filters.push(`convolution='${convolutionMatrix.clarity.join(" ")}'`);
    }

    // 6. Gamma
    if (gamma > 0) {
        filters.push(`eq=gamma=${gamma}:gamma_weight=0.85`);
    }

    // 7. Color Matrix
    const colorMatrices = Object.values(colorMatrix || {}).filter(Boolean);
    if (colorMatrices.length) {
        // See helper section below for the getColorMatrixFromColorMatrices function definition
        const colorMatrix = getColorMatrixFromColorMatrices(colorMatrices);
        const skip = [4, 9, 14, 19];
        const cl = colorMatrix;
        const ccm = colorMatrix.filter((v, i) => !skip.includes(i));
        const [ro, go, bo] = [cl[4] + cl[3], cl[9] + cl[8], cl[14] + cl[13]];
        filters.push(
            `colorchannelmixer=${ccm.join(":")}`,
            `lutrgb=r=val+(${ro * 255}):g=val+(${go * 255}):b=val+(${bo * 255})`
        );
    }


    if (resolution) {
        const scaleFilter = `scale=w=${resolution.width}:h=${resolution.height}`;
        filters.push(scaleFilter);
    }


    // 8. Trim
    if (trim) {
        const inputRanges = (
            Array.isArray(trim) && isNumber(trim[0]) ? [trim] : trim
        )
            .map((range, index) => {
                const from = range[0] * duration;
                const to = range[1] * duration;
                const v = `[0:v]trim=start=${from}:end=${to},setpts=PTS-STARTPTS${filters
                    .map((filter) => "," + filter)
                    .join("")}[${index}v];`;
                const a = `[0:a]atrim=start=${from}:end=${to},asetpts=PTS-STARTPTS[${index}a];`;
                return v + a;
            })
            .join("");


        filters.length = 0;

        const inputRangesKeys = trim
            .map((_, index) => `[${index}v][${index}a]`)
            .join("");

        const concatOutput = `${inputRangesKeys}concat=n=${trim.length}:v=1:a=1[outv][outa]`;

        args.push("-filter_complex", `${inputRanges}${concatOutput}`);
        args.push("-map", "[outv]", "-map", "[outa]");
    } else {
        filters.length && args.push("-filter_complex", `${filters.join(",")}`);
    }


    // Add output file
    args.push(
        "-codec:v",
        "libx264",
        "-crf",
        "21",
        "-preset",
        "veryfast",
        "-g",
        "30",
        "-sc_threshold",
        "0",
        "-hls_time",
        "10",
        "-hls_list_size",
        "0",

    );

    return args
}

module.exports = {
    generateArgs,
};





    


    const {exec} = require("child_process");


function isNumber(value) {
    return typeof value === "number" && !isNaN(value);
}

function getColorMatrixFromColorMatrices(colorMatrices) {
    return colorMatrices.length
        ? colorMatrices.reduce(
            (previous, current) => dotColorMatrix([...previous], current),
            colorMatrices.shift()
        )
        : [];
}

function dotColorMatrix(a, b) {
    const res = new Array(20);

    // R
    res[0] = a[0] * b[0] + a[1] * b[5] + a[2] * b[10] + a[3] * b[15];
    res[1] = a[0] * b[1] + a[1] * b[6] + a[2] * b[11] + a[3] * b[16];
    res[2] = a[0] * b[2] + a[1] * b[7] + a[2] * b[12] + a[3] * b[17];
    res[3] = a[0] * b[3] + a[1] * b[8] + a[2] * b[13] + a[3] * b[18];
    res[4] = a[0] * b[4] + a[1] * b[9] + a[2] * b[14] + a[3] * b[19] + a[4];

    // G
    res[5] = a[5] * b[0] + a[6] * b[5] + a[7] * b[10] + a[8] * b[15];
    res[6] = a[5] * b[1] + a[6] * b[6] + a[7] * b[11] + a[8] * b[16];
    res[7] = a[5] * b[2] + a[6] * b[7] + a[7] * b[12] + a[8] * b[17];
    res[8] = a[5] * b[3] + a[6] * b[8] + a[7] * b[13] + a[8] * b[18];
    res[9] = a[5] * b[4] + a[6] * b[9] + a[7] * b[14] + a[8] * b[19] + a[9];

    // B
    res[10] = a[10] * b[0] + a[11] * b[5] + a[12] * b[10] + a[13] * b[15];
    res[11] = a[10] * b[1] + a[11] * b[6] + a[12] * b[11] + a[13] * b[16];
    res[12] = a[10] * b[2] + a[11] * b[7] + a[12] * b[12] + a[13] * b[17];
    res[13] = a[10] * b[3] + a[11] * b[8] + a[12] * b[13] + a[13] * b[18];
    res[14] = a[10] * b[4] + a[11] * b[9] + a[12] * b[14] + a[13] * b[19] + a[14];

    // A
    res[15] = a[15] * b[0] + a[16] * b[5] + a[17] * b[10] + a[18] * b[15];
    res[16] = a[15] * b[1] + a[16] * b[6] + a[17] * b[11] + a[18] * b[16];
    res[17] = a[15] * b[2] + a[16] * b[7] + a[17] * b[12] + a[18] * b[17];
    res[18] = a[15] * b[3] + a[16] * b[8] + a[17] * b[13] + a[18] * b[18];
    res[19] = a[15] * b[4] + a[16] * b[9] + a[17] * b[14] + a[18] * b[19] + a[19];

    return res;
}

function getResolutions(videoSize) {
    // Define the resolutions
    const resolutions = [
        {width: 1280, height: 720, label: "720p", bandwidth: "1400000"},
        {width: 854, height: 480, label: "480p", bandwidth: "800000"},
        {width: 426, height: 240, label: "240p", bandwidth: "600000"}
    ];

    // Filter out resolutions that are larger than the video's original size
    return resolutions.filter(res => res.width <= videoSize.width);
}


function printDirectoryStructure(directory, callback) {
    exec(`find '${directory}' -print`, (error, stdout, stderr) => {
        if (error) {
            console.error(`exec error: ${error}`);
            return callback(error);
        }
        if (stderr) {
            console.error(`stderr: ${stderr}`);
            return callback(stderr);
        }
        console.log(`Directory structure of ${directory}:\n${stdout}`);
        callback(null);
    });
}


function createMasterPlaylistContent(resolutions, outputDir) {
    let content = '#EXTM3U\n#EXT-X-VERSION:3\n';
    resolutions.forEach((resolution) => {
        content += `#EXT-X-STREAM-INF:BANDWIDTH=${resolution.bandwidth},RESOLUTION=${resolution.width}x${resolution.height}\n`;
        content += `${resolution.label}/dest.m3u8\n`;
    });
    return content;
}


function getKeyFromUrl(url) {
    const urlParts = new URL(url);
    return urlParts.pathname.substring(1);
}


module.exports = {
    getResolutions,
    getColorMatrixFromColorMatrices,
    isNumber,
    printDirectoryStructure,
    createMasterPlaylistContent,
    getKeyFromUrl
};



    


  • Conversion Rate Optimisation Statistics for 2024 and Beyond

    21 novembre 2023, par Erin — Analytics Tips

    Driving traffic to your website is only half the battle. The real challenge — once you’ve used a web analytics solution to understand how users behave — is turning more of those visitors into customers.

    That doesn’t happen by accident. You need to employ conversion rate optimisation strategies and tools to see even a small lift in conversion rates. The good news is that it doesn’t take much to see massive results. Raising your conversion rate from 1% to 3% can triple your revenue. 

    In even better news, you don’t have to guess at the best ways to improve your conversion rate. We’ve done the hard work and collected the most recent and relevant conversion rate optimisation statistics to help you. 

    General conversion rate optimisation statistics

    It appears the popularity of conversion rate optimisation is soaring. According to data collected by Google Trends, there were more people searching for the term “conversion rate optimization” in September 2023 than ever before. 

    As you can see from the chart below, the term’s popularity is on a clear upward trajectory, meaning even more people could be searching for it in the near future. (Source)

    More people searching for conversion rate optimization than ever before according to Google Trends data

    Do you want to know what the average landing page conversion rate is ? According to research by WordStream, the average website conversion rate across all industries is 2.35%

    That doesn’t paint the whole picture, however. Better-performing websites have significantly higher conversion rates. The top 25% of websites across all industries convert at a rate of 5.31% or higher. (Source)

    Let’s break things down by industry now. The Unbounce Conversion Benchmark Report offers a detailed analysis of how landing pages convert across various industries.

    First, we have the Finance and Insurance industry, which boasts a conversion rate of 15.6%. 

    On the other end, agencies appears to be one of the worst-performing. Agencies’ landing pages convert at a rate of 8.8%. (Source)

    The average landing page conversion rates across industries

    What about the size of the conversion rate optimisation industry ? Given the growth in popularity of the term in Google, surely the industry is experiencing growth, right ?

    You’d be correct in that assumption. The conversion rate optimisation software market was valued at $771.2 million in 2018 and is projected to reach $1.932 billion by 2026 — a compound annual growth rate (CAGR) of 9.6%.

    Statistics on the importance of conversion rate optimisation

    If you’re reading this article, you probably think conversion rate optimisation is pretty important. But do you know its importance and where it ranks in your competitors’ priorities ? Read on to find out. 

    Bounce rate — the number of people who leave your website without visiting another page or taking action — is the scourge of conversion rate optimisation efforts. Every time someone bounces from your site, you lose the chance to convert them.

    The questions, then, are : how often do people bounce on average and how does your bounce rate compare ? 

    Siege Media analysed over 1.3 billion sessions from a range of traffic sources, including 700 million bounces, to calculate an average bounce rate of 50.9%. (Source)

    The average bounce rate is 50.9%

    Bounce rates vary massively from website to website and industry to industry, however. Siege Media’s study unveils an array of average bounce rates across industries :

    • Travel – 82.58%
    • B2B – 65.17%
    • Lifestyle – 64.26%
    • Business and Finance – 63.51%
    • Healthcare – 59.50%
    • eCommerce – 54.54%
    • Insurance – 45.96%
    • Real Estate – 40.78%

    It won’t come as much of a surprise to learn that marketers are determined to reduce bounce rates and improve lead conversion. Today’s marketers are highly performance-based. When asked about their priorities for the coming year, 79% of marketers said their priority was generating quality qualified leads — the most popular answer in the survey. (Source)

    Just because it is a priority for marketers doesn’t mean that everyone has their stuff together. If you have a conversion rate optimisation process in place, you’re in the minority. According to research by HubSpot, less than one in five marketers (17%) use landing page A/B tests to improve their conversion rates. (Source)

    When it comes to personalisation strategies – a common and effective tool to increase conversion rates — the picture isn’t any rosier. Research by Salesforce found just over one-quarter of markets are confident their organisation has a successful strategy for personalisation. (Source)

    Conversion rate optimisation tactics statistics

    There are hundreds of ways to improve your website’s conversion rates. From changing the color of buttons to the structure of your landing page to your entire conversion funnel, in this section, we’ll look at the most important statistics you need to know when choosing tactics and building your own CRO experiments. 

    If you are looking for the best method to convert visitors, then email lead generation forms are the way to go, according to HubSpot. This inoffensive and low-barrier data collection method boasts a 15% conversion rate, according to the marketing automation company’s research. (Source)

    Where possible, make your call-to-actions personalised. Marketing personalisation, whether through behavioral segmentation or another strategy, is an incredibly powerful way of showing users that you care about their specific needs. It’s no great surprise, then, that HubSpot found personalised calls-to-actions perform a whopping 202% better than basic CTAs. (Source)

    If you want to boost conversion rates, then it’s just as important to focus on quantity as well as quality. Yes, a great-looking, well-written landing page will go a long way to improving your conversion rate, but having a dozen of these pages will do even more. 

    Research by HubSpot found companies see a 55% increase in leads when they increase the number of landing pages from 10 to 15. What’s more, companies with over 40 landing pages increase conversion by more than 500%. (Source)

    Companies with more than 40 landing pages increase conversions by over 500%

    User-generated content (UGC) should also be high on your priority list to boost conversion rates. Several statistics show how powerful, impactful and persuasive social proof like user reviews can be. 

    Research shows that visitors who scroll to the point where they encounter user-generated content increase the likelihood they convert by a staggering 102.4%. (Source)

    Other trust signs can be just as impactful. Research by Trustpilot found that the following four trust signals make consumers more likely to make a purchase when shown on a product page :

    • Positive star rating and reviews (85% more likely to make a purchase)
    • Positive star rating (78%)
    • Positive customer testimonials (82%)
    • Approved or authorised seller badge (76%)

    (Source)

    Showing ratings and reviews has also increased conversion rates by 38% on home appliances and electronics stores. (Source)

    And no wonder, given that consumers are more likely to buy from brands they trust than brands they love, according to the 2021 Edelman Trust Barometer Special Report. (Source

    A lack of trust is also one of the top four reasons consumers abandon their shopping cart at checkout. (Source

    Traffic source conversion rate statistics

    What type of traffic works the best when it comes to conversions, or how often you should be signing up users to your mailing list ? Let’s look at the stats to find out. 

    Email opt-ins are one of the most popular methods for collecting customer information — and an area where digital marketers spend a lot of time and effort when it comes to conversion rate optimisation. So, what is the average conversion rate of an email opt-in box ?

    According to research by Sumo — based on 3.2 billion users who have seen their opt-in boxes — the average email opt-in rate is 1.95%. (Source)

    Search advertising is an effective way of driving website traffic, but how often do those users click on these ads ?

    WordStream’s research puts the average conversion of search advertising for all industries at 6.11%. (Source)

    The arts and entertainment industry enjoys the highest clickthrough rates (11.78%), followed by sports and recreation (10.53%) and travel (10.03%). Legal services and the home improvement industry have the lowest clickthrough rates at 4.76% and 4.8%, respectively.

    The average clickthrough rate of search advertising for each industry
    (Source)

    If you’re spending money on Google ads, then you’d better hope a significant amount of users convert after clicking them. 

    Unfortunately, conversion rates from Google ads decreased year-on-year for most industries in 2023, according to research by WordStream — in some cases, those decreases were significant. The only two industries that didn’t see a decrease in conversion rates were beauty and personal care and education and instruction. (Source)

    The average conversion rate for search ads across all industries is 7.04%. The animal and pet niche has the highest conversion rate (13.41%), while apparel, fashion and jewelry have the lowest conversion rate (1.57%). (Source)

    What about other forms of traffic ? Well, there’s good reason to try running interstitial ads on smartphone apps if you aren’t already. Ads on the iOS app see a 14.3 percent conversion rate on average. (Source)

    E-commerce conversion rate optimisation statistics (400 words)

    Conversion rate optimisation can be the difference between a store that sets new annual sales records and one struggling to get by. 

    The good news is that the conversion rate among US shoppers was the highest it’s ever been in 2021, with users converting at 2.6%. (Source)

    If you have a Shopify store, then you may find conversion rates a little lower. A survey by Littledata found the average conversion rate for Shopify was 1.4% in September 2022. (Source)

    What about specific e-commerce categories ? According to data provided by Dynamic Yield, the consumer goods category converted at the highest rate in September 2023 (4.22%), a spike of 0.34% from August. 

    Generally, the food and beverage niche boasts the highest conversion rate (4.87%), and the home and furniture niche has the lowest conversion rate (1.44%). (Source)

    If you’re serious about driving sales, don’t focus on mobile devices at the expense of consumers who shop on desktop devices. The conversion rate among US shoppers tends to be higher for desktop users than for mobile users. 

    The conversion rate among US online shoppers is generally higher for desktop than

    In the second quarter of 2022, for instance, desktop shoppers converted at a rate of 3% on average compared to smartphone users who converted at an average rate of 2%. (Source)

    Increase your conversions with Matomo

    Conversion rate optimisation can help you grow your subscriber list, build your customer base and increase your revenue. Now, it’s time to put what you’ve learned into practice.

    Use the advice above to guide your experiments and track everything with Matomo. Achieve unparalleled data accuracy while harnessing an all-in-one solution packed with essential conversion optimisation features, including Heatmaps, Session Recordings and A/B Testing. Matomo makes it easier than ever to analyse conversion-focused experiments.

    Get more from your conversion rate optimisations by trying Matomo free for 21 days. No credit card required.

  • FFMPEG avcodec_decode_video2 got_picture_ptr Differing Behaviour

    13 novembre 2015, par user3584691

    Am Currently updating our FFMPEG library usage from a pretty old version(0.5) to 2.8. As part of the change, had replaced avcodec_decode_video to avcodec_decode_video2. However, am noticing quite a difference in the way avcodec_decode_video2 functions compared to the old avcodec_decode_video. For the same packet (same data), ’avcodec_decode_video2’ gives got_picture_ptr as zeo whereas the old ’avcodec_decode_video’ was giving a non-zero value. In the example that am describing here, am decoding an FLV file with VideoCodec:H264-MPEG-4 AVC (part 10) and AudioCodec:MPEG AAC Audio (Am attaching a part of the Hex Version of the FLV file in FLV_Sample.Hex FLV_Sample_Hex). The original flv file is too large). For the first AVPacket (obtained from av_read_frame), got_picture_ptr from ’avcodec_decode_video2’ is zero but old ’avcodec_decode_video’ gives 296(Am attaching the entire AVPacket data obtained and the outputs obtained from the two functions in the file FFMPEG_Decoding_Packet_Info.txt FFMPEG_Decoding_Packet_Info). Continuing on, the new ’avcodec_decode_video2’ keeps giving ’Zero’ till the 23rd Packet where it gives 1. So its not like avcodec_decode_video2 keeps giving zero. My main dilemma is that am not sure if this difference in behaviour is due to the changes in ’avcodec_decode_video2’ or any errors that I have made in using the Decoder. I have put a snippet of the code that am using to use the decoder below. Any suggestions will be helpful.

    AVFormatContext *pFormatCtx;
    AVCodecContext  *pCodecCtx;
    AVCodec         *pCodec;
    AVFrame         *pFrameRGB;

    #if FFMPEG_2_8
    avformat_open_input(&pFormatCtx, strFileName, NULL, NULL) ;
    #else
    av_open_input_file(&pFormatCtx, strFileName, NULL, 0, NULL) ;
    #endif //FFMPEG_2_8

    size_t videoStream=pFormatCtx->nb_streams;
    bool streamFound = false ;
    for(size_t i=0; inb_streams; i++)
    {
       #if FFMPEG_2_8
       if(pFormatCtx->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO)
       #else
       if(pFormatCtx->streams[i]->codec->codec_type==CODEC_TYPE_VIDEO)
       #endif //FFMPEG_2_8
       {
           videoStream = i;
           streamFound = true ;
           break;
       }
    }

    if(streamFound)
    {
       pCodecCtx=pFormatCtx->streams[videoStream]->codec;

       // Find the decoder for the video stream
       pCodec=avcodec_find_decoder(pCodecCtx->codec_id);
       if(pCodec==NULL)
           return false; // Codec not found

       // Open codec
       #if FFMPEG_2_8
       if(avcodec_open2(pCodecCtx, pCodec,NULL)<0)
       #else
       if(avcodec_open(pCodecCtx, pCodec)<0)
       #endif //FFMPEG_2_8
       {
           return false; // Could not open codec
       }

       #if FFMPEG_2_8
       pFrameRGB=av_frame_alloc() ;
       #else
       pFrameRGB=avcodec_alloc_frame();
       #endif //FFMPEG_2_8
       if(pFrameRGB==NULL)
               return false; //No Memory

       while(true)
       {
           AVPacket packet ;

           if (av_read_frame(pFormatCtx, &packet) < 0)
           {
               break ;
           }


           int frameFinished;
           if (packet.stream_index == videoStream)
           {
               #if FFMPEG_2_8
               avcodec_decode_video2(pCodecCtx, pFrameRGB, &frameFinished, &packet);
               #else
               avcodec_decode_video(pCodecCtx, pFrameRGB, &frameFinished, packet.data, packet.size);
               #endif //FFMPEG_2_8
           }

           if(frameFinished !=0)
           {
               break ;
           }
       }
    }