Command line video player

jdforce
Posts: 12
Joined: Mon Mar 12, 2018 12:58 am
languages_spoken: english
ODROIDs: Odroid c2
Contact:

Re: Command line video player

Unread post by jdforce » Mon Mar 12, 2018 11:56 pm

Well I installed the recommended version, exactly the image from your link, didn't upgrade, cloned the c2play repository, installed dependencies and compiled successfully. (Had to Install mali-fbdev and mali-x11 because they were not installed and complilation failed prior to installing them)
However I get the errors below, and the desktop turns black, nothing is being played:

Code: Select all

odroid@odroid64:~/c2play$ ./c2play-x11 ~/InsertCash.mp4
added device: /dev/input/event7
added device: /dev/input/event6
added device: /dev/input/mouse1
added device: /dev/input/event5
added device: /dev/input/event4
added device: /dev/input/event3
added device: /dev/input/event2
added device: /dev/input/event1
added device: /dev/input/event0
added device: /dev/input/mouse0
added device: /dev/input/mice
Device: /dev/input/event7
	bustype=0, vendor=0, product=0, version=0
	name=lircd
InputDevice entering running state.
Device: /dev/input/event6
	bustype=0, vendor=0, product=0, version=0
	name=MCE IR Keyboard/Mouse (meson-ir)
InputDevice entering running state.
Device: /dev/input/mouse1
EVIOCGBIT failed.
Device: /dev/input/event5
	bustype=25, vendor=0, product=0, version=0
	name=meson-ir
InputDevice entering running state.
Device: /dev/input/event4
	bustype=3, vendor=3690, product=704, version=273
	name=dakai PS/2+USB Keyboard
InputDevice entering running state.
Device: /dev/input/event3
	bustype=3, vendor=3690, product=704, version=273
	name=dakai PS/2+USB Keyboard
InputDevice entering running state.
Device: /dev/input/event2
	bustype=25, vendor=5812, product=1793, version=1
	name=vt-input
InputDevice entering running state.
Device: /dev/input/event1
	bustype=16, vendor=7054, product=3308, version=1
	name=cec_input
InputDevice entering running state.
Device: /dev/input/event0
	bustype=3, vendor=5593, product=2636, version=273
	name= USB OPTICAL MOUSE
InputDevice entering running state.
Device: /dev/input/mouse0
EVIOCGBIT failed.
Device: /dev/input/mice
EVIOCGBIT failed.
Using input device: lircd
Using input device: MCE IR Keyboard/Mouse (meson-ir)
Using input device: meson-ir
Using input device: dakai PS/2+USB Keyboard
Using input device: dakai PS/2+USB Keyboard
Using input device: vt-input
Using input device: cec_input
Using input device:  USB OPTICAL MOUSE
X11Window: width=1920, height=1080
EGL: major=1, minor=4
EGL: Vendor=ARM
EGL: Version=1.4 Linux-r6p1-01rel0
EGL: ClientAPIs=OpenGL_ES
EGL: Extensions=EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_reusable_sync EGL_KHR_fence_sync EGL_KHR_swap_buffers_with_damage EGL_EXT_swap_buffers_with_damage EGL_KHR_lock_surface EGL_KHR_lock_surface2 EGL_EXT_create_context_robustness EGL_ANDROID_blob_cache EGL_KHR_create_context EGL_KHR_partial_update EGL_KHR_create_context_no_error 
EGL: ClientExtensions=EGL_EXT_client_extensions EGL_EXT_platform_base EGL_KHR_platform_x11 

X11Window: xwin = 69206018
avformat_open_input failed.
No such file or directory
terminate called after throwing an instance of 'AVException'
Aborted
odroid@odroid64:~/c2play$ 

crashoverride
Posts: 4285
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Contact:

Re: Command line video player

Unread post by crashoverride » Tue Mar 13, 2018 4:51 am

The command used is:

Code: Select all

odroid@odroid64:~/c2play$ ./c2play-x11 ~/InsertCash.mp4
The error reported is:

Code: Select all

avformat_open_input failed.
No such file or directory
This means the file "~/InsertCash.mp4" can not be found to play.

jdforce
Posts: 12
Joined: Mon Mar 12, 2018 12:58 am
languages_spoken: english
ODROIDs: Odroid c2
Contact:

Re: Command line video player

Unread post by jdforce » Tue Mar 13, 2018 12:15 pm

Yes you are right. I copied and pasted the previous run where I was a bit dyslexic after some hours testing on this.
But anyway, it does not run using the correct paths in the command line.
For some reason, now in x-11 mode it not only fails with an EVIOCGBIT failed but it logs me off, and even the logon dialog is black, and when logging in again it is mostly black, with some artifacts that look like a memory leak into the video ram. Reminded me of my 1979 experiments with an Ohio Scientific c4P assembler where we had direct access to the video ram area.
In terminal mode (ctrl-alt-F2) it does not run also. I took pictures, but did not find how to send them here.

I was hoping to deploy the new fleet of kiosks with this board but seems we are stuck with the Raspberry Pi.
Thanks

JD

crashoverride
Posts: 4285
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Contact:

Re: Command line video player

Unread post by crashoverride » Tue Mar 13, 2018 12:48 pm

The EVIOCGBIT messages are informative, not errors. They indicate the device entry is not a linux input event device. All event device are of the form /dev/input/event*

