Command line video player

Post Reply
crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Command line video player

Unread post by crashoverride » Mon Aug 15, 2016 7:07 am

I created a command line video player for the C2. It uses libav for the demux and audio codec. Hardware video acceleration is utilized for the video codec. Its currently in the early stages of development and, as such, only supports h264/HEVC at the moment.
https://github.com/OtherCrashOverride/c2play

Network support for libav is enabled so it can display content from the internet or local network sources.
4K video is supported.
"sudo" may be required depending on the permissions of your OS distribution.

Example Usage:

Code: Select all

sudo ./c2play MyVideoFile.mkv
sudo ./c2play http://host_name/MyVideoFile.mkv
[Update 12/19/2016]
master branch designated release v1.0.0.

-----

[Update]
Added MPEG2 and MPEG4/XVID playback support.

[Update 8/15]
Misc fixes (longer scan needed for some 4K video files).
Added --time and --chapter command line options to specify the location to begin playback:
--time 00:00:00.000
--time 0.0000
--chapter 0

[Update 8/17]
Refactoring, fixes, and stereo down-mix.

[Update 8/17 part 2]
Major refactoring.
Support for key input devices including CEC.

[Update 8/26]
Major update.

[Update 8/31]
alpha3 branch uploaded.
Added opus, vorbis audio codecs
Added On Screen Display (OSD) when paused that shows video progress.
X11 support: c2play-x11

[Update 9/13]
Subtitle support and fixes.

[Update 9/14]
beta1 branch uploaded
https://github.com/OtherCrashOverride/c2play/tree/beta1

[Update 10/30]
C0/C1 support added in branch
https://github.com/OtherCrashOverride/c2play/tree/S805
Last edited by crashoverride on Tue Dec 20, 2016 10:03 am, edited 9 times in total.

elatllat
Posts: 1265
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1
Has thanked: 1 time
Been thanked: 6 times
Contact:

Re: Command line video player

Unread post by elatllat » Mon Aug 15, 2016 11:41 am

Nice, that makes the C2 so much closer to its full potential.
Should likely try to mimic the omxplayer options.

User avatar
odroid
Site Admin
Posts: 30618
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 12 times
Been thanked: 89 times
Contact:

Re: Command line video player

Unread post by odroid » Tue Aug 16, 2016 11:45 am

Great! Thank you for the nice example.
Changed to STICKY because tons of developers have requested this approach.

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Tue Aug 16, 2016 1:20 pm

elatllat wrote:Should likely try to mimic the omxplayer options.
I started adding options to it. Some of the omxplayer options are not relevant due to differences in hardware and software design. Where it makes sense, I will attempt to offer similar features.
odroid wrote:Changed to STICKY because tons of developers have requested this approach.
I am enjoying development of it. It should also work on C0/C1 with some minor modifications.

gseaman
Posts: 87
Joined: Fri Jan 01, 2016 2:42 pm
languages_spoken: english
ODROIDs: c1+
Location: WA, USA
Has thanked: 0
Been thanked: 0
Contact:

Re: Command line video player

Unread post by gseaman » Wed Aug 17, 2016 7:15 am

I would love to test it on my c1+.

Galen

stmicro
Posts: 243
Joined: Tue Apr 28, 2015 4:23 pm
languages_spoken: english, chinese
ODROIDs: Many Odroids and Rpis.
Location: shenzhen china
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Command line video player

Unread post by stmicro » Wed Aug 17, 2016 12:02 pm

It works greatly. Even 4K/60Hz HEVC H.265 plays smoothly.
Thank you so much. :D

I needed to install two dev packages to build it.

Code: Select all

sudo apt-get install libasound2-dev libavformat-dev 
One quick question. Is this example using Mali for rendering ? or FB YUV layer?
It seems to be the pipelined FB which is tightly coupled to the AML HW decoder.


Anyway, I really hope Hardkernel or Amlogic can provide any documents for the video Encoding API/drivers soon.

rpcameron
Posts: 278
Joined: Sat Apr 30, 2016 7:24 am
languages_spoken: english
ODROIDs: C2
Has thanked: 0
Been thanked: 0
Contact:

Re: Command line video player

Unread post by rpcameron » Wed Aug 17, 2016 12:19 pm

Looking over the source it looked like it was using the VPU, so Amlogic's hardware decoding and not Mali.

stmicro
Posts: 243
Joined: Tue Apr 28, 2015 4:23 pm
languages_spoken: english, chinese
ODROIDs: Many Odroids and Rpis.
Location: shenzhen china
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Command line video player

Unread post by stmicro » Wed Aug 17, 2016 12:22 pm

rpcameron wrote:Looking over the source it looked like it was using the VPU, so Amlogic's hardware decoding and not Mali.
I know that. The decoding must be done with the VPU obviously. My question was the rendering of the decoded YUV/RGB data.

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Thu Aug 18, 2016 3:28 am

stmicro wrote:Is this example using Mali for rendering ? or FB YUV layer?
It is using the VID0 video layer. This is typically YUV except for 4K video which uses a compressed format. In the future it may be possible to have multiple backends (Mali/GE2D); however, testing has shown that only VID0 can handle 4K@60 video bandwidth demands.

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Thu Aug 18, 2016 3:52 am

gseaman wrote:I would love to test it on my c1+.
I plan on adding C0/C1 support in the near future. The issue is not technical. Rather, its simply easier and faster for me to focus on bring-up on a single device at a time.

gseaman
Posts: 87
Joined: Fri Jan 01, 2016 2:42 pm
languages_spoken: english
ODROIDs: c1+
Location: WA, USA
Has thanked: 0
Been thanked: 0
Contact:

Re: Command line video player

Unread post by gseaman » Thu Aug 18, 2016 8:27 am

No worries. I am enjoying the c1+ already. It is just exciting to see these little machines continue to approach the limits of their potential. Great work!

Galen

stmicro
Posts: 243
Joined: Tue Apr 28, 2015 4:23 pm
languages_spoken: english, chinese
ODROIDs: Many Odroids and Rpis.
Location: shenzhen china
Has thanked: 0
Been thanked: 1 time
Contact:

Re: Command line video player

Unread post by stmicro » Thu Aug 18, 2016 8:52 am

crashoverride wrote:
stmicro wrote:Is this example using Mali for rendering ? or FB YUV layer?
It is using the VID0 video layer. This is typically YUV except for 4K video which uses a compressed format. In the future it may be possible to have multiple backends (Mali/GE2D); however, testing has shown that only VID0 can handle 4K@60 video bandwidth demands.
Thank you for the confirmation.

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Thu Aug 18, 2016 1:58 pm

The latest update adds support for key input devices. I would like feedback on what the default keymap should be. Ideally, I want to start with a mapping for the keys on the official Odroid remote control:
https://www.hardkernel.com/shop/ir-remote-controller/
Key maps
- Power
- Mute
- Home
- Up (Up Arrow)
- Down (Dn Arrow)
- Left (Left Arrow)
- Right (Right Arrow)
- OK (Enter)
- Menu
- Back (ESC)
- Vol +
- Vol -
Currently the mapping for keyboard and CEC is:
Up = back 10 minutes
Down = forward 10 minutes
left = back 10 seconds
right = forward ten seconds
spacebar or play/pause = play/pause

Eventually the keybindings should be end user modifiable. Right now I need to determine a list of what functions should be available for mapping to a key.

[edit]
To enable the Odroid IR remote on Ubuntu
1) Install the lirc package

Code: Select all

sudo apt install lirc
2) Edit /etc/lirc/hardware.conf

Code: Select all

# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="Custom"
REMOTE_MODULES="meson-ir"
REMOTE_DRIVER="default"
REMOTE_DEVICE="/dev/lirc0"
REMOTE_SOCKET=""
REMOTE_LIRCD_CONF=""
REMOTE_LIRCD_ARGS="--uinput"

#Chosen IR Transmitter
TRANSMITTER="None"
TRANSMITTER_MODULES=""
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE=""
TRANSMITTER_SOCKET=""
TRANSMITTER_LIRCD_CONF=""
TRANSMITTER_LIRCD_ARGS=""

#Disable kernel support.
#Typically, lirc will disable in-kernel support for ir devices in order to
#handle them internally.  Set to false to prevent lirc from disabling this
#in-kernel support.
#DISABLE_KERNEL_SUPPORT="true"

#Enable lircd
START_LIRCD="true"

#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD="false"

#Try to load appropriate kernel modules
LOAD_MODULES="true"

# Default configuration files for your hardware if any
LIRCMD_CONF=""

#Forcing noninteractive reconfiguration
#If lirc is to be reconfigured by an external application
#that doesn't have a debconf frontend available, the noninteractive
#frontend can be invoked and set to parse REMOTE and TRANSMITTER
#It will then populate all other variables without any user input
#If you would like to configure lirc via standard methods, be sure
#to leave this set to "false"
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
START_LIRCMD=""
3) Edit /etc/lirc/lircd.conf

Code: Select all

