12

Helllo I was trying to play music on qt where I'm going to click on a button "jouer" to play the music and that was my code :

#include "jouer.h"
#include "ui_jouer.h"
Jouer::Jouer(QWidget *parent) :
QDialog(parent),
ui(new Ui::Jouer)
{
ui->setupUi(this);
ui->tabmusic->setModel(tmpmusique.afficher()); //show data base
player = new QMediaPlayer(this);
connect(player, &QMediaPlayer::positionChanged, this, &Jouer::on_positionChanged);
connect(player, &QMediaPlayer::durationChanged, this, &Jouer::on_durationChanged);
}
Jouer::~Jouer()
{
delete ui;
}

void Jouer::on_pushButton_3_clicked()
{
close();
}

void Jouer::on_pushButton_2_clicked()
{
jouertemps = new Musiqueavectemps(this); //go to another window
jouertemps->show();
}
void Jouer::on_pushButton_clicked() //that's the playing button where there is the error
{
player->setMedia(QUrl::fromLocalFile("C:\\Users\\Louay\\Desktop\\Music\\1.mp3"));
player->setVolume(50);
player->play();
}

it compiles correctly but when I click on the button "jouer"(jouer means play in French) it shows an error which is DirectShowPlayerService::doRender: Unresolved error code 0x80040266 () well I made some search in the internet on that type of errors of Unresolved error code 0x... ()

well it says that my error 0x80040266() is because : Pins cannot connect because they don't support the same transport. For example, the upstream filter might require the IAsyncReader interface, while the downstream filter requires IMemInputPin.

there is a lot of errors of DirectShowPlayerService and I just explained the cause of my type its not the same as the other answered questions ..and I don't know how to solve this .. please do not close this post

can anyone help me please

thanks

Louay GOURRIDA
  • 190
  • 1
  • 3
  • 14
  • 9
    the problem is caused because the Qt Multimedia DirectShow backend does not support some formats because you do not have the codecs, so the solution is to install those codecs, for example install [K-lite codecs](https://www.codecguide.com/download_kl.htm) or [LAV Filters](http://forum.doom9.org/showthread.php?t=156191), on the other hand when someone marks as duplicate your question you should not edit your question to claim, instead write a comment using `@ eyllanesc` to notify me. – eyllanesc Nov 15 '18 at 23:22
  • okey sure, thanks for help – Louay GOURRIDA Nov 16 '18 at 01:02
  • sorry again for the post editing... – Louay GOURRIDA Nov 16 '18 at 01:02
  • hi @ eyllanesc @eyllanesc I'm trying to build a video editing application to display video I thought of using "https://stackoverflow.com/questions/47259825/how-to-add-a-qvideowidget-in-qt-designer" and I'm facing this error "DirectShowPlayerService::doRender: Unresolved error code 0x80040266 (IDispatch error #102)" by installing "K-lite codecs" the video is playing perfectly. I just wanna know is any library by installing I can avoid installing that ("K-lite codecs") particular software.Hope my Query is clear(I'm using python for building the whole application&pyqt5 designer for GUI)thank you – Education 4Fun Mar 30 '21 at 13:04
  • @Education4Fun The problem itself is not from Qt but from Directshow which is ultimately the one that reproduces the sound so you will have to look for alternative codecs for DirectShow – eyllanesc Mar 30 '21 at 15:03
  • @eyllanesc yes sir I did understand it I'm just curious that is there any python library using which I can full the requirement Thank you – Education 4Fun Mar 30 '21 at 15:27

0 Answers0