The mali-fbdev and mali-x11 packages are mutually exclusive. Installing one will uninstall the other. c2play requires the mali-fbdev package. c2play-x11 requires the mali-x11 package and can only be used while the X11 desktop is the active VT.

If you are using the Ubuntu minimal image, then you will use c2play and mali-fbdev. If you are using the Ubuntu Mate (desktop) image, then you will use c2play-x11 and mali-x11. c2play-x11 can not be started from a text VT. The X11 desktop must be active.

jdforce
Posts: 12
Joined: Mon Mar 12, 2018 12:58 am
languages_spoken: english
ODROIDs: Odroid c2
Contact:

Re: Command line video player

Unread post by jdforce » Tue Mar 13, 2018 11:07 pm

OK, the last package I installed is mali-x11. Am interested on running the player while in the desktop mode. So, as I said, for testing the c2play-x11 I opened a terminal window and wrote the command. Is that fine or do I have to create a shortcut? It seems to me that using a terminal window I am indeed in the desktop.

crashoverride
Posts: 4285
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Contact:

Re: Command line video player

Unread post by crashoverride » Tue Mar 13, 2018 11:31 pm

Yes, a terminal window is expected to work. Be aware that c2play-x11 is a 'full screen' application. It can not be resized. Any other X11 program attempting to become the "top most window" will disrupt operation.

The C2 (S905) display controller has 2 different display planes. The video plane is logically behind the desktop plane. To see video, the desktop needs to be transparent (alpha less than 255) to allows the video to show through. OpenGL ES is only used to display subtitles. It does not touch any video. The video is routed through the hardware decoder directly to the video plane. This is why VT switching is not supported and the X11 presentation is full screen. These limitations originate from linux/x11.

jdforce
Posts: 12
Joined: Mon Mar 12, 2018 12:58 am
languages_spoken: english
ODROIDs: Odroid c2
Contact:

Re: Command line video player

Unread post by jdforce » Wed Mar 14, 2018 2:27 am

Well then am trying to run it correctly, as follows:

The package installed is mali-x11, and followed all the dependencies installation on your github page.
I open a terminal window, and go to the c2play directory. There, I run ./c2play-x11 ~/media/InsertCash.mp4 and in the terminal window area I have basically the same list of messages I posted before, this time followed by

Code: Select all

eglGetDisplay failed
termnate called after throwing an instance of 'Exception' 
Aborted
.
then the desktop becames all black, after a few seconds the taskbar panel appears, dark and in the window title area there are zig zag lines. Mostly all background color is lost, but icons and text retain the color (text on the terminal window) and after some five seconds the system logs me off without any input on my side. The login screen is also strange, and when logging on again the windows inside and desktop are all black. Need to reboot to recover the original theme.

The video can be opened with ffplay and vlc when ran from a terminal window on a fresh boot.

Am fine with the video been watched at full screen, although a partial screen display of the video (thinking omxplayer) would be fine in the future. Our kiosk app uses (for some windows) a small video contained within a frame with data generated from the database, and branding images but one version uses full screen videos and other windows with data and images.

For this failure, the most likely scenario I can think of is that there is some dependency not met. I ran an apt update and apt upgrade, and it still fails.

crashoverride
Posts: 4285
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Contact:

Re: Command line video player

Unread post by crashoverride » Wed Mar 14, 2018 2:52 am

jdforce wrote:eglGetDisplay failed
This happens when 1) using c2play-x11 with mali-fbdev or 2) c2play with mali-x11 or 3) either with mesa-egl. Try running "es2gears" or "es2_info" or "glmark2-es2" to verify the correct Mali installation.
jdforce wrote:Mostly all background color is lost, but icons and text retain the color (text on the terminal window) and after some five seconds the system logs me off without any input on my side. The login screen is also strange, and when logging on again the windows inside and desktop are all black. Need to reboot to recover the original theme.
This should not happen with c2play-x11. c2play-x11 creates a full-screen window using regular X11 calls. c2play (non X11), in contrast, uses the /deb/fb0 device directly. Attempting to use c2play (non X11) and X11 at the same time will cause conflicts as they both attempt to control the same /dev/fb0 (the framebuffer).

If possible, you should record a video of the launch and subsequent issue.

[edit]
As soon as I can find a spare SD card, I will re-validate the entire process.

crashoverride
Posts: 4285
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Contact:

Re: Command line video player

Unread post by crashoverride » Wed Mar 14, 2018 3:36 am

I could reproduce the issue. I used the following test on a clean ubuntu 16.04 mate image.

Code: Select all

$ sudo apt install git
$ git clone https://github.com/OtherCrashOverride/c2play.git
$ cd c2play
$ sudo apt install libasound2-dev libavformat-dev libass-dev
$ make c2play-x11
$ wget http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_60fps_normal.mp4
$ ./c2play-x11 bbb_sunflower_1080p_60fps_normal.mp4
The first run from a terminal window produced the eglGetDisplay failed error.

I then logged in from a ssh session and performed:

Code: Select all

$ export DISPLAY=:0.0
$ cd c2play
$ ./c2play-x11 bbb_sunflower_1080p_60fps_normal.mp4
The above worked and subsequent use on the X11 command prompt window also worked. This suggests the issue a "stale" Xauth entry or "magic cookie" in the ubuntu16.04 image.