begin remote
 
  name  lircd.conf
  bits           16
  flags SPACE_ENC|CONST_LENGTH
  eps            30
  aeps          100
 
  header       8964  4507
  one           544  1692
  zero          544   561
  ptrail        544
  pre_data_bits   16
  pre_data       0x4DB2
  gap          107872
  toggle_bit_mask 0x0
 
      begin codes
          KEY_LEFT                 0x9966
          KEY_RIGHT                0x837C
          KEY_UP                   0x53AC
          KEY_DOWN                 0x4BB4
          KEY_ENTER                0x738C
          KEY_HOME                 0x41BE
          KEY_MUTE                 0x11EE
          KEY_MENU                 0xA35C
          KEY_BACK                 0x59A6
          KEY_VOLUMEDOWN           0x817E
          KEY_VOLUMEUP             0x01FE
          KEY_POWER                0x3BC4
      end codes
 
end remote
4) Restart the lirc service

Code: Select all

sudo service lirc restart

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Thu Aug 18, 2016 6:37 pm

I should mention that I tested with both meson-timer and arm-timer set in boot.ini. Both appear to perform correctly.

elatllat
Posts: 1265
Joined: Tue Sep 01, 2015 8:54 am
languages_spoken: english
ODROIDs: XU4, N1
Has thanked: 1 time
Been thanked: 6 times
Contact:

Re: Command line video player

Unread post by elatllat » Thu Aug 18, 2016 10:05 pm

crashoverride wrote: Currently the mapping for keyboard and CEC is:
Up = back 10 minutes
Down = forward 10 minutes
left = back 10 seconds
right = forward ten seconds
spacebar or play/pause = play/pause
Audio and subtitle stream selection might be the next most used feature.

Code: Select all

    h           help list current key bindings
    1           decrease speed
    2           increase speed
    z           show info
    j           previous audio stream
    k           next audio stream
    i           previous chapter
    o           next chapter
    n           previous subtitle stream
    m           next subtitle stream
    d           decrease subtitle delay (- 250 ms)
    f           increase subtitle delay (+ 250 ms)
    p / space   pause/resume
    -           decrease volume
    + / =       increase volume
    left arrow  seek -30 seconds
    right arrow seek +30 seconds
    down arrow  seek -600 seconds
    up arrow    seek +600 seconds

User avatar
mad_ady
Posts: 5822
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 64 times
Been thanked: 41 times
Contact:

Re: Command line video player

Unread post by mad_ady » Mon Aug 22, 2016 1:35 am

I installed this player on my C2 system and it works wonderfully - great job crashoverride! However the audio is about 1 second before the video. I tried with an mkv and a avi video. Here is the mediainfo for those files if it helps: http://pastebin.com/gtdKuAew. A self-encoded mp4 played just fine (in-sync).

One more thing - on exit the regular desktop is not shown, but I see the last framebuffer image just before X11 started. On any key press it correctly refreshes the desktop. Perhaps you can add this "refresh display" on exit, unless it's X11's job to do it.

Other than this I expect the player to be quite good. I'd only add (if it's not technically complicated) a visual progress bar on screen showing where in the video you currently are. But I understand you want this to be a minimal player so that it can be easier for people to learn how it works

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Mon Aug 22, 2016 10:25 am

mad_ady wrote:However the audio is about 1 second before the video.
I am currently working on a major re-architecting of the program that I hope to release soon; synchronization is one of the things that has changed in it. I am happy to take a bug report on this if the problem media is available publicly to reproduce the issue. I am testing with some of the streams provided by the Kodi project.
http://kodi.wiki/view/Samples

In order to prevent key presses from un-blanking the framebuffer (hiding the video behind it), its necessary to use this IOCTL:
https://github.com/OtherCrashOverride/c ... #L464-L477
Without a Kernel Mode Setting (KMS) video driver, there is no proper way to co-ordinate screen usage between user-space programs that wish to use it. This means a workaround will be needed that will probably take the form of a X11 program that creates a full screen transparent window and then shells out to the command line player. When the command line player exits and the X11 programs terminates, X11 will be informed of the screen "damage" area and can re-draw. It would help if someone filed this as a bug report on the github page so I do not forget about it.
mad_ady wrote:But I understand you want this to be a minimal player so that it can be easier for people to learn how it works
There are lots of features I want to add in the future including a minimal GUI. This is the reason for the re-architechting; to allow advanced uses. While 'c2play' may remain a bare-bones command line player, there may be other commands like 'c2play-gui' added in the future providing more advanced features. Its too early in development to make any promises about features other than to say I am definitely looking into and planning for advanced use cases.

User avatar
mad_ady
Posts: 5822
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 64 times
Been thanked: 41 times
Contact:

Re: Command line video player

Unread post by mad_ady » Mon Aug 22, 2016 3:49 pm

How do you intend on overlaying information on top of the video? Can you render text on layers on top of the video or do you have to blend the information you have to display in the video stream and send it to be displayed?

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Mon Aug 22, 2016 5:36 pm

The initial plan is to use the framebuffer layer (/dev/fb0) for presentation of subtitles and GUI. Transparent areas (RGBA8 where A < 0xff) show the video layer behind it. This is the method Kodi uses.

User avatar
mad_ady
Posts: 5822
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 64 times
Been thanked: 41 times
Contact:

Re: Command line video player

Unread post by mad_ady » Mon Aug 22, 2016 6:03 pm

Wouldn't that interfere with X11 which also uses /dev/fb0 to draw stuff? E.g. if you have a browser open with some annoying flashing animation (e.g. a banner) and you overlay video on top + things on /dev/fb0? I'm just curious - I haven't tried anything out yet.

My idea (which I shamelessly stole from a colleague) is to offload video playback from the browser via a plugin to your player. It works for his Intel system with Firefox - we'll see how it goes with a C2.

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Mon Aug 22, 2016 6:51 pm

The solution is to have a X11 front end (just like Kodi does). The video layer can be sized and positioned to match where a X11 window is allowing it to be seen. I have observed some bugs in the video layer driver that does this, so only full screen X11 windows may work reliably; however, its far too early to tell. Of my talents, creating a X11 window is among them so I am not daunted by adding first class X11 support to the program. ;)

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Fri Aug 26, 2016 4:50 pm

I updated the github with recent dev changes.

The most significant end user visible feature will be "perfect sync". Under "perfect" conditions, the program will maintain perfect audio/video sync. For less than "perfect" conditions, it will recover to "perfect" sync. ;)

The video presentation is also much improved. It should be very fluid and smooth versus the previous version even without frame rate automation. I noticed that meson timer vs arm timer makes a different for some frame rates so meson timer is recommended. For those wishing frame rate automation, it can be enabled with the following command:

Code: Select all

echo 2 | sudo tee /sys/class/tv/policy_fr_auto
A tip for those with a DLNA library is to use VLC to discover the URL of a title. In VLC, "View/Playlist" will show a library. On the left hand side is "Local Network" and "Universal Plug 'n' Play" under that will show all the DLNA servers on the network. After navigating to a title to play, right click and choose "Information". At the bottom of the resulting dialog will be "Location" with a "http://" address. Copy this address for use on the C2 command line.

Code: Select all

sudo ./c2play http://192.168.0.1:8200/MediaItems/11812.mkv

User avatar
mad_ady
Posts: 5822
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 64 times
Been thanked: 41 times
Contact:

Re: Command line video player

Unread post by mad_ady » Sat Aug 27, 2016 5:25 pm

I've tested your new version against the same videos I tested before. Now the HD mkv plays with audio in sync, but the sd avi still has about 1s delay (audio behind). The delay is apparent from the beginning and remains constant when fastforwarding. When I jump the old audio continues to play for a second and then jumps as well. Unfortunately the video is a non-free torrent, but I could cut 5 minutes and send you the link if you want

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Sat Aug 27, 2016 8:31 pm

It sounds like a muxing issue in the AVI itself. Statistically, the program maintains perfect sync internally. It even syncs media properly that Kodi failed to in testing I did. If you can PM me a link to a sample of the AVI, I will test it. The audio delay can be adjusted (+/-) in the program itself. I just have not exposed a command line argument to do it yet.

As an experiment, you can try using ffmpeg to re-mux (codec copy) the avi into a mkv. Typically, container errors will be reported during the process.

User avatar
mad_ady
Posts: 5822
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 64 times
Been thanked: 41 times
Contact:

Re: Command line video player

Unread post by mad_ady » Sun Aug 28, 2016 1:33 am

I PMed you a sample that causes problems. You are right, when I try to remux it to an mkv it fails:

Code: Select all

  Metadata:
    encoder         : VirtualDubMod 1.5.4.1 (build 2178/release)
    IAS1            : English
  Duration: 00:44:12.65, start: 0.000000, bitrate: 1104 kb/s
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 640x368 [SAR 1:1 DAR 40:23], 977 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 23.98 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, 113 kb/s
[matroska @ 0xd34dc0] Codec for stream 0 does not use global headers but container format requires global headers
[matroska @ 0xd34dc0] Codec for stream 1 does not use global headers but container format requires global headers
Output #0, matroska, to '../../../test-video.mkv':
  Metadata:
    IAS1            : English
    encoder         : Lavf56.40.101
    Stream #0:0: Video: mpeg4 (XVID / 0x44495658), yuv420p, 640x368 [SAR 1:1 DAR 40:23], q=2-31, 977 kb/s, 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, 113 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[matroska @ 0xd34dc0] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument
I'm guessing the reason kodi (and other players) play it correctly is because they must have all sorts of corner cases and tweaks built into them to handle broken files. If this is the case don't bother trying to fix every broken media :)

