1. ホーム
  2. ffmpeg

パイソン ffmpeg パイプ交互接続

2022-03-18 19:33:14
#include <QtGui/QApplication>
#include <QDebug>
#include <windows.h>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    qDebug("unsigned int: %d", sizeof(unsigned int));
    qDebug("unsigned int: %d", sizeof(unsigned short));

    unsigned int uia = 4;
    unsigned short usa = 4;
    unsigned int uib = 1024;
    unsigned short usb = 1024;

    qDebug("000000 00000000 00000100 00000000(1024)-->(4)000000 00000000 00000000 00000100: %d",ntohs(uib));
    qDebug("000000 00000000 00000000 00000100(4)-->(1024)000000 00000000 00000100 00000000: %d",ntohs(uia));

    qDebug("0000000100 00000000(1024)-->(4)0000000000 00000100: %d",ntohs(usb));
    qDebug("000000 00000100(4)-->(1024)0000000100 00000000: %d",ntohs(usa));

    return a.exec();
}

参考

http://zulko.github.io/blog/2013/09/27/read-and-write-video-frames-in-python-using-ffmpeg/。 (这个代码有错)

https://stackoverflow.com/questions/38156265/getting-av-interleaved-write-frame-broken-pipe-error ... (对上一篇的修正)

https://stackoverflow.com/questions/5825173/pipe-raw-opencv-images-to-ffmpeg ...