jdforce
Posts: 12
Joined: Mon Mar 12, 2018 12:58 am
languages_spoken: english
ODROIDs: Odroid c2
Contact:

Re: Command line video player

Unread post by jdforce » Wed Mar 14, 2018 4:32 am

Great, thanks. Will try that later, as soon as am back in my desk, and report back.

JD

Edit: No luck. I followed the instructions. It keeps showing the same messages, this time it stops without showing error, next it turns the desktop black, seconds after it just logs me off, showing the login screen with black accents.

Hope to have time over the weekend to flash another card and walk through the procedure.

Thanks,
JD

jdforce
Posts: 12
Joined: Mon Mar 12, 2018 12:58 am
languages_spoken: english
ODROIDs: Odroid c2
Contact:

Re: Command line video player

Unread post by jdforce » Thu Mar 15, 2018 11:38 pm

Well, yesterday I had some time and am happy to report that it finally worked.
I followed the indicated procedure same as before, but on the previous (failed) attempt I noticed that I did something different on the clean ubuntu 16.04 :

a) Before buiding c2play-x11, I ran sudo apt install mali-x11. In theory it shouldn't have done any actual change.
b) I ran make -j4 instead of make c2play-x11. That decision came from reading the instructions on github. I recall some errors and then I ran make c2play-x11 -j4.

This time, after a failed test I logged from the pc using ssh and did the indicated export procedure.

After some successful tests, I risked a possible failure by accepting the updates that Ubuntu offered. After the updates, then a couple of reboots, it still worked fine.

Now I have the task of checking if our Xojo, mono or Visual Studio cross compiler program works and look for an alternative if not, possibly python or plain c++.
Still need to find how to suppress all the debug text lines that the c2play-x11 outputs to the terminal.

Thanks,
JD

crashoverride
Posts: 4285
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Contact:

Re: Command line video player

Unread post by crashoverride » Fri Mar 16, 2018 4:05 am