One more thing - If I play something with Kodi and later try to play with c2play I get sound and a black screen. Restarting X11 doesn't help, only restarting the device works. Also, after I play something with c2play and I later play something in kodi I sometimes see the framebuffer (systemd status messages) as a frame, but it disappears quickly. I thought you should know. :)

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Sun Aug 28, 2016 1:53 am

The sample provided plays correctly for me. It may be ALSA config related. I am using the default ALSA config in the Ubuntu image.
mad_ady wrote:One more thing - If I play something with Kodi and later try to play with c2play I get sound and a black screen. Restarting X11 doesn't help, only restarting the device works.
I suspect that Kodi is changing the "alpha enable" setting for the Amlogic display driver. I am currently developing a X11 version of the player and noticed these oddities too. I will likely need to also explicitly set the registers to enable/disable alpha in the X11 version.

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Sun Aug 28, 2016 4:59 pm

mad_ady wrote:Also, after I play something with c2play and I later play something in kodi I sometimes see the framebuffer (systemd status messages) as a frame, but it disappears quickly.
I have found the cause of this. There is now code in aml_libs that changes the video mode (alpha enable/disable) when a codec is opened or closed.
https://github.com/mdrjr/c2_aml_libs/bl ... #L705-L728
https://github.com/mdrjr/c2_aml_libs/bl ... #L877-L896

Each time the mode is changed, the fbdev driver redraws the console. This causes it to appear until something draws over it again. Therein lies the problem I am currently facing. In order to support subtitles, I can no longer blank the fbdev as was previously done. I need the fbdev layer visible to draw on. Now instead of blanking it, I clear it to transparent. However, as soon as I open the codec it changes the video mode and linux redraws the console. This means I need to re-clear the buffer each time the codec is opened or closed. Rather than implement work arounds, I would rather correct the cause of the issue and remove the mode setting code from aml_libs codec_init/codec_close functions. Applications need control over when and what the video mode is set to otherwise problems arise. For example, if a video application crashes or for some other reason never calls codec_close, the video mode is never restored and X11 displays improperly. There are also scenarios where the codec should be opened, but transparency not enabled as in the case of "zero copy" GLES rendering.

As a compromise, I would suggest moving the mode setting code in aml_libs to its own function to enable/disable transparency. This will allow code to determine when its appropriate to change the mode. The mode is not dependent on the codec being open or closed. The currently mode setting assumes we will always have a broken X11 driver and that future APIs like Wayland will need to implement the same broken behavior to function properly.

Since this change would affect Kodi, I am publicly discussing it here to collect feedback from anyone interested.

[edit]
More details ...
In a graph based frame work like OpenMax, GStreamer, and now the command line player, codec_init can not be called until the graph is started and the first video data has arrived detailing the codec format to use. This happens asynchronously in a graph. This means an application will need to monitor the graph continuously or in a call back to know that the codec has been opened and that screen needs to be cleared again. While an application like Kodi will clear the screen every frame mitigating this, it will also need to ensure the console is cleared so that when the mode switch happens only black is displayed instead of text. Clearing the screen each frame is no longer trivial when we are dealing with 4K displays. This places a lot of unnecessary memory bandwidth pressure on the bus. It is also pointless to clear the display each frame when only video is showing. My intended strategy is to only clear the display when needed and to use "dirty rectangles" to only update the part of the display that needs it. This reqruies work-around if the codec opening and closing causes the display contents to be "trashed".

[edit 2]
I played around with adding new entry points to aml_libs: codec_init_no_modeset and codec_close_no_modeset. This means that other programs will not require any changes and I can simply use the new API calls. However, it creates further disparity between the C2 API set and the C1. In the end, I am considering abandoning aml_libs. It is mainly a convience library that wraps driver IOCTLs. Since I do not require most of its functionality, it will probably be better if I just call the IOCTLs directly.

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Thu Sep 01, 2016 7:28 am

An alpha3 branch has been posted:
https://github.com/OtherCrashOverride/c ... ree/alpha3

* Added opus, vorbis audio codecs
* Added On Screen Display (OSD) when paused that shows video progress.
* X11 support: c2play-x11

The X11 dev package is required when building the X11 program:

Code: Select all

sudo apt install libx11-dev
Individual targets can be built by specifying them on the command line:

Code: Select all

make c2play
make c2play-x11
This allows the fbdev version to be compiled without having X11 present.

"Premake4" is now used to generate the make files.

Code: Select all

sudo apt install premake4
premake4 gmake
Known issues:
- Sometimes OSD is small with X11. This appears to be a bug in Mali not always setting the proper window surface size.
- If OSD does not appear with fbdev, the console needs to be unblanked before starting the program.
- "sudo" is required for correct operation with fbdev. The X11 version can be run as a regular user.

User avatar
mad_ady
Posts: 5822
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 64 times
Been thanked: 41 times
Contact:

Re: Command line video player

Unread post by mad_ady » Thu Sep 01, 2016 8:32 pm

For the git illiterate among us (me included) the way to grab the alpha3 branch is:

Code: Select all

git clone -b alpha3  https://github.com/OtherCrashOverride/c2play.git
I've compiled it and it seems to work, although I'm working over VNC, so I just see a black screen (which is expected since drawing goes directly to the fbdev). I'll try it at home as well when I get a bit of time.

One question though - the X11 version will never play video in a non-fullscreen window, will it? I understand that going windowed with X11 kills performance...

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Thu Sep 01, 2016 9:03 pm

mad_ady wrote:For the git illiterate among us (me included) the way to grab the alpha3 branch is:
yes, that should be correct.
mad_ady wrote:One question though - the X11 version will never play video in a non-fullscreen window, will it? I understand that going windowed with X11 kills performance...
The code currently supports playing video in a X11 window. It is disabled because as soon as transparency is enabled, most of the X11 display goes black. There is no performance impact from playing video in a window because its an illusion. The video layer is being scaled and translated to the window position and the window is drawn transparent. When the window is moved, the video layer is updated.

To test out video in a window:
1) change these lines to "#if 0"
https://github.com/OtherCrashOverride/c ... w.cpp#L243
https://github.com/OtherCrashOverride/c ... n.cpp#L278
Note that the second change disables all input to the player. This allows X11 to see mouse events to let you move and size the window.

To enable the feature by default, we need to fix the Mali DDX driver to work with alpha enabled. At this time the scope of that is unknown (by me).

User avatar
mad_ady
Posts: 5822
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 64 times
Been thanked: 41 times
Contact:

Re: Command line video player

Unread post by mad_ady » Sun Sep 04, 2016 2:18 pm

