Recherche avancée

Médias (1)

Mot : - Tags -/ticket

Autres articles (108)

Sur d’autres sites (16123)

  • Play mpeg-2 file with 608/708 embedded captions out Decklink SDI

    29 octobre 2022, par asperi

    I have built ffmpeg with decklink support, it plays my mpg file fine out the SDI but not seeing any captions on my works broadcast monitor (JVC DT-V17G1Z). This monitor shows captions on SDI from my Mojito card but trying to get it to work with a BlackMagic 4k extreme. The mpg file has embedded 608 and 708 captions. Using the to play-

    


    ffmpeg -i C:\video\RD2838_720p.mpg -f decklink -pix_fmt uyvy422 "DeckLink 4K Extreme"


    


    MediaInfo on captinos :

    


    Text #1


    


    ID : 4096 (0x1000)-CC1
Menu ID : 1 (0x1)
Format : EIA-608
Muxing mode : A/53 / DTVCC Transport
Muxing mode, more info : Muxed in Video #1
Duration : 28 min 30 s
Bit rate mode : Constant
Stream size : 0.00 Byte (0%)
Language : English
CaptionServiceName : CC1

    


    Text #2
ID : 4096 (0x1000)-1
Menu ID : 1 (0x1)
Format : EIA-708
Muxing mode : A/53 / DTVCC Transport
Muxing mode, more info : Muxed in Video #1
Duration : 28 min 30 s
Bit rate mode : Constant
Stream size : 0.00 Byte (0%)
Language : English

    


    How do I get the Decklink 4k to pass the captions ? Thanks !

    


  • What is the algorithm to acheive audio decoding in C through ffmpeg ?

    16 août 2018, par Nani

    I want to decode the MP3 audio file, I want to know the algorithm in terms of C language API’s. I have gone through dranger tutorials. But the API’s they used are deprecated now. Could anyone tell me what are the API’s I need to follow one by one ?

  • How to maximize ffmpeg crop and overlay thousand block in same time ?

    22 juin 2022, par yuno saga

    I try to encrypt a frame of video to random of 16x16 block. so the result will be like artifact video. but exactly it can be decode back. only the creation that know the decode algorithm. but my problem is ffmpeg encode so slow. 3 minutes video, 854x480 (480p) https://www.youtube.com/watch?v=dyRsYk0LyA8. this example result frame that have been filter https://i.ibb.co/0nvLzkK/output-9.jpg. each frame have 1589 block. how to speed up this things ? 3 minutes only 24 frame done. the vido have 5000 thousand frame, so for 3 minutes video it takes 10 hours. i dont know why ffmpeg only take my cpu usage 25%.

    


    const { spawn } = require('child_process');
const fs = require('fs');

function shuffle(array) {
    let currentIndex = array.length,  randomIndex;
  
    // While there remain elements to shuffle.
    while (currentIndex != 0) {
  
      // Pick a remaining element.
      randomIndex = Math.floor(Math.random() * currentIndex);
      currentIndex--;
  
      // And swap it with the current element.
      [array[currentIndex], array[randomIndex]] = [
        array[randomIndex], array[currentIndex]];
    }
  
    return array;
  }

function filter(width, height) {
    const sizeBlock = 16;
    let filterCommands = '';
    let totalBlock = 0;
    const widthLengthBlock = Math.floor(width / sizeBlock);
    const heightLengthBlock = Math.floor(height / sizeBlock);
    let info = [];

    for (let i=0; i < widthLengthBlock; i++) {
        for (let j=0; j < heightLengthBlock; j++) {
            const xPos = i*sizeBlock;
            const yPos = j*sizeBlock;
            filterCommands += `[0]crop=${sizeBlock}:${sizeBlock}:${(xPos)}:${(yPos)}[c${totalBlock}];`;

            info.push({
                id: totalBlock,
                x: xPos,
                y: yPos
            });

            totalBlock += 1;
        }   
    }

    info = shuffle(info);

    for (let i=0; i < info.length; i++) {
        if (i == 0) filterCommands += '[0]';
        if (i != 0) filterCommands += `[o${i}]`;

        filterCommands += `[c${i}]overlay=x=${info[i].x}:y=${info[i].y}`;

        if (i != (info.length - 1)) filterCommands += `[o${i+1}];`;     
    }

    return filterCommands;
}

const query = filter(854, 480);

fs.writeFileSync('filter.txt', query);

const task = spawn('ffmpeg', [
    '-i',
    'C:\\Software Development\\ffmpeg\\blackpink.mp4',
    '-filter_complex_script',
    'C:\\Software Development\\project\\filter.txt',
    '-c:v',
    'libx264',
    '-preset',
    'ultrafast',
    '-pix_fmt',
    'yuv420p',
    '-c:a',
    'libopus',
    '-progress',
    '-',
    'output.mp4',
    '-y'
], {
    cwd: 'C:\\Software Development\\ffmpeg'
});

task.stdout.on('data', data => { 
    console.log(data.toString())
})