jdforce wrote:Now I have the task of checking if our Xojo, mono or Visual Studio cross compiler program works
Mono (C# runtime) does work on C2:

Code: Select all

sudo apt install mono-complete
jdforce wrote:Still need to find how to suppress all the debug text lines that the c2play-x11 outputs to the terminal.
This is typically done by redirecting output to a log file or null:

Code: Select all

c2play-x11 media.mkv > /dev/null

jdforce
Posts: 12
Joined: Mon Mar 12, 2018 12:58 am
languages_spoken: english
ODROIDs: Odroid c2
Contact:

Re: Command line video player

Unread post by jdforce » Sun Mar 18, 2018 4:34 am

Thanks, in the next round of tests will play with it.
JD

andwm
Posts: 2
Joined: Sun Apr 29, 2018 1:31 am
languages_spoken: english, russian
ODROIDs: C2
Contact:

Re: Command line video player

Unread post by andwm » Sun Apr 29, 2018 1:44 am

Hi,
Is it possible to run c2play in infinite loop play mode?
A very useful option for signage.

Regards
Andrey

User avatar
mad_ady
Posts: 5272
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Contact:

Re: Command line video player

Unread post by mad_ady » Sun Apr 29, 2018 2:53 am

Yes.

Code: Select all

while :; do
 c2play /path/to/video
done

andwm
Posts: 2
Joined: Sun Apr 29, 2018 1:31 am
languages_spoken: english, russian
ODROIDs: C2
Contact:

Re: Command line video player

Unread post by andwm » Sat May 05, 2018 2:05 am

Thank you mad_ady

ujjwal14
Posts: 4
Joined: Mon May 07, 2018 7:55 pm
languages_spoken: english
ODROIDs: Odroid C2
Contact:

Re: Command line video player

Unread post by ujjwal14 » Mon May 07, 2018 8:03 pm

Hi,
I want to add functionality to change playback speed. Can you point me to the source and give me some hints on how I could accomplish this ?

crashoverride
Posts: 4285
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Contact:

Re: Command line video player

Unread post by crashoverride » Mon May 07, 2018 10:49 pm

ujjwal14 wrote:I want to add functionality to change playback speed. Can you point me to the source and give me some hints on how I could accomplish this ?
Source code for the most recent work is here:
https://github.com/OtherCrashOverride/c2play/tree/next

The audio sink is used as the master clock. Adjusting the audio playback speed will signal to the video sink what should be currently displayed. This is just an example approach, and it has not been tested.
https://github.com/OtherCrashOverride/c ... #L314-L369

ujjwal14
Posts: 4
Joined: Mon May 07, 2018 7:55 pm
languages_spoken: english
ODROIDs: Odroid C2
Contact:

Re: Command line video player

Unread post by ujjwal14 » Wed May 09, 2018 5:14 am

crashoverride wrote: The audio sink is used as the master clock. Adjusting the audio playback speed will signal to the video sink what should be currently displayed. This is just an example approach, and it has not been tested.
https://github.com/OtherCrashOverride/c ... #L314-L369
Thanks for the response. I can't seem to figure out how to change audio playback speed. Can you tell me how to change it ( which variables to modify) ?

crashoverride
Posts: 4285
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Contact:

Re: Command line video player

Unread post by crashoverride » Wed May 09, 2018 10:35 am

ujjwal14 wrote:Can you tell me how to change it ( which variables to modify) ?
Since changing playback rate is not a supported feature, there are no variables to modify. You will need to add/modify code. For example, if you drop every other audio sample, you have 2X increase in playback. Alternatively, you could process the audio through a resampler library to achieve different playback rates while maintaining pitch.

ujjwal14
Posts: 4
Joined: Mon May 07, 2018 7:55 pm
languages_spoken: english
ODROIDs: Odroid C2
Contact:

Re: Command line video player

Unread post by ujjwal14 » Wed May 09, 2018 11:11 pm

crashoverride wrote: Since changing playback rate is not a supported feature, there are no variables to modify. You will need to add/modify code. For example, if you drop every other audio sample, you have 2X increase in playback. Alternatively, you could process the audio through a resampler library to achieve different playback rates while maintaining pitch.
Thanks will look into above suggestions. With the above suggestions it should be possible to change speed while media is playing right ? and not just during initialization ...

crashoverride
Posts: 4285
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Contact:

Re: Command line video player

Unread post by crashoverride » Thu May 10, 2018 10:33 am

ujjwal14 wrote:and not just during initialization ...
c2play continuously syncs video with audio during playback, not just during initialization. However, I can not offer any guarantee since changing playback speed is not a supported feature.

ujjwal14
Posts: 4
Joined: Mon May 07, 2018 7:55 pm
languages_spoken: english
ODROIDs: Odroid C2
Contact:

Re: Command line video player

Unread post by ujjwal14 » Wed May 16, 2018 5:11 am

Hi, I was looking at the possibility of playing two c2play processes at the same time and was getting an exception "AmlCodec open failed". Is this a hardware limitation or is there anyway to circumvent this problem ?

User avatar
rooted
Posts: 6355
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Contact:

Re: Command line video player

Unread post by rooted » Wed May 16, 2018 6:14 am

c2play is directly interfacing the hardware, don't think you can do that

User avatar
mad_ady
Posts: 5272
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Contact:

Re: Command line video player

Unread post by mad_ady » Wed May 16, 2018 2:01 pm

There's also the issue that c2play does only fullscreen playback because it uses the same rendering plane as kodi. Even if two processes would run you could see either one video or an interlaced video.

crashoverride
Posts: 4285
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Contact:

Re: Command line video player

Unread post by crashoverride » Wed May 16, 2018 3:28 pm

ujjwal14 wrote:Is this a hardware limitation or is there anyway to circumvent this problem ?
It is likely a software limitation. When Kernel 4.x is available with V4L M2M codec support, it should be possible to have multiple decode contexts, but there is no way to confirm this until then.

outhudd9
Posts: 33
Joined: Wed May 02, 2018 10:52 pm
languages_spoken: english
Contact:

Re: Command line video player

Unread post by outhudd9 » Thu May 31, 2018 5:33 am

Thanks very much for this. It's working great for me with 1080p mp4 files.

I'm trying to get this to work in conjunction with streamlink to play Youtube Live videos (and other HLS stuff which streamlink takes care of).

If I first save a few seconds of the live stream to file:

Code: Select all

streamlink "https://www.youtube.com/watch?v=XOacA3RYrXk" best -o=skynews.mp4
then leave it record for a few seconds and kill it, then play the file with c2play-x11, it plays perfectly:

Code: Select all

c2play-x11 skynews.mp4
But streamlink also has a more useful option to send the stream straight to a player (works with vlc or mpv for example with this on my laptop or Rpi3). But when I try this with c2play, it seems to launch the player for an instant, then quits without showing any of the video. I'm not sure how to get a more verbose output from streamlink or c2play in this situation.

Code: Select all

streamlink "https://www.youtube.com/watch?v=XOacA3RYrXk" best --player=/usr/local/bin/c2play-x11
is what I am trying.

I get:

Code: Select all

[console][info] Found matching plugin youtube for URL https://www.youtube.com/watch?v=XOacA3RYrXk
[console][info] Available streams: 144p (worst), 240p, 360p, 480p, 720p, 1080p (best)
[console][info] Opening stream: 1080p (hls)
[console][info] Starting player: /usr/local/bin/c2play-x11
[console][info] Player closed
[console][info] Stream ended
[console][info] Closing currently open stream...

crashoverride
Posts: 4285
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Contact:

Re: Command line video player

Unread post by crashoverride » Thu May 31, 2018 9:14 am

outhudd9 wrote:But streamlink also has a more useful option to send the stream straight to a player
I have never used Streamlink, but based on the documentation here:
https://streamlink.github.io/players.html
You should use the "Named pipe (FIFO)" or "HTTP" transport mode. c2play does not support the standard input pipe as a source.

outhudd9
Posts: 33
Joined: Wed May 02, 2018 10:52 pm
languages_spoken: english
Contact:

Re: Command line video player

Unread post by outhudd9 » Thu May 31, 2018 2:18 pm

crashoverride wrote:You should use the "Named pipe (FIFO)" or "HTTP" transport mode. c2play does not support the standard input pipe as a source.
Great! The FIFO and HTTP modes both work.

I'll be watching a lot of the World Cup this summer with c2play! :D Thanks.

crashoverride
Posts: 4285
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Contact:

Re: Command line video player

Unread post by crashoverride » Fri Jun 22, 2018 7:44 pm

I created a new branch with support for the Ubuntu 18.04 C2 image:
https://github.com/OtherCrashOverride/c ... ree/bionic

outhudd9
Posts: 33
Joined: Wed May 02, 2018 10:52 pm
languages_spoken: english
Contact:

Re: Command line video player

Unread post by outhudd9 » Sat Jun 23, 2018 5:36 am

crashoverride wrote:I created a new branch with support for the Ubuntu 18.04 C2 image:
https://github.com/OtherCrashOverride/c ... ree/bionic
Thanks for the fast update! Will try it now...

[edit]
I get this error from c2play and c2play-x11:
c2play: error while loading shared libraries: libEGL.so: cannot open shared object file: No such file or directory

crashoverride
Posts: 4285
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Contact:

Re: Command line video player

Unread post by crashoverride » Sat Jun 23, 2018 1:40 pm

outhudd9 wrote: libEGL.so: cannot open shared object file: No such file or directory
That is symptomatic of an issue with the Mali driver package.

[edit]
On my test system I observe the following:

Code: Select all

odroid@odroid:~$ ll /usr/lib/aarch64-linux-gnu/libEGL*
lrwxrwxrwx 1 root root 11 Jun 11 23:16 /usr/lib/aarch64-linux-gnu/libEGL.so -> libEGL.so.1*
lrwxrwxrwx 1 root root 13 Jun 11 23:16 /usr/lib/aarch64-linux-gnu/libEGL.so.1 -> libEGL.so.1.4*
lrwxrwxrwx 1 root root 10 Jun 11 23:16 /usr/lib/aarch64-linux-gnu/libEGL.so.1.4 -> libMali.so*
odroid@odroid:~$ ll /usr/lib/aarch64-linux-gnu/libMali.so 
-rwxr-xr-x 1 root root 1258960 Jun 11 23:16 /usr/lib/aarch64-linux-gnu/libMali.so*
[edit2]
The issue appears to be the "mali-fbdev" package:

Code: Select all

odroid@odroid:~$ sudo apt install mali-fbdev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  mali-x11
The following NEW packages will be installed:
  mali-fbdev
0 upgraded, 1 newly installed, 1 to remove and 10 not upgraded.
Need to get 453 kB of archives.
After this operation, 36.9 kB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://deb.odroid.in/c2 bionic/main arm64 mali-fbdev arm64 20180613-r6p1-8 [453 kB]
Fetched 453 kB in 1s (758 kB/s)
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
(Reading database ... 154641 files and directories currently installed.)
Removing mali-x11 (20180613-r6p1-8) ...
Selecting previously unselected package mali-fbdev.
(Reading database ... 154598 files and directories currently installed.)
Preparing to unpack .../mali-fbdev_20180613-r6p1-8_arm64.deb ...
Unpacking mali-fbdev (20180613-r6p1-8) ...
dpkg: error processing archive /var/cache/apt/archives/mali-fbdev_20180613-r6p1-8_arm64.deb (--unpack):
 trying to overwrite '/usr/lib/aarch64-linux-gnu/libEGL.so.1', which is also in package libegl1:arm64 1.0.0-2ubuntu2
Errors were encountered while processing:
 /var/cache/apt/archives/mali-fbdev_20180613-r6p1-8_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
odroid@odroid:~$ 
Note the failure of '/usr/lib/aarch64-linux-gnu/libEGL.so.1' in the log.

outhudd9
Posts: 33
Joined: Wed May 02, 2018 10:52 pm
languages_spoken: english
Contact:

Re: Command line video player

Unread post by outhudd9 » Sat Jun 23, 2018 3:37 pm

crashoverride wrote: The issue appears to be the "mali-fbdev" package:

Code: Select all

odroid@odroid:~$ sudo apt install mali-fbdev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  mali-x11
The following NEW packages will be installed:
  mali-fbdev
0 upgraded, 1 newly installed, 1 to remove and 10 not upgraded.
Need to get 453 kB of archives.
After this operation, 36.9 kB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://deb.odroid.in/c2 bionic/main arm64 mali-fbdev arm64 20180613-r6p1-8 [453 kB]
Fetched 453 kB in 1s (758 kB/s)
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
(Reading database ... 154641 files and directories currently installed.)
Removing mali-x11 (20180613-r6p1-8) ...
Selecting previously unselected package mali-fbdev.
(Reading database ... 154598 files and directories currently installed.)
Preparing to unpack .../mali-fbdev_20180613-r6p1-8_arm64.deb ...
Unpacking mali-fbdev (20180613-r6p1-8) ...
dpkg: error processing archive /var/cache/apt/archives/mali-fbdev_20180613-r6p1-8_arm64.deb (--unpack):
 trying to overwrite '/usr/lib/aarch64-linux-gnu/libEGL.so.1', which is also in package libegl1:arm64 1.0.0-2ubuntu2
Errors were encountered while processing:
 /var/cache/apt/archives/mali-fbdev_20180613-r6p1-8_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
odroid@odroid:~$ 
Note the failure of '/usr/lib/aarch64-linux-gnu/libEGL.so.1' in the log.
Thanks for checking that. Yes I installed many packages for another problem, I think mali-fbdev was one of them.

I'll undo those changes.

User avatar
odroid
Site Admin
Posts: 29750
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Command line video player

Unread post by odroid » Sun Jun 24, 2018 3:29 pm

crashoverride wrote:I created a new branch with support for the Ubuntu 18.04 C2 image:
https://github.com/OtherCrashOverride/c ... ree/bionic
Thank you for the update. I've run the following commands after freshly flashing Ubuntu 18.04 image for C2.

Code: Select all

sudo apt install git libasound2-dev libavformat-dev libass-dev libx11-dev
git clone https://github.com/OtherCrashOverride/c2play.git
cd c2play/
git branch -a
git checkout bionic
make c2play-x11 -j4
I can enjoy fantastic H.265/4K videos on Ubuntu 18.04 now. :D

outhudd9
Posts: 33
Joined: Wed May 02, 2018 10:52 pm
languages_spoken: english
Contact:

Re: Command line video player

Unread post by outhudd9 » Wed Jun 27, 2018 1:18 am

I have flashed a clean 18.04 image, and built c2play using:

Code: Select all

sudo apt install git libasound2-dev libavformat-dev libass-dev libx11-dev git
git clone https://github.com/OtherCrashOverride/c2play.git
cd c2play/
git branch -a
git checkout bionic
make -j4
I get the same error on two files I tried to play:

Code: Select all

odroid@odroid:~/Downloads$ c2play-x11 TextInMotion-Sample-720p.mp4 
added device: /dev/input/event3
added device: /dev/input/event2
added device: /dev/input/event1
added device: /dev/input/event0
added device: /dev/input/mouse0
added device: /dev/input/mice
Device: /dev/input/event3
	bustype=25, vendor=5812, product=1793, version=1
	name=vt-input
InputDevice entering running state.
Device: /dev/input/event2
	bustype=16, vendor=7054, product=3308, version=1
	name=cec_input
InputDevice entering running state.
Device: /dev/input/event1
	bustype=3, vendor=1578, product=1992, version=272
	name=AliTV Remote V1 RF USB Controller
InputDevice entering running state.
Device: /dev/input/event0
	bustype=3, vendor=1578, product=1992, version=272
	name=AliTV Remote V1 RF USB Controller
InputDevice entering running state.
Device: /dev/input/mouse0
EVIOCGBIT failed.
Device: /dev/input/mice
EVIOCGBIT failed.
Using input device: vt-input
Using input device: cec_input
Using input device: AliTV Remote V1 RF USB Controller
Using input device: AliTV Remote V1 RF USB Controller
X11Window: width=1920, height=1080
EGL: major=1, minor=4
EGL: Vendor=ARM
EGL: Version=1.4 Linux-r6p1-01rel0
EGL: ClientAPIs=OpenGL_ES
EGL: Extensions=EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_reusable_sync EGL_KHR_fence_sync EGL_KHR_swap_buffers_with_damage EGL_EXT_swap_buffers_with_damage EGL_KHR_lock_surface EGL_KHR_lock_surface2 EGL_EXT_create_context_robustness EGL_ANDROID_blob_cache EGL_KHR_create_context EGL_KHR_partial_update EGL_KHR_create_context_no_error 
EGL: ClientExtensions=EGL_EXT_client_extensions EGL_EXT_platform_base EGL_KHR_platform_x11 

X11Window: xwin = 52428802
mmap failed: Operation not permitted
eglGetError failed: 0x3003
terminate called after throwing an instance of 'Exception'
Aborted

crashoverride
Posts: 4285
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Contact:

Re: Command line video player

Unread post by crashoverride » Wed Jun 27, 2018 3:17 am

outhudd9 wrote:I get the same error on two files I tried to play:

Code: Select all

mmap failed: Operation not permitted
eglGetError failed: 0x3003
viewtopic.php?f=140&t=29735&start=150#p226323

User avatar
odroid
Site Admin
Posts: 29750
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Command line video player

Unread post by odroid » Wed Jun 27, 2018 8:18 am

We will release a kernel update package with the mmap error fix in several hours.

Edit: Released.
Update the system and check the Kernel version. Please try it and let us know the result.

Code: Select all

sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo reboot
The kernel version must be 3.16.57-22 or higher.

Code: Select all

@odroid:~# uname -a                                                         
Linux odroid 3.16.57-23 #1 SMP PREEMPT Tue Jun 26 21:51:20 -03 2018 aarch64

User avatar
odroid
Site Admin
Posts: 29750
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Command line video player

Unread post by odroid » Wed Jun 27, 2018 10:18 am

I still meet the issue of "mmap failed: Operation not permitted".

User avatar
odroid
Site Admin
Posts: 29750
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Command line video player

Unread post by odroid » Tue Jul 03, 2018 7:04 am

Kernel 3.16.57-24 fixed the mmap issue finally. :)

