Skip to content
  • 0 Votes
    4 Posts
    422 Views
    C

    @Saviz The example does not come copy-n-paste from the docs, it comes from reading the docs.

    This will list all the combinations that are possible on the running platform concerned:

    #include <QCoreApplication> #include <QDebug> #include <QMediaFormat> int main(int argc, char **argv) { QCoreApplication app(argc, argv); const QList<QMediaFormat::FileFormat> containers = { QMediaFormat::WMA, QMediaFormat::AAC, QMediaFormat::Matroska, QMediaFormat::WMV, QMediaFormat::MP3, QMediaFormat::Wave, QMediaFormat::Ogg, QMediaFormat::MPEG4, QMediaFormat::AVI, QMediaFormat::QuickTime, QMediaFormat::WebM, QMediaFormat::Mpeg4Audio, QMediaFormat::FLAC }; const QList<QMediaFormat::AudioCodec> audioCodecs = { QMediaFormat::AudioCodec::WMA, QMediaFormat::AudioCodec::AC3, QMediaFormat::AudioCodec::AAC, QMediaFormat::AudioCodec::ALAC, QMediaFormat::AudioCodec::DolbyTrueHD, QMediaFormat::AudioCodec::EAC3, QMediaFormat::AudioCodec::MP3, QMediaFormat::AudioCodec::Wave, QMediaFormat::AudioCodec::Vorbis, QMediaFormat::AudioCodec::FLAC, QMediaFormat::AudioCodec::Opus, QMediaFormat::AudioCodec::Unspecified }; const QList<QMediaFormat::VideoCodec> videoCodecs = { QMediaFormat::VideoCodec::VP8, QMediaFormat::VideoCodec::MPEG2, QMediaFormat::VideoCodec::MPEG1, QMediaFormat::VideoCodec::WMV, QMediaFormat::VideoCodec::H265, QMediaFormat::VideoCodec::H264, QMediaFormat::VideoCodec::MPEG4, QMediaFormat::VideoCodec::AV1, QMediaFormat::VideoCodec::MotionJPEG, QMediaFormat::VideoCodec::VP9, QMediaFormat::VideoCodec::Theora, QMediaFormat::VideoCodec::Unspecified }; for (const auto &c : containers) { QMediaFormat format(c); for (const auto &v : videoCodecs) { format.setVideoCodec(v); for (const auto &a : audioCodecs) { format.setAudioCodec(a); if (format.isSupported(QMediaFormat::Encode)) { qDebug() << QMediaFormat::fileFormatName(c) << "(" << QMediaFormat::videoCodecName(v) << ", " << QMediaFormat::audioCodecName(a) << ")"; } } } } return 0; }

    If you only want to support "closely aligned" combinations then only check those.

    There's no direct connection between the container format and the name of the file it is contained in. This is done purely by convention. If you want to put an MPEG4 container with audio-only in a file called blah.acc then go right ahead. Most players, I assume, only use this as a hint as to the file content and actually read the content to determine what is sane to do.

  • 0 Votes
    14 Posts
    1k Views
    Christian EhrlicherC

    @Aramir said in QRegExp returning incorrect position due to codec ?:

    ve seen many SD cards/emmc die in ereaders (devices I'm aiming for) therefore I'm trying to lower the write operations on it in order to not reduce their lifetime. That's it I think it's worth the trouble to figure out a solution to this problem instead of creating more and more e-waste.

    Again a useless optimization due to a feeling. Optimize only when you can prove it's a problem and needs to be optimzied.

    You SD-Card has likely a sector size of 512 or 1024 bytes. On top of this your filesystem may use a block size up to 64kb (NTFS, ext4 use 4kb ). So when you even change single byte in your file which is less than the sector size or block size it will write the whole sector/block.
    It's just plain stupid and an over-complicating of things for nothing.

  • 0 Votes
    3 Posts
    244 Views
    Y

    I solved by myself, maybe.
    In the constructor of TextEdit,
    after
    textEdit = new QTextEdit(this);
    add
    QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
    then I could save .md file as encoded by UTF-8.
    Without this, .md file will be saves as shift-jis (system's default).
    .txt files are always saved using UTF-8 encoding without the added line.

  • 0 Votes
    5 Posts
    499 Views
    OlivierDuguayO

    I'm as surprised as you that I don't have at least one codec... I'll try installing other codecs packages and have a look at VLC's Qt Wrapper but I mainly choose to use QMediaRecorder to reduce any other inclusion of librairies.

    Thanks for the info, I'll keep you up-to-date.

  • 0 Votes
    1 Posts
    938 Views
    No one has replied
  • 0 Votes
    4 Posts
    2k Views
    SGaistS

    Sorry, I misunderstood your post but currently, except for QMediaRecorder, I don't know if there's a way to have the list of decoders.

  • 2 Votes
    7 Posts
    3k Views
    B

    Hi, 32bit Windows 7 Home Edition.

    Anyway maybe I found a workaround. In case an error occurs when trying to play the movie, there is a maximum number of retries...
    I have done this because my suspect is that, due to the CF-19 "poor" performances, the libraries aren't (fully) loaded when the movie is played.

    I will keep you up to date whether this is or this is not THE solution, for anyone else's benefit.

    Thanks to everybody!