Playing back video on Qt5

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Playing back video on Qt5

3,817 Views
ralph__
Contributor IV

I'm trying to use Qt to play back a video. Here is my code:

// Play a video.

    QApplication app(argc, argv);

    qDebug("Try to play a video: %s", argv[1]);

 

    QVideoWidget* videoWidget = new QVideoWidget;

    videoWidget->setFullScreen(true);

 

    QMediaPlayer* player = new QMediaPlayer;

    player->setVideoOutput(videoWidget);

    player->setMedia(QUrl::fromLocalFile(argv[1]));

    player->play();

 

    videoWidget->show();

    return app.exec();

Unfortunately when I execute this code on my iMX6Q board (which normally has no problems using gst-launch to play back video) I end up with a series of static vertical lines appearing on the monitor and no video.

What do I need to do to get video working from Qt?


Here is the output on the console by the way when I try to play back a video using the code above:

# /usr/local/smartfade2/Console /usr/sample720p60_40Mbps.mp4

mxc_sdc_fb fb.26: 1280x720 h_sync,r,l: 40,110,220  v_sync,l,u: 5,5,20 pixclock=74250000 Hz

Try to play a video: /usr/sample720p60_40Mbps.mp4

(gst-plugin-scanner:446): GStreamer-CRITICAL **: gst_element_class_add_pad_template: assertion 'GST_IS_PAD_TEMPLATE (templ)' failed

(gst-plugin-scanner:446): GStreamer-WARNING **: Failed to load plugin '/usr/lib/imx-mm/audio-codec/lib_src_ppp_arm11_elinux.so': /usr/lib/imx-mm/audio-codec/lib_src_ppp_arm11_elinux.so: undefined symbol: src_up2_prefilter_proc

(Console:442): GStreamer-CRITICAL **: gst_object_ref_sink: assertion 'GST_IS_OBJECT (object)' failed

This plugin does not support setParent!

This plugin does not support setParent!

[INFO]  Product Info: i.MX6Q/D/S

vpudec versions :smileyhappy:

        plugin: 3.0.11

        wrapper: 1.0.46(VPUWRAPPER_ARM_LINUX Build on Feb 16 2015 14:50:08)

        vpulib: 5.4.23

        firmware: 3.1.1.46056

[INFO]  bitstreamMode 1, chromaInterleave 1, mapType 0, tiled2LinearEnable 0

Thanks,
Ralph

Tags (4)
0 Kudos
7 Replies

1,295 Views
ralph__
Contributor IV

I haven't solved this yet but ended up giving up on this and moving onto a different solution.

0 Kudos

1,295 Views
yuantiantang
Contributor I

What's your solution? Can you share it with me?

0 Kudos

1,295 Views
yuantiantang
Contributor I

I can give you the application if you need. seems like it can't be attached here.

0 Kudos

1,295 Views
yuantiantang
Contributor I

Is this solved?

I faced same problem with slight different output as follows:

QIconvCodec::convertToUnicode: using Latin-1 for conversion, iconv_open failed

QIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv_open failed

(<unknown>:3577): GStreamer-CRITICAL **: gst_object_ref_sink: assertion `GST_IS_OBJECT (object)' failed

This plugin does not support setParent!

This plugin does not support setParent!

This plugin does not support setParent!

This plugin does not support setParent!

Could not open file

Aiur: 3.0.7

Core: AVI_PARSER_03.05.07  build on Mar 27 2013 10:06:13

  mime: video/x-msvideo

  file: /usr/lib/imx-mm/parser/lib_avi_parser_arm11_elinux.so.3.1

Content Info:

        URI:

              file:///root/640x360_mpeg4.mp4

        Idx File:

              /root/.aiur/.root.640x360_mpeg4.mp4.aidx

        Seekable  : Yes

        Size(byte): 34551532

Movie Info:

        Seekable  : Yes

        Live      : No

        Duration  : 0:03:43.451428000

        ReadMode  : File

        Track    : 2

Track 00 [video_000000] Enabled

        Duration: 0:03:43.280000000

        Language: und

        Mime:

              video/x-xvid, width=(int)640, height=(int)360, framerate=(fraction)25/1

[INFO]  Product Info: i.MX6Q/D/S

vpudec versions :smileyhappy:

        plugin: 3.0.7

        wrapper: 1.0.35(VPUWRAPPER_ARM_LINUX Build on May 20 2015 07:21:32)

        vpulib: 5.4.16

        firmware: 2.3.10.40778

Track 01 [audio_000000] Enabled

        Duration: 0:03:43.451428000

        Language: und

        Mime:

              audio/mpeg, mpegversion=(int)1, framed=(boolean)true, channels=(int)2, rate=(int

              )44100, bitrate=(int)224000

[INFO]  bitstreamMode 1, chromaInterleave 1, mapType 0, tiled2LinearEnable 0

Beep: 3.0.7

Core: MP3 decoder Wrapper  build on Mar 15 2013 09:57:40

  mime: audio/mpeg, mpegversion = (int)1

  file: /usr/lib/imx-mm/audio-codec/wrap/lib_mp3d_wrap_arm12_elinux.so

CODEC: BLN_MAD-MMCODECS_MP3D_ARM_02.13.00_CORTEX-A8  build on Dec  5 2012 09:45:19.

0 Kudos

1,295 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

Is it possible that you share your entire application? I would like to reproduce the problem on my side.

Best Regards,

Alejandro

0 Kudos

1,295 Views
ralph__
Contributor IV

It's been a few weeks since I did this, however I think my code was like this:

qDebug("Try to play a video: %s", argv[1]);

   

    QVideoWidget* videoWidget = new QVideoWidget;

    videoWidget->setFullScreen(true);

   

    QMediaPlayer* player = new QMediaPlayer;

    player->setVideoOutput(videoWidget);

    player->setMedia(QUrl::fromLocalFile(argv[1]));

    player->play();

   

    videoWidget->show();

Thanks,
Ralph

0 Kudos

1,295 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi Ralph,

Would you be nice enough to share an application I can test adn debug?

/Alejandro

0 Kudos