User avatar
mad_ady
Posts: 5272
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Contact:

Re: Command line video player

Unread post by mad_ady » Tue Jul 03, 2018 2:53 pm

Great news!

extphy
Posts: 73
Joined: Mon Aug 17, 2015 4:20 pm
languages_spoken: english, russian
ODROIDs: Cx, XU4, U3
Contact:

Re: Command line video player

Unread post by extphy » Sun Aug 12, 2018 3:52 pm

odroid wrote:
crashoverride wrote:I created a new branch with support for the Ubuntu 18.04 C2 image:
https://github.com/OtherCrashOverride/c ... ree/bionic
Thank you for the update. I've run the following commands after freshly flashing Ubuntu 18.04 image for C2.

Code: Select all

sudo apt install git libasound2-dev libavformat-dev libass-dev libx11-dev
git clone https://github.com/OtherCrashOverride/c2play.git
cd c2play/
git branch -a
git checkout bionic
make c2play-x11 -j4
I can enjoy fantastic H.265/4K videos on Ubuntu 18.04 now. :D
Hi All, wondering is it necessary to install libx11-dev to compile with EGL for an non-X11 (fbdev) application? As I can see it needs MESA_EGL_NO_X11_HEADERS define, but I doubt that this is a correct approach since MESA per my understanding isn't about HW acceleration at all.