Ok, I've finally found time to test your alpha3 version (from 2 days ago) and I get a black screen with sound (both for c2play/c2play-x11). Perhaps I should try with a newer revision, but I'll be away for a week :(
Or is this linked to alpha blending?

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Sun Sep 04, 2016 9:51 pm

mad_ady wrote:I get a black screen with sound (both for c2play/c2play-x11).
The most likely cause of that would be "m_bpp" is set to something other than "32" in boot.ini.

Code: Select all

# HDMI BPP Mode
setenv m_bpp "32"
# setenv m_bpp "24"
# setenv m_bpp "16"
Only "32" supports the required alpha layer.

User avatar
mad_ady
Posts: 5822
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 64 times
Been thanked: 41 times
Contact:

Re: Command line video player

Unread post by mad_ady » Mon Sep 05, 2016 12:37 am

Hmm, it is set to 32:

Code: Select all

 adrianp@bellatrix:~$ cat /proc/cmdline
root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro console=ttyS0,115200n8 console=tty0 no_console_suspend hdmimode=720p60hz m_bpp=32 vout= fsck.repair=yes net.ifnames=0 elevator=noop disablehpd=true
I have a question about the network library - can I point it to chrome's cookie folder so that http queries send out relevant cookies as well?

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Mon Sep 05, 2016 1:40 am

All my testing is done with the HardKernel Ubuntu image. Since all the C2 hardware is the same, the program is all but guaranteed to work with this image. If it does not, it means that something has been customized or changed. Long term, its beneficial to know these things that may cause problems so that I can try to test for them and alert users. However, at this point, the focus is on getting the intended features implemented (alpha release). Once that is done (beta release), the focus will be on correcting issues that arise. There are too many radical changes during "alpha" to reliably indicate if a problem will still be present at "beta". If problems are encountered, it is recommended that a bug report be opened on the github page so that they are not forgotten. Where other projects have a team working on them, so far its just me working on c2play. Because of this, its important that I allocate my time efficiently (the program has become significantly more complex than its single .cpp origins). If an issue does not have an immediate and/or obvious resolution at this point (alpha), I will defer addressing it to the "beta" cycle.

Programs like Kodi often modify the driver state at very low levels. This creates a very large "target surface" for problem conditions. Testing should be done without previously running Kodi or any other video app. If a video app has been used, check if a reboot fixes the problem. During "beta" it should be verified that Kodi "plays well" with c2play and vice versa.
mad_ady wrote:I have a question about the network library - can I point it to chrome's cookie folder so that http queries send out relevant cookies as well?
Networking is handled externally by libavformat. If libavformat offers this support, then it should be possible to enable it. At the present, I have not investigated it.

Vitaliy_S
Posts: 16
Joined: Wed Sep 07, 2016 4:40 pm
languages_spoken: russian
Has thanked: 0
Been thanked: 0
Contact:

Re: Command line video player

Unread post by Vitaliy_S » Wed Sep 07, 2016 4:59 pm

Thank you for nice player, but there are problems on some video:

Code: Select all

# ./c2play "http://fritsch.fruehberger.net/samples/future-live-tv-hevc-10bit.ts"
added device: /dev/input/event5
added device: /dev/input/event4
added device: /dev/input/event3
added device: /dev/input/mouse1
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/event5
        bustype=16, vendor=7054, product=3308, version=1
        name=cec_input
InputDevice entering running state.
Device: /dev/input/event4
        bustype=3, vendor=6421, product=325, version=272
        name=MemsArt MA144 RF Controller
InputDevice entering running state.
Device: /dev/input/event3
        bustype=3, vendor=6421, product=325, version=272
        name=MemsArt MA144 RF Controller
InputDevice entering running state.
Device: /dev/input/mouse1
EVIOCGBIT failed.
Device: /dev/input/event2
        bustype=3, vendor=6421, product=325, version=272
        name=MemsArt MA144 RF Controller
InputDevice entering running state.
Device: /dev/input/event1
        bustype=16, vendor=1, product=1, version=256
        name=gpio_keypad
InputDevice entering running state.
Device: /dev/input/event0
        bustype=16, vendor=1, product=1, version=256
        name=aml_keypad
InputDevice entering running state.
Device: /dev/input/mouse0
EVIOCGBIT failed.
Device: /dev/input/mice
EVIOCGBIT failed.
Using input device: cec_input
Using input device: MemsArt MA144 RF Controller
Using input device: MemsArt MA144 RF Controller
Using input device: MemsArt MA144 RF Controller
Using input device: gpio_keypad
Using input device: aml_keypad
Source Metadata:
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] Error parsing NAL unit #2.
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] Error parsing NAL unit #2.
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] Error parsing NAL unit #2.
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] Error parsing NAL unit #2.
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] Error parsing NAL unit #2.
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] Error parsing NAL unit #2.
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] Error parsing NAL unit #2.
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] Error parsing NAL unit #2.
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] Error parsing NAL unit #2.
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] Error parsing NAL unit #2.
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] Error parsing NAL unit #2.
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] Error parsing NAL unit #2.
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] Error parsing NAL unit #2.
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] Error parsing NAL unit #2.
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] Error parsing NAL unit #2.
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] Error parsing NAL unit #2.
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] Error parsing NAL unit #2.
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] PPS id out of range: 0
[hevc @ 0x13650fd0] Error parsing NAL unit #2.
[mpegts @ 0x13649f10] PES packet size mismatch
Streams (count=2):
EXTRA DATA = 00 00 01 46 01 10 00 00 00 01 40 01 0c 06 ff ff 02 20 00 00 03 00 b0 00 00 03 00 00 03 00 99 00 00 97 2a 95 ca 48 12 00 00 00 01 42 01 06 02 20 00 00 03 00 b0 00 00 03 00 00 03 00 99 00 00 a0 01 e0 20 02 1c 4d 96 5c aa 57 29 32 48 d1 5c 02 00 00 03 00 02 00 00 03 00 64 c0 0b 94 bc 00 00 b3 4a 60 00 00 98 96 83 c0 00 0b 34 a6 00 00 09 89 68 3c 00 00 b3 4a 60 00 00 98 96 83 c0 00 0b 34 a6 00 00 09 89 68 24 00 00 00 01 44 01 c1 62 8f 06 24 
stream #0 - VIDEO/HEVC
        w=3840 h=2160 fps=50.000000(50/1) SAR=(0/1) 
stream #1 - AUDIO/UNKNOWN (0x15000)
MAIN:  audioSink Play.
Element (AudioSink) ChangeState oldState=0 newState=1.
MAIN:  audioCodec Play.
Element (AudioCodec) ChangeState oldState=0 newState=1.
MAIN:  videoSink Play.
Element (VideoSink) ChangeState oldState=0 newState=1.
[codec_resume]p->has_audio=0
MAIN:  source Play.
AmlVideoSink: ExtraData size=147
AmlVideoSink: Using standard time formula.
AmlVideoSink - VIDEO/HEVC
        w=3840 h=2160 fps=50.000000 am_sysinfo.rate=1921 