At least c2play doesn't compile without X11 headers, even no-X11 'c2play' target.

User avatar
odroid
Site Admin
Posts: 29750
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Contact:

Re: Command line video player

Unread post by odroid » Mon Aug 13, 2018 10:24 am

@extphy,
Do you use 18.04 minimal image on the fbdev?
Could you build and run c2play only after installing libx11-dev?

extphy
Posts: 73
Joined: Mon Aug 17, 2015 4:20 pm
languages_spoken: english, russian
ODROIDs: Cx, XU4, U3
Contact:

Re: Command line video player

Unread post by extphy » Mon Aug 13, 2018 8:44 pm

odroid wrote:@extphy,
Do you use 18.04 minimal image on the fbdev?
Could you build and run c2play only after installing libx11-dev?
@odroid,
Yes, I use minimal 18.04 image on fbdev, do cross complile for my sources.

I can build and run c2play natively only after libx11-dev.

Finally I built and run my sources too with libx11-dev headers (though it needs workaround for Status define in x11lib.h, it conflicts with dozen of projects, protobuf in my case). I'll try to complile with MESA defines to see if it would work well on fbdev with hw accel (would report here)

crashoverride
Posts: 4285
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Contact:

Re: Command line video player

Unread post by crashoverride » Tue Aug 14, 2018 1:14 am

extphy wrote:wondering is it necessary to install libx11-dev to compile with EGL for an non-X11 (fbdev) application?
libx11 is not a dependency of the fb-dev target.
extphy wrote:Finally I built and run my sources too with libx11-dev headers (though it needs workaround for Status define in x11lib.h, it conflicts with dozen of projects, protobuf in my case). I'll try to complile with MESA defines to see if it would work well on fbdev with hw accel (would report here)
Only the Mali EGL/GLES headers are supported. If MESA overwrites the headers, you may require additional flags and/or dependencies.
https://github.com/mdrjr/c2_mali/tree/m ... li_headers

extphy
Posts: 73
Joined: Mon Aug 17, 2015 4:20 pm
languages_spoken: english, russian
ODROIDs: Cx, XU4, U3
Contact:

Re: Command line video player

Unread post by extphy » Wed Aug 15, 2018 1:09 am

crashoverride wrote:
extphy wrote:wondering is it necessary to install libx11-dev to compile with EGL for an non-X11 (fbdev) application?
libx11 is not a dependency of the fb-dev target.
extphy wrote:Finally I built and run my sources too with libx11-dev headers (though it needs workaround for Status define in x11lib.h, it conflicts with dozen of projects, protobuf in my case). I'll try to complile with MESA defines to see if it would work well on fbdev with hw accel (would report here)
Only the Mali EGL/GLES headers are supported. If MESA overwrites the headers, you may require additional flags and/or dependencies.
https://github.com/mdrjr/c2_mali/tree/m ... li_headers
@crashoverride, I meant https://github.com/mdrjr/c2_mali/blob/m ... platform.h:

Code: Select all

#ifdef MESA_EGL_NO_X11_HEADERS

typedef void            *EGLNativeDisplayType;
typedef khronos_uintptr_t EGLNativePixmapType;
typedef khronos_uintptr_t EGLNativeWindowType;

#else

/* X11 (tentative)  */
#include <X11/Xlib.h>
#include <X11/Xutil.h>

typedef Display *EGLNativeDisplayType;
typedef Pixmap   EGLNativePixmapType;
typedef Window   EGLNativeWindowType;

#endif /* MESA_EGL_NO_ibX11_HEADERS */
So if I don't define MESA_EGL_NO_X11_HEADERS I have to include Xlib.h

crashoverride
Posts: 4285
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Contact:

Re: Command line video player

Unread post by crashoverride » Wed Aug 15, 2018 9:45 am

That is interesting. The change is reported as being made over a year ago, but this is the first it has been reported.

The fix should just be a matter of adding a line here:
https://github.com/OtherCrashOverride/c ... e4.lua#L16

Code: Select all

 defines { "MESA_EGL_NO_X11_HEADERS" }
Then regenerating the build files:

Code: Select all

premake4 gmake

extphy
Posts: 73
Joined: Mon Aug 17, 2015 4:20 pm
languages_spoken: english, russian
ODROIDs: Cx, XU4, U3
Contact:

Re: Command line video player

Unread post by extphy » Wed Aug 15, 2018 10:44 pm

crashoverride wrote:That is interesting. The change is reported as being made over a year ago, but this is the first it has been reported.

The fix should just be a matter of adding a line here:
https://github.com/OtherCrashOverride/c ... e4.lua#L16

Code: Select all

 defines { "MESA_EGL_NO_X11_HEADERS" }
Then regenerating the build files:

Code: Select all

premake4 gmake
Wow, seems that I almost contributed something useful :) Still confused with MESA thugh, would it be working with HW accel, would check.

extphy
Posts: 73
Joined: Mon Aug 17, 2015 4:20 pm
languages_spoken: english, russian
ODROIDs: Cx, XU4, U3
Contact:

Re: Command line video player

Unread post by extphy » Tue Aug 21, 2018 6:00 pm

Compiled and linked with MESA_EGL_NO_X11_HEADERS define + removed libx11-dev, works well with hw accel.

Looks like recent ffmpeg versions renamed some defines:

Code: Select all

../../src/Media/MediaSourceElement.cpp:163:11: error: ‘CODEC_ID_MPEG2VIDEO’ was not declared in this scope
      case CODEC_ID_MPEG2VIDEO:
           ^~~~~~~~~~~~~~~~~~~
../../src/Media/MediaSourceElement.cpp:163:11: note: suggested alternative: ‘AV_CODEC_ID_MPEG2VIDEO’
      case CODEC_ID_MPEG2VIDEO:
           ^~~~~~~~~~~~~~~~~~~
           AV_CODEC_ID_MPEG2VIDEO

pro777
Posts: 1
Joined: Thu Aug 23, 2018 10:21 pm
languages_spoken: english
Contact:

Re: Command line video player

Unread post by pro777 » Thu Aug 23, 2018 11:30 pm

Hi, crashoverride,
Thank you very much for your c2play. I collected it for my box on S912. Excellent plays H264 and H265 up to 4K video, using ffmpeg with libamcodec support and also Android EGL, GLES and libhybris libraries.
Will it develop? Is there a problem with support for the VP9 codec?
It would be good to add the support of MSMPEG4v1 and MSMPEG4v2 codecs, as well the audio codec PCM_s16le.
Now a little about the sad. Unfortunately, c2play for me works only a debug version. The release version when you try to play ends with an error:

Code: Select all

EGL: major=1, minor=4
EGL: Vendor=Android
EGL: Version=1.4 Android META-EGL
EGL: ClientAPIs=OpenGL_ES
EGL: Extensions=EGL_KHR_get_all_proc_addresses EGL_ANDROID_presentation_time EGL_KHR_swap_buffers_with_damage EGL_ANDROID_create_native_client_buffer EGL_ANDROID_front_buffer_auto_refresh EGL_KHR_image EGL_KHR_image_base EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_fence_sync EGL_KHR_create_context EGL_KHR_config_attribs EGL_KHR_surfaceless_context EGL_EXT_create_context_robustness EGL_ANDROID_image_native_buffer EGL_KHR_wait_sync EGL_ANDROID_recordable EGL_KHR_partial_update EGL_KHR_mutable_render_buffer EGL_EXT_protected_content 
EGL: ClientExtensions=(null)

Source Metadata:
	key=encoder, value=libebml v1.3.0 + libmatroska v1.4.1
	key=creation_time, value=2014-04-22T08:46:13.000000Z
Duration: 634.534000
Streams (count=2):
stream #0 - VIDEO/HEVC
	w=1920 h=1080 fps=60.000000(60/1) SAR=(1/1) 
stream #1 - AUDIO/AAC
AmlCodec: amstream version : 2.0
Element (AudioCodec) Flush exited.
Element (AudioSink) Flush exited.
AmlVideoSinkElement: calling base.
Element (VideoSink) Flush exited.
AmlVideoSinkElement: Flush exited.
Element (Source) Flush exited.
Element (VideoSink) ChangeState oldState=0 newState=1.
AmlVideoSink: ExtraData size=130
Element (AudioCodec) ChangeState oldState=0 newState=1.
Element (AudioSink) ChangeState oldState=0 newState=1.
Element (Source) ChangeState oldState=0 newState=1.
AmlVideoSink - VIDEO/HEVC
	w=1920 h=1080 fps=60.000000 am_sysinfo.rate=1601 
AmlVideoSinkElement: got marker buffer Marker=2
Header (pkt.size=2ac):
00 00 00 1d 40 01 0c 02 ff ff 01 60 00 00 03 00 
isAnnexB=0
isShortStartCode=0
AudioCodecElement: outInfo->SampleRate=48000, outInfo->Channels=6
AlsaAudioSinkElement: isFirstData changed.
SetupAlsa: frameSize=1024
AlsaAudioSinkElement::ProcessBuffer - Rate=48000, Channels=6, Format=6.
AmlVideoSink: Adjust PTS - pts=0.021000 vpts=0.133000 drift=0.112000 (6.720000 frames)
*** stack smashing detected ***: ./c2play terminated
The same applies to the X11 version of the player. In addition, the X11 version of the player displays a black screen instead of video, but there is sound.
It would be convenient to add the display of the current position of playing in the format HH:MM:SS in pause mode. And also add the option --no-sound.
Last edited by pro777 on Fri Aug 24, 2018 12:17 am, edited 5 times in total.

aer
Posts: 4
Joined: Thu Aug 23, 2018 11:17 pm
languages_spoken: english
ODROIDs: C2
Contact:

Re: Command line video player

Unread post by aer » Thu Aug 23, 2018 11:46 pm

I need some advice on how to proceed with a I2S configuration (The Adafruit I2S 3W Stereo Speaker Bonnet). Currently am running ubuntu 16.04 and compiled c2play successfully. How can I enable I2S for use with c2play? I looked at some instructions on the Boom Bonnet, but for some reason my ubuntu doesn't have aplay, so can't test I2S availability.

I also see people moving to ubuntu 18.x.

What is the best way to proceed?

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 19 guests