OPEN es hevc
Element (Source) ChangeState oldState=0 newState=1.
codec_init amstream version : 2.0
[codec_resume]p->has_audio=0
video_resume!
AmlVideoSinkElement: got marker buffer Marker=2
Header (pkt.size=e57f):
00 00 00 01 46 04 50 00 00 00 01 4e 04 01 02 74 
isAnnexB=1
AudioCodecElement: outInfo->SampleRate=48000, outInfo->Channels=2
Audio format 0 is not supported.
terminate called after throwing an instance of 'NotSupportedException'
Aborted (core dumped)
I`m compile c2play with old commit https://github.com/OtherCrashOverride/c ... 79aacc5b9c and this video play perfectly, but no avsync:

Code: Select all

# ./c2play "http://fritsch.fruehberger.net/samples/future-live-tv-hevc-10bit.ts"
added device: /dev/input/event5
added device: /dev/input/event4
added device: /dev/input/event3
added device: /dev/input/mouse1
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/event5
        bustype=16, vendor=7054, product=3308, version=1
        name=cec_input
InputDevice entering running state.
Device: /dev/input/event4
        bustype=3, vendor=6421, product=325, version=272
        name=MemsArt MA144 RF Controller
InputDevice entering running state.
Device: /dev/input/event3
        bustype=3, vendor=6421, product=325, version=272
        name=MemsArt MA144 RF Controller
InputDevice entering running state.
Device: /dev/input/mouse1
EVIOCGBIT failed.
Device: /dev/input/event2
        bustype=3, vendor=6421, product=325, version=272
        name=MemsArt MA144 RF Controller
InputDevice entering running state.
Device: /dev/input/event1
        bustype=16, vendor=1, product=1, version=256
        name=gpio_keypad
InputDevice entering running state.
Device: /dev/input/event0
        bustype=16, vendor=1, product=1, version=256
        name=aml_keypad
InputDevice entering running state.
Device: /dev/input/mouse0
EVIOCGBIT failed.
Device: /dev/input/mice
EVIOCGBIT failed.
Using input device: cec_input
Using input device: MemsArt MA144 RF Controller
Using input device: MemsArt MA144 RF Controller
Using input device: MemsArt MA144 RF Controller
Using input device: gpio_keypad
Using input device: aml_keypad
Source Metadata:
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] Error parsing NAL unit #2.
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] Error parsing NAL unit #2.
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] Error parsing NAL unit #2.
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] Error parsing NAL unit #2.
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] Error parsing NAL unit #2.
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] Error parsing NAL unit #2.
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] Error parsing NAL unit #2.
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] Error parsing NAL unit #2.
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] Error parsing NAL unit #2.
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] Error parsing NAL unit #2.
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] Error parsing NAL unit #2.
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] Error parsing NAL unit #2.
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] Error parsing NAL unit #2.
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] Error parsing NAL unit #2.
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] Error parsing NAL unit #2.
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] Error parsing NAL unit #2.
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] Error parsing NAL unit #2.
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] PPS id out of range: 0
[hevc @ 0x1661ca40] Error parsing NAL unit #2.
[mpegts @ 0x16615900] PES packet size mismatch
Streams (count=2):
stream #0 - VIDEO/HEVC
        fps=50.000000(50/1) SAR=(0/1) 
stream #1 - AUDIO/UNKNOWN (0x15000)
Chapters (count=0):
sampleRate = 48000
ALSA device can pause.
AmlVideoSink - VIDEO/HEVC
        fps=50.000000 am_sysinfo.rate=1920 
OPEN es hevc
codec_init amstream version : 2.0
AlsaAudioSink entering running state.
AmlVideoSink entering running state.
[codec_resume]p->has_audio=0
video_resume!
Header (pkt.size=e57f):
00 00 00 01 46 04 50 00 00 00 01 4e 04 01 02 74 
isAnnexB=1
snd_pcm_writei failed: Broken pipe
snd_pcm_recover
snd_pcm_writei failed: Broken pipe
snd_pcm_recover
snd_pcm_writei failed: Broken pipe
snd_pcm_recover
[mpegts @ 0x16615900] PES packet size mismatch
AlsaAudioSink exiting running state.
[codec_close_cntl]video codec close return=0!
OPEN es hevc
[codec_reset:1142]ret=0
AmlVideoSink exiting running state.
[codec_close_cntl]video codec close return=0!
http://fritsch.fruehberger.net/samples/zdf_dump.ts and http://fritsch.fruehberger.net/samples/zdf_raw_128.ts with last c2play also: terminate called after throwing an instance of 'NotSupportedException' Aborted (core dumped)

Any chance to fix this ?

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Wed Sep 07, 2016 10:59 pm

Vitaliy_S wrote:Any chance to fix this ?
According to the logs, the issue is that the audio is in MP2 format. Any audio codecs that I have not tested are aborted with "NotSupported". I will add support for "MP2" to the next release.

Vitaliy_S
Posts: 16
Joined: Wed Sep 07, 2016 4:40 pm
languages_spoken: russian
Has thanked: 0
Been thanked: 0
Contact:

Re: Command line video player

Unread post by Vitaliy_S » Thu Sep 08, 2016 1:01 am

crashoverride wrote: According to the logs, the issue is that the audio is in MP2 format.
Thanks! I add support for MP2 audio and ts file play fine!

Code: Select all

diff --git a/AudioCodec.cpp b/AudioCodec.cpp
index 84e19fa..f8079a7 100755
--- a/AudioCodec.cpp
+++ b/AudioCodec.cpp
@@ -32,6 +32,10 @@ void AudioCodecElement::SetupCodec()
 	case AudioFormatEnum::Dts:
 		soundCodec = avcodec_find_decoder(AV_CODEC_ID_DTS);
 		break;
+		
+	case AudioFormatEnum::Mpeg2Layer2:
+		soundCodec = avcodec_find_decoder(AV_CODEC_ID_MP2);
+		break;
 
 	case AudioFormatEnum::Mpeg2Layer3:
 		soundCodec = avcodec_find_decoder(AV_CODEC_ID_MP3);
diff --git a/MediaSourceElement.cpp b/MediaSourceElement.cpp
index a2dd2c7..907a266 100755
--- a/MediaSourceElement.cpp
+++ b/MediaSourceElement.cpp
@@ -237,6 +237,11 @@ void MediaSourceElement::SetupPins()
 
 			switch (codec_id)
 			{
+			case CODEC_ID_MP2:
+				printf("stream #%d - AUDIO/MP2\n", i);
+				if (info)
+					info->Format = AudioFormatEnum::Mpeg2Layer2;
+				break;
 			case CODEC_ID_MP3:
 				printf("stream #%d - AUDIO/MP3\n", i);
 				if (info)
diff --git a/Pin.h b/Pin.h
index 72ff13b..c94137f 100755
--- a/Pin.h
+++ b/Pin.h
@@ -57,6 +57,7 @@ enum class AudioFormatEnum
 {
 	Unknown = 0,
 	Pcm,
+	Mpeg2Layer2,
 	Mpeg2Layer3,
 	Ac3,
 	Aac,
Other problem with AAC audio:

Code: Select all

display '> Philips UHD supershopdemo 1.mkv'
Source Metadata:
        key=major_brand, value=mp42
        key=minor_version, value=0
        key=compatible_brands, value=isommp42
        key=creation_time, value=2015-02-13 09:58:34
[aac @ 0x7f7810fd60] This stream seems to incorrectly report its last channel as LFE[5], mapping to LFE[0]
Streams (count=2):
stream #0 - VIDEO/HEVC
        w=3840 h=2160 fps=24.000000(24/1) SAR=(0/1) 
stream #1 - AUDIO/AAC
Element (Source) Flush exited.
Element (AudioCodec) Flush exited.
Element (AudioSink) Flush exited.
Element (VideoSink) Flush exited.
Element (VideoSink) ChangeState oldState=0 newState=1.
[codec_resume]p->has_audio=0
Element (AudioCodec) ChangeState oldState=0 newState=1.
Element (AudioSink) ChangeState oldState=0 newState=1.
Element (Source) ChangeState oldState=0 newState=1.
AmlVideoSink: ExtraData size=127
AmlVideoSink - VIDEO/HEVC
        w=3840 h=2160 fps=24.000000 am_sysinfo.rate=4001 
OPEN es hevc
[codec_resume]p->has_audio=0
video_resume!
AmlVideoSinkElement: got marker buffer Marker=2
Header (pkt.size=7434b):
00 00 00 06 4e 01 81 01 07 80 00 00 00 0d 4e 01 
isAnnexB=0
AudioCodecElement: outInfo->SampleRate=48000, outInfo->Channels=6
[aac @ 0x7f5c06cdf0] This stream seems to incorrectly report its last channel as LFE[5], mapping to LFE[0]
Segmentation fault (core dumped)

Code: Select all

display '/media/HV620/Vikings - S01E01 - Rites of Passage HDTV-720p x265'
Source Metadata:
        key=encoder, value=libebml v1.3.1 + libmatroska v1.4.2
        key=creation_time, value=2015-05-05 07:18:42
[aac @ 0x7f542043c0] element type mismatch 3 != 0
[aac @ 0x7f542043c0] element type mismatch 1 != 0
[aac @ 0x7f542043c0] element type mismatch 1 != 0
Streams (count=3):
stream #0 - VIDEO/HEVC
        w=1920 h=1080 fps=23.976024(24000/1001) SAR=(1/1) 
stream #1 - AUDIO/AAC
stream #2 - SUBTITLE/HDMV_PGS_SUBTITLE
Chapter[00] = '00:00:00.000' : 0.000000
Chapter[01] = '00:04:15.755' : 255.755000
Chapter[02] = '00:07:52.055' : 472.055000
Chapter[03] = '00:11:29.647' : 689.647000
Chapter[04] = '00:16:48.591' : 1008.591000
Chapter[05] = '00:20:45.160' : 1245.160000
Chapter[06] = '00:22:56.542' : 1376.542000
Chapter[07] = '00:25:57.764' : 1557.764000
Chapter[08] = '00:28:41.428' : 1721.428000
Chapter[09] = '00:31:58.083' : 1918.083000
Chapter[10] = '00:36:12.962' : 2172.962000
Chapter[11] = '00:42:56.616' : 2576.616000
Element (Source) Flush exited.
Element (AudioCodec) Flush exited.
Element (AudioSink) Flush exited.
Element (VideoSink) Flush exited.
AmlVideoSink: ExtraData size=1006
AmlVideoSink - VIDEO/HEVC
        w=1920 h=1080 fps=23.976024 am_sysinfo.rate=4004 
OPEN es hevc
Element (VideoSink) ChangeState oldState=0 newState=1.
[codec_resume]p->has_audio=0
video_resume!
Element (AudioCodec) ChangeState oldState=0 newState=1.
Element (AudioSink) ChangeState oldState=0 newState=1.
Element (Source) ChangeState oldState=0 newState=1.
[codec_resume]p->has_audio=0
video_resume!
AmlVideoSinkElement: got marker buffer Marker=2
Header (pkt.size=51f):
00 00 00 AudioCodecElement: outInfo->SampleRate=48000, outInfo->Channels=6
19 40 01 0c 01 ff ff 01 60 00 00 03 00 
isAnnexB=0
[aac @ 0x7f4c8b55c0] element type mismatch 3 != 0
[aac @ 0x7f4c8b55c0] element type mismatch 1 != 0
[aac @ 0x7f4c8b55c0] element type mismatch 1 != 0
Segmentation fault (core dumped)
How fix Segmentation fault (core dumped) when error or format UNKNOWN ?

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Thu Sep 08, 2016 1:26 am

The segmentation fault likely occurs because:

Code: Select all

[aac @ 0x7f5c06cdf0] This stream seems to incorrectly report its last channel as LFE[5], mapping to LFE[0]
I will need to add code to test for broken AAC streams and remap accordingly for the downmix. If you wish to diagnose it yourself, you can use:

Code: Select all

gdb --args ./c2play yourmediafile
in GDB type "r" to run it and then when it faults type "bt" to get the back trace. It will tell you the line in the code where the fault occurs.

I hope to release an update to the alpha3 branch next week (Sept 12-16). It will add subtitle support making the program "feature complete". The focus will then be on fixing bugs for release.

Vitaliy_S
Posts: 16
Joined: Wed Sep 07, 2016 4:40 pm
languages_spoken: russian
Has thanked: 0
Been thanked: 0
Contact:

Re: Command line video player

Unread post by Vitaliy_S » Thu Sep 08, 2016 2:32 am

crashoverride wrote: I hope to release an update to the alpha3 branch next week (Sept 12-16). It will add subtitle support making the program "feature complete". The focus will then be on fixing bugs for release.
Please add codec_close(&codecContext) on program exit, for fix:

Code: Select all

retry_open [/dev/amstream_mpts] failed,ret = -1 error=16 used_times=1000*10(ms)
Error=1 errno=16 : Device or resource busy,func=codec_ts_init,line=543

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Fri Sep 09, 2016 8:22 am

Vitaliy_S wrote:Please add codec_close(&codecContext) on program exit, for fix:
Currently, the program only traps Cntrl-C to do clean up. This is by design at this point in development. Trapping errors/aborts would risk hiding them. Its important that any error conditions abort execution so that a debugger can capture the state. Cleaning up resources on abort would alter the program state making debug more difficult. If the program exits normally, the codec context is closed (AmlVIdeoSinkElement::Terminate).

Vitaliy_S
Posts: 16
Joined: Wed Sep 07, 2016 4:40 pm
languages_spoken: russian
Has thanked: 0
Been thanked: 0
Contact:

Re: Command line video player

Unread post by Vitaliy_S » Fri Sep 09, 2016 2:41 pm

crashoverride, Is it possible to make c2play as external shared library for use it in other projects ? It will be great!

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Sat Sep 10, 2016 1:40 am

Vitaliy_S wrote: Is it possible to make c2play as external shared library for use it in other projects ?
Part of the refactoring work done earlier was so that it could eventually be split out into a shared library for use by other projects. C2play would then just be a example of use of the library. There currently is no time frame for this; however, it is definitely a design goal.

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Wed Sep 14, 2016 10:57 am

I pushed an update to the alpha3 branch that includes subtitle support and fixes. This marks "feature complete" for the program and moves it to beta where the focus is on bug fixes for release. This should also be the last major architectural change to the code until after release. Future work will be on a new beta1 branch.
Vitaliy_S wrote:Other problem with AAC audio:
This issue was corrected.

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Wed Sep 14, 2016 3:24 pm

Vitaliy_S wrote:http://fritsch.fruehberger.net/samples/zdf_dump.ts and http://fritsch.fruehberger.net/samples/zdf_raw_128.ts with last c2play also: terminate called after throwing an instance of 'NotSupportedException' Aborted (core dumped)

Any chance to fix this ?
I have identified one of the issues as being 64bit time stamps in the MPEG-TS stream. After reviewing the codec kernel source code, only 32bit time stamps are supported. I have modified the player to mask the upper 32bit in all relevant timing calculations to allow playback.

I have also added support for the DVB and DVB Teletex streams present. They will be in the beta1 branch when I upload it.

Vitaliy_S
Posts: 16
Joined: Wed Sep 07, 2016 4:40 pm
languages_spoken: russian
Has thanked: 0
Been thanked: 0
Contact:

Re: Command line video player

Unread post by Vitaliy_S » Wed Sep 14, 2016 11:44 pm

Thank you!!! Great job!

AAC corrected, fine!

Some bugs:
1. http://fritsch.fruehberger.net/samples/ ... c-10bit.ts - black screen with last version
2. Often segmentation fault after Ctrl+C (or ESC) and always core dumped when UNKNOWN format

Code: Select all

^CMAIN: Playback finished.
MediaPlayer: terminating audioSink.
Element (AudioSink) ChangeState oldState=1 newState=0.
Element (AudioSink) Flush exited.
Element (AudioSink) InternalWorkThread - Terminating
Element (AudioSink) InternalWorkThread exited.
Segmentation fault (core dumped)
3. Why you not add MP2 audio support? Many ts files use MP2 audio

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Thu Sep 15, 2016 6:06 am

Vitaliy_S wrote:1. http://fritsch.fruehberger.net/samples/ ... c-10bit.ts - black screen with last version
I tested the sample and it plays without issue on the beta1 branch I am currently working on. There are some more items I need to complete before I push the beta1 branch to github.
Vitaliy_S wrote:2. Often segmentation fault after Ctrl+C (or ESC) and always core dumped when UNKNOWN format
I have not observed the segmentation fault on Cntrl+C with the alpha3 update published. If it is still present when beta1 is published, please report it as a bug. UNKNOWN format is designed to abort execution. Unlike Kodi where software decoding fallback is provided, c2play is hardware decoding only. For this reason, if a format is not known, execution can not proceed. The abort removes ambiguity from someone reporting a black screen or no sound issue: if the program does not abort, then the content is meant to play correctly.
Vitaliy_S wrote:3. Why you not add MP2 audio support? Many ts files use MP2 audio
This was added for beta1.

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Thu Sep 15, 2016 10:14 am

I pushed the beta1 branch to github:
https://github.com/OtherCrashOverride/c2play/tree/beta1

Vitaliy_S
Posts: 16
Joined: Wed Sep 07, 2016 4:40 pm
languages_spoken: russian
Has thanked: 0
Been thanked: 0
Contact:

Re: Command line video player

Unread post by Vitaliy_S » Thu Sep 15, 2016 12:06 pm

Wow, thanks! I will try
---
Upd.
I tested, beta1 more stable, aml_libs not need anymore, cool!
http://fritsch.fruehberger.net/samples/zdf_raw_128.ts and many other media files plays fine!
http://fritsch.fruehberger.net/samples/1080i50.ts - audio play, video paused, adjust pts not worked, after Ctrl+C Segmentation fault (core dumped):

Code: Select all

c2play "http://fritsch.fruehberger.net/samples/1080i50.ts"
added device: /dev/input/event5
added device: /dev/input/event4
added device: /dev/input/event3
added device: /dev/input/mouse1
added device: /dev/input/event2
added device: /dev/input/event1
added device: /dev/input/mouse0
added device: /dev/input/event0
added device: /dev/input/mice
Device: /dev/input/event5
        bustype=16, vendor=7054, product=3308, version=1
        name=cec_input
InputDevice entering running state.
Device: /dev/input/event4
        bustype=16, vendor=1, product=1, version=256
        name=gpio_keypad
InputDevice entering running state.
Device: /dev/input/event3
        bustype=16, vendor=1, product=1, version=256
        name=aml_keypad
InputDevice entering running state.
Device: /dev/input/mouse1
EVIOCGBIT failed.
Device: /dev/input/event2
        bustype=3, vendor=6421, product=325, version=272
        name=MemsArt MA144 RF Controller
InputDevice entering running state.
Device: /dev/input/event1
        bustype=3, vendor=6421, product=325, version=272
        name=MemsArt MA144 RF Controller
InputDevice entering running state.
Device: /dev/input/mouse0
EVIOCGBIT failed.
Device: /dev/input/event0
        bustype=3, vendor=6421, product=325, version=272
        name=MemsArt MA144 RF Controller
InputDevice entering running state.
Device: /dev/input/mice
EVIOCGBIT failed.
Using input device: cec_input
Using input device: gpio_keypad
Using input device: aml_keypad
Using input device: MemsArt MA144 RF Controller
Using input device: MemsArt MA144 RF Controller
Using input device: MemsArt MA144 RF Controller
EGL: major=1, minor=4
EGL: Vendor=ARM
EGL: Version=1.4 Linux-r5p1-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_lock_surface EGL_KHR_lock_surface2 EGL_EXT_create_context_robustness EGL_ANDROID_blob_cache EGL_KHR_create_context 
EGL: ClientExtensions=(null)

Source Metadata:
[h264 @ 0x17b4ebc0] mmco: unref short failure
[h264 @ 0x17b4ebc0] mmco: unref short failure
[h264 @ 0x17b4ebc0] Increasing reorder buffer to 2
[h264 @ 0x17b4ebc0] mmco: unref short failure
[mpegts @ 0x17b47b10] PES packet size mismatch
Streams (count=2):
stream #0 - VIDEO/H264
        w=1920 h=1080 fps=25.000000(25/1) SAR=(0/1) 
stream #1 - AUDIO/AC3
Element (AudioCodec) Flush exited.
Element (AudioSink) Flush exited.
AmlVideoSinkElement: calling base.
Element (VideoSink) Flush exited.
AmlVideoSinkElement: Flush exited.
Element (Source) Flush exited.
AmlVideoSink: ExtraData size=46
AmlVideoSink - VIDEO/H264
Element (VideoSink) ChangeState oldState=0 newState=1.
Element (AudioCodec) ChangeState oldState=0 newState=1.
Element (AudioSink) ChangeState oldState=0 newState=1.
Element (Source) ChangeState oldState=0 newState=1.
        w=1920 h=1080 fps=25.000000 am_sysinfo.rate=3841 
AmlVideoSinkElement: got marker buffer Marker=2
Header (pkt.size=2e2a5):
00 00 00 01 09 10 00 00 00 01 27 64 00 28 ac 34 
isAnnexB=1
AudioCodecElement: outInfo->SampleRate=48000, outInfo->Channels=2
AlsaAudioSinkElement: isFirstData changed.
SetupAlsa: frameSize=1536
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.612211 vpts=31373.199056 drift=0.586844 (14.671111 frames)
AmlVideoSink: Adjust PTS - pts=31372.613544 vpts=31373.199056 drift=0.585511 (14.637778 frames)
AmlVideoSink: Adjust PTS - pts=31372.614211 vpts=31373.199056 drift=0.584844 (14.621111 frames)
AmlVideoSink: Adjust PTS - pts=31372.614878 vpts=31373.199056 drift=0.584178 (14.604444 frames)
AmlVideoSink: Adjust PTS - pts=31372.646211 vpts=31373.199056 drift=0.552844 (13.821111 frames)
AmlVideoSink: Adjust PTS - pts=31372.646878 vpts=31373.199056 drift=0.552178 (13.804444 frames)
AmlVideoSink: Adjust PTS - pts=31372.647544 vpts=31373.199056 drift=0.551511 (13.787778 frames)
AmlVideoSink: Adjust PTS - pts=31372.648211 vpts=31373.199056 drift=0.550844 (13.771111 frames)
AmlVideoSink: Adjust PTS - pts=31372.785544 vpts=31373.199056 drift=0.413511 (10.337778 frames)
AmlVideoSink: Adjust PTS - pts=31372.786211 vpts=31373.199056 drift=0.412844 (10.321111 frames)
AmlVideoSink: Adjust PTS - pts=31372.786211 vpts=31373.199056 drift=0.412844 (10.321111 frames)
AmlVideoSink: Adjust PTS - pts=31372.786211 vpts=31373.199056 drift=0.412844 (10.321111 frames)
AmlVideoSink: Adjust PTS - pts=31372.955544 vpts=31373.199056 drift=0.243511 (6.087778 frames)
AmlVideoSink: Adjust PTS - pts=31372.956211 vpts=31373.199056 drift=0.242844 (6.071111 frames)
AmlVideoSink: Adjust PTS - pts=31372.956211 vpts=31373.199056 drift=0.242844 (6.071111 frames)
AmlVideoSink: Adjust PTS - pts=31372.956211 vpts=31373.199056 drift=0.242844 (6.071111 frames)
AmlVideoSink: Adjust PTS - pts=31372.956211 vpts=31373.199056 drift=0.242844 (6.071111 frames)
AmlVideoSink: Adjust PTS - pts=31373.295544 vpts=0.120033 drift=-31373.175511 (-784329.387778 frames)
AmlVideoSink: Adjust PTS - pts=31373.296211 vpts=0.120033 drift=-31373.176178 (-784329.404444 frames)
AmlVideoSink: Adjust PTS - pts=31373.296211 vpts=0.120033 drift=-31373.176178 (-784329.404444 frames)
AmlVideoSink: Adjust PTS - pts=31373.296211 vpts=0.120033 drift=-31373.176178 (-784329.404444 frames)
AmlVideoSink: Adjust PTS - pts=31373.296211 vpts=0.120033 drift=-31373.176178 (-784329.404444 frames)
AmlVideoSink: Adjust PTS - pts=31373.465544 vpts=0.120033 drift=-31373.345511 (-784333.637778 frames)
AmlVideoSink: Adjust PTS - pts=31373.466211 vpts=0.120033 drift=-31373.346178 (-784333.654444 frames)
AmlVideoSink: Adjust PTS - pts=31373.466211 vpts=0.120033 drift=-31373.346178 (-784333.654444 frames)
AmlVideoSink: Adjust PTS - pts=31373.466211 vpts=0.120033 drift=-31373.346178 (-784333.654444 frames)
AmlVideoSink: Adjust PTS - pts=31373.466211 vpts=0.120033 drift=-31373.346178 (-784333.654444 frames)
AmlVideoSink: Adjust PTS - pts=31373.645544 vpts=0.120033 drift=-31373.525511 (-784338.137778 frames)
AmlVideoSink: Adjust PTS - pts=31373.646211 vpts=0.120033 drift=-31373.526178 (-784338.154444 frames)
AmlVideoSink: Adjust PTS - pts=31373.646211 vpts=0.120033 drift=-31373.526178 (-784338.154444 frames)
AmlVideoSink: Adjust PTS - pts=31373.646878 vpts=0.120033 drift=-31373.526844 (-784338.171111 frames)
AmlVideoSink: Adjust PTS - pts=31373.646878 vpts=0.120033 drift=-31373.526844 (-784338.171111 frames)
AmlVideoSink: Adjust PTS - pts=31373.815544 vpts=0.120033 drift=-31373.695511 (-784342.387778 frames)
AmlVideoSink: Adjust PTS - pts=31373.816211 vpts=0.120033 drift=-31373.696178 (-784342.404444 frames)
AmlVideoSink: Adjust PTS - pts=31373.816211 vpts=0.120033 drift=-31373.696178 (-784342.404444 frames)
AmlVideoSink: Adjust PTS - pts=31373.816878 vpts=0.120033 drift=-31373.696844 (-784342.421111 frames)
AmlVideoSink: Adjust PTS - pts=31373.816878 vpts=0.120033 drift=-31373.696844 (-784342.421111 frames)
AmlVideoSink: Adjust PTS - pts=31373.985544 vpts=0.120033 drift=-31373.865511 (-784346.637778 frames)
AmlVideoSink: Adjust PTS - pts=31373.986211 vpts=0.120033 drift=-31373.866178 (-784346.654444 frames)
AmlVideoSink: Adjust PTS - pts=31373.986211 vpts=0.120033 drift=-31373.866178 (-784346.654444 frames)
AmlVideoSink: Adjust PTS - pts=31373.986878 vpts=0.120033 drift=-31373.866844 (-784346.671111 frames)
AmlVideoSink: Adjust PTS - pts=31373.986878 vpts=0.120033 drift=-31373.866844 (-784346.671111 frames)
AmlVideoSink: Adjust PTS - pts=31374.155544 vpts=0.120033 drift=-31374.035511 (-784350.887778 frames)
AmlVideoSink: Adjust PTS - pts=31374.156211 vpts=0.120033 drift=-31374.036178 (-784350.904444 frames)
AmlVideoSink: Adjust PTS - pts=31374.156878 vpts=0.120033 drift=-31374.036844 (-784350.921111 frames)
AmlVideoSink: Adjust PTS - pts=31374.157544 vpts=0.120033 drift=-31374.037511 (-784350.937778 frames)
AmlVideoSink: Adjust PTS - pts=31374.157544 vpts=0.120033 drift=-31374.037511 (-784350.937778 frames)
AmlVideoSink: Adjust PTS - pts=31374.242211 vpts=0.120033 drift=-31374.122178 (-784353.054444 frames)
AmlVideoSink: Adjust PTS - pts=31374.244211 vpts=0.120033 drift=-31374.124178 (-784353.104444 frames)
AmlVideoSink: Adjust PTS - pts=31374.246878 vpts=0.120033 drift=-31374.126844 (-784353.171111 frames)
AmlVideoSink: Adjust PTS - pts=31374.248878 vpts=0.120033 drift=-31374.128844 (-784353.221111 frames)
AmlVideoSink: Adjust PTS - pts=31374.326211 vpts=0.120033 drift=-31374.206178 (-784355.154444 frames)
AmlVideoSink: Adjust PTS - pts=31374.326211 vpts=0.120033 drift=-31374.206178 (-784355.154444 frames)
AmlVideoSink: Adjust PTS - pts=31374.495544 vpts=0.120033 drift=-31374.375511 (-784359.387778 frames)
AmlVideoSink: Adjust PTS - pts=31374.496211 vpts=0.120033 drift=-31374.376178 (-784359.404444 frames)
AmlVideoSink: Adjust PTS - pts=31374.496878 vpts=0.120033 drift=-31374.376844 (-784359.421111 frames)
AmlVideoSink: Adjust PTS - pts=31374.496878 vpts=0.120033 drift=-31374.376844 (-784359.421111 frames)
AmlVideoSink: Adjust PTS - pts=31374.496878 vpts=0.120033 drift=-31374.376844 (-784359.421111 frames)
AmlVideoSink: Adjust PTS - pts=31374.665544 vpts=0.120033 drift=-31374.545511 (-784363.637778 frames)
AmlVideoSink: Adjust PTS - pts=31374.666211 vpts=0.120033 drift=-31374.546178 (-784363.654444 frames)
AmlVideoSink: Adjust PTS - pts=31374.666878 vpts=0.120033 drift=-31374.546844 (-784363.671111 frames)
AmlVideoSink: Adjust PTS - pts=31374.666878 vpts=0.120033 drift=-31374.546844 (-784363.671111 frames)
AmlVideoSink: Adjust PTS - pts=31374.667544 vpts=0.120033 drift=-31374.547511 (-784363.687778 frames)
AmlVideoSink: Adjust PTS - pts=31374.835544 vpts=0.120033 drift=-31374.715511 (-784367.887778 frames)
AmlVideoSink: Adjust PTS - pts=31374.836211 vpts=0.120033 drift=-31374.716178 (-784367.904444 frames)
AmlVideoSink: Adjust PTS - pts=31374.836211 vpts=0.120033 drift=-31374.716178 (-784367.904444 frames)
AmlVideoSink: Adjust PTS - pts=31374.836878 vpts=0.120033 drift=-31374.716844 (-784367.921111 frames)
AmlVideoSink: Adjust PTS - pts=31374.836878 vpts=0.120033 drift=-31374.716844 (-784367.921111 frames)
AmlVideoSink: Adjust PTS - pts=31375.005544 vpts=0.120033 drift=-31374.885511 (-784372.137778 frames)
AmlVideoSink: Adjust PTS - pts=31375.005544 vpts=0.120033 drift=-31374.885511 (-784372.137778 frames)
AmlVideoSink: Adjust PTS - pts=31375.006211 vpts=0.120033 drift=-31374.886178 (-784372.154444 frames)
AmlVideoSink: Adjust PTS - pts=31375.006211 vpts=0.120033 drift=-31374.886178 (-784372.154444 frames)
AmlVideoSink: Adjust PTS - pts=31375.175544 vpts=0.120033 drift=-31375.055511 (-784376.387778 frames)
AmlVideoSink: Adjust PTS - pts=31375.176211 vpts=0.120033 drift=-31375.056178 (-784376.404444 frames)
AmlVideoSink: Adjust PTS - pts=31375.176878 vpts=0.120033 drift=-31375.056844 (-784376.421111 frames)
AmlVideoSink: Adjust PTS - pts=31375.176878 vpts=0.120033 drift=-31375.056844 (-784376.421111 frames)
AmlVideoSink: Adjust PTS - pts=31375.177544 vpts=0.120033 drift=-31375.057511 (-784376.437778 frames)
AmlVideoSink: Adjust PTS - pts=31375.178211 vpts=0.120033 drift=-31375.058178 (-784376.454444 frames)
AmlVideoSink: Adjust PTS - pts=31375.345544 vpts=0.120033 drift=-31375.225511 (-784380.637778 frames)
AmlVideoSink: Adjust PTS - pts=31375.346211 vpts=0.120033 drift=-31375.226178 (-784380.654444 frames)
AmlVideoSink: Adjust PTS - pts=31375.346878 vpts=0.120033 drift=-31375.226844 (-784380.671111 frames)
AmlVideoSink: Adjust PTS - pts=31375.347544 vpts=0.120033 drift=-31375.227511 (-784380.687778 frames)
AmlVideoSink: Adjust PTS - pts=31375.515544 vpts=0.120033 drift=-31375.395511 (-784384.887778 frames)
AmlVideoSink: Adjust PTS - pts=31375.516211 vpts=0.120033 drift=-31375.396178 (-784384.904444 frames)
AmlVideoSink: Adjust PTS - pts=31375.516211 vpts=0.120033 drift=-31375.396178 (-784384.904444 frames)
AmlVideoSink: Adjust PTS - pts=31375.516878 vpts=0.120033 drift=-31375.396844 (-784384.921111 frames)
AmlVideoSink: Adjust PTS - pts=31375.685544 vpts=0.120033 drift=-31375.565511 (-784389.137778 frames)
AmlVideoSink: Adjust PTS - pts=31375.686211 vpts=0.120033 drift=-31375.566178 (-784389.154444 frames)
AmlVideoSink: Adjust PTS - pts=31375.686211 vpts=0.120033 drift=-31375.566178 (-784389.154444 frames)
AmlVideoSink: Adjust PTS - pts=31375.686211 vpts=0.120033 drift=-31375.566178 (-784389.154444 frames)
AmlVideoSink: Adjust PTS - pts=31375.686878 vpts=0.120033 drift=-31375.566844 (-784389.171111 frames)
AmlVideoSink: Adjust PTS - pts=31375.686878 vpts=0.120033 drift=-31375.566844 (-784389.171111 frames)
AmlVideoSink: Adjust PTS - pts=31375.855544 vpts=0.120033 drift=-31375.735511 (-784393.387778 frames)
AmlVideoSink: Adjust PTS - pts=31375.856211 vpts=0.120033 drift=-31375.736178 (-784393.404444 frames)
AmlVideoSink: Adjust PTS - pts=31375.856878 vpts=0.120033 drift=-31375.736844 (-784393.421111 frames)
AmlVideoSink: Adjust PTS - pts=31376.025544 vpts=0.120033 drift=-31375.905511 (-784397.637778 frames)
AmlVideoSink: Adjust PTS - pts=31376.026211 vpts=0.120033 drift=-31375.906178 (-784397.654444 frames)
AmlVideoSink: Adjust PTS - pts=31376.027544 vpts=0.120033 drift=-31375.907511 (-784397.687778 frames)
AmlVideoSink: Adjust PTS - pts=31376.028211 vpts=0.120033 drift=-31375.908178 (-784397.704444 frames)
AmlVideoSink: Adjust PTS - pts=31376.028878 vpts=0.120033 drift=-31375.908844 (-784397.721111 frames)
AmlVideoSink: Adjust PTS - pts=31376.205544 vpts=0.120033 drift=-31376.085511 (-784402.137778 frames)
AmlVideoSink: Adjust PTS - pts=31376.205544 vpts=0.120033 drift=-31376.085511 (-784402.137778 frames)
AmlVideoSink: Adjust PTS - pts=31376.206211 vpts=0.120033 drift=-31376.086178 (-784402.154444 frames)
AmlVideoSink: Adjust PTS - pts=31376.206211 vpts=0.120033 drift=-31376.086178 (-784402.154444 frames)
AmlVideoSink: Adjust PTS - pts=31376.206211 vpts=0.120033 drift=-31376.086178 (-784402.154444 frames)
AmlVideoSink: Adjust PTS - pts=31376.206878 vpts=0.120033 drift=-31376.086844 (-784402.171111 frames)
AmlVideoSink: Adjust PTS - pts=31376.375544 vpts=0.120033 drift=-31376.255511 (-784406.387778 frames)
AmlVideoSink: Adjust PTS - pts=31376.376211 vpts=0.120033 drift=-31376.256178 (-784406.404444 frames)
AmlVideoSink: Adjust PTS - pts=31376.376878 vpts=0.120033 drift=-31376.256844 (-784406.421111 frames)
AmlVideoSink: Adjust PTS - pts=31376.376878 vpts=0.120033 drift=-31376.256844 (-784406.421111 frames)
AmlVideoSink: Adjust PTS - pts=31376.377544 vpts=0.120033 drift=-31376.257511 (-784406.437778 frames)
AmlVideoSink: Adjust PTS - pts=31376.546211 vpts=0.120033 drift=-31376.426178 (-784410.654444 frames)
AmlVideoSink: Adjust PTS - pts=31376.546878 vpts=0.120033 drift=-31376.426844 (-784410.671111 frames)
AmlVideoSink: Adjust PTS - pts=31376.548211 vpts=0.120033 drift=-31376.428178 (-784410.704444 frames)
AmlVideoSink: Adjust PTS - pts=31376.548878 vpts=0.120033 drift=-31376.428844 (-784410.721111 frames)
AmlVideoSink: Adjust PTS - pts=31376.550211 vpts=0.120033 drift=-31376.430178 (-784410.754444 frames)
AmlVideoSink: Adjust PTS - pts=31376.550878 vpts=0.120033 drift=-31376.430844 (-784410.771111 frames)
AmlVideoSink: Adjust PTS - pts=31376.715544 vpts=0.120033 drift=-31376.595511 (-784414.887778 frames)
AmlVideoSink: Adjust PTS - pts=31376.716211 vpts=0.120033 drift=-31376.596178 (-784414.904444 frames)
AmlVideoSink: Adjust PTS - pts=31376.716211 vpts=0.120033 drift=-31376.596178 (-784414.904444 frames)
AmlVideoSink: Adjust PTS - pts=31376.716878 vpts=0.120033 drift=-31376.596844 (-784414.921111 frames)
AmlVideoSink: Adjust PTS - pts=31376.716878 vpts=0.120033 drift=-31376.596844 (-784414.921111 frames)
AmlVideoSink: Adjust PTS - pts=31376.885544 vpts=0.120033 drift=-31376.765511 (-784419.137778 frames)
AmlVideoSink: Adjust PTS - pts=31376.886878 vpts=0.120033 drift=-31376.766844 (-784419.171111 frames)
AmlVideoSink: Adjust PTS - pts=31376.886878 vpts=0.120033 drift=-31376.766844 (-784419.171111 frames)
AmlVideoSink: Adjust PTS - pts=31376.887544 vpts=0.120033 drift=-31376.767511 (-784419.187778 frames)
AmlVideoSink: Adjust PTS - pts=31376.888211 vpts=0.120033 drift=-31376.768178 (-784419.204444 frames)
AmlVideoSink: Adjust PTS - pts=31377.055544 vpts=0.120033 drift=-31376.935511 (-784423.387778 frames)
AmlVideoSink: Adjust PTS - pts=31377.056878 vpts=0.120033 drift=-31376.936844 (-784423.421111 frames)
AmlVideoSink: Adjust PTS - pts=31377.056878 vpts=0.120033 drift=-31376.936844 (-784423.421111 frames)
AmlVideoSink: Adjust PTS - pts=31377.057544 vpts=0.120033 drift=-31376.937511 (-784423.437778 frames)
AmlVideoSink: Adjust PTS - pts=31377.058211 vpts=0.120033 drift=-31376.938178 (-784423.454444 frames)
AmlVideoSink: Adjust PTS - pts=31377.226211 vpts=0.120033 drift=-31377.106178 (-784427.654444 frames)
AmlVideoSink: Adjust PTS - pts=31377.226878 vpts=0.120033 drift=-31377.106844 (-784427.671111 frames)
AmlVideoSink: Adjust PTS - pts=31377.227544 vpts=0.120033 drift=-31377.107511 (-784427.687778 frames)
AmlVideoSink: Adjust PTS - pts=31377.228211 vpts=0.120033 drift=-31377.108178 (-784427.704444 frames)
AmlVideoSink: Adjust PTS - pts=31377.228211 vpts=0.120033 drift=-31377.108178 (-784427.704444 frames)
AmlVideoSink: Adjust PTS - pts=31377.228878 vpts=0.120033 drift=-31377.108844 (-784427.721111 frames)
^CMAIN: Playback finished.
MediaPlayer: terminating audioSink.
Element (AudioSink) ChangeState oldState=1 newState=0.
Element (AudioSink) Flush exited.
Element (AudioSink) InternalWorkThread - Terminating
Element (AudioSink) InternalWorkThread exited.
Segmentation fault (core dumped)
http://fritsch.fruehberger.net/samples/zdf_dump.ts and http://fritsch.fruehberger.net/samples/n24hd-runtext.ts also plays not correctly

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Fri Sep 16, 2016 4:22 am

I am able to reproduce the issue with the streams provided and am investigating. However, I can not reproduce the "Cntrl-C segmentation fault" problem. Try rebuilding the source with:

Code: Select all

make clean
premake4 gmake
make c2play-x11
I also noted that after using Kodi, c2play shows only a black screen when playing video. The following setting is altered by Kodi and needs to be reset:

Code: Select all

echo 0 | sudo tee /sys/class/video/disable_video

crashoverride
Posts: 4395
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 34 times
Contact:

Re: Command line video player

Unread post by crashoverride » Fri Sep 16, 2016 5:19 am

The patch to fix the playback of the reported streams was pushed to github.

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 2 guests