Command line video player

Moderators: mdrjr, odroid

Re: Command line video player

Unread postby rooted » Fri Aug 24, 2018 4:14 am

aer wrote: 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.


aplay is in alsa-utils package

Code: Select all
sudo apt install alsa-utils
User avatar
rooted
 
Posts: 5474
Joined: Fri Dec 19, 2014 9:12 am
Location: Gulf of Mexico, US
languages_spoken: english
ODROIDs: C1, C1+, C2
XU3 Lite, XU4
N1
VU7+
HiFi Shield 2
Smart Power (original)

Re: Command line video player

Unread postby crashoverride » Fri Aug 24, 2018 8:02 pm

pro777 wrote:Is there a problem with support for the VP9 codec?

Neither the S905 nor the S805 support VP9 in hardware.

pro777 wrote:It would be good to add the support of MSMPEG4v1 and MSMPEG4v2 codecs

pro777 wrote: as well the audio codec PCM_s16le.

I currently have no plans to support those formats since they are rare.

pro777 wrote:The release version when you try to play ends with an error:

pro777 wrote:In addition, the X11 version of the player displays a black screen instead of video, but there is sound.

Only the C1 and C2 hardware are supported. I do not have any S912 hardware to test on and have no plans to support it. The issues reported do not occur on supported hardware using a supported distro (ubuntu 16.04/18.04).

pro777 wrote:It would be convenient to add the display of the current position of playing in the format HH:MM:SS in pause mode.

c2play is not intended to be a full featured media player. For advanced features, Kodi or MPV is recommended.
crashoverride
 
Posts: 3924
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: Command line video player

Unread postby crashoverride » Fri Aug 24, 2018 8:05 pm

aer wrote:How can I enable I2S for use with c2play?

c2play uses ALSA for sound output. ALSA will need to be configured to use I2S.
crashoverride
 
Posts: 3924
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: Command line video player

Unread postby aer » Sun Aug 26, 2018 6:36 pm

Ok, thanks, that solved it.
aer
 
Posts: 4
Joined: Thu Aug 23, 2018 11:17 pm
languages_spoken: english
ODROIDs: C2

Re: Command line video player

Unread postby aer » Wed Aug 29, 2018 8:00 am

@crashoverride is it possible to change the rendering of the subtitles: i.e. font, outline color, etc.? I see in the code libass is given a 'sans serif'. I could of course drop a sans serif named font in a directory to change that? But doesn't seem an elegant solution. Can you point me where in the code the rendering options are set? Thanks for c2play btw, almost solves my problems creating a kiosk-like setup.

Update: I have been looking into the libass code more. It seems I have to call void ass_set_style_overrides(ASS_Library *priv, char **list); and override the styles I want to change. I am no c++ programmer, so how can I call that function with the right syntax for list?
aer
 
Posts: 4
Joined: Thu Aug 23, 2018 11:17 pm
languages_spoken: english
ODROIDs: C2

Re: Command line video player

Unread postby crashoverride » Thu Aug 30, 2018 4:55 pm

aer wrote:Can you point me where in the code the rendering options are set?

The options are set here:
https://github.com/OtherCrashOverride/c2play/blob/ba4f6a9dea9813211325d2cd5c1bd631fcabe644/src/Media/SubtitleCodecElement.cpp#L526-L534

aer wrote:It seems I have to call void ass_set_style_overrides(ASS_Library *priv, char **list); and override the styles I want to change. I am no c++ programmer, so how can I call that function with the right syntax for list?

"char **list" is most likely an "array of char*". This would imply it expects an array of pointers to null terminated strings. Since there is no count parameter, it probably expects a null pointer to terminate the array. As an example:
Code: Select all
const char* list[] = { "item1", "item2", "item3", NULL };

I have not verified any of the above. It is just an educated guess. The libass documentation (if any?) will need to be consulted. Also note that the example is "const char*" and not "char*". The former can not be altered while the later implied either an error in API definition (requiring a cast) or the library will modify the string requiring dynamic allocation (malloc).
crashoverride
 
Posts: 3924
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: Command line video player

Unread postby aer » Thu Aug 30, 2018 6:14 pm

crashoverride wrote:
aer wrote:Can you point me where in the code the rendering options are set?

The options are set here:
https://github.com/OtherCrashOverride/c2play/blob/ba4f6a9dea9813211325d2cd5c1bd631fcabe644/src/Media/SubtitleCodecElement.cpp#L526-L534

aer wrote:It seems I have to call void ass_set_style_overrides(ASS_Library *priv, char **list); and override the styles I want to change. I am no c++ programmer, so how can I call that function with the right syntax for list?

"char **list" is most likely an "array of char*". This would imply it expects an array of pointers to null terminated strings. Since there is no count parameter, it probably expects a null pointer to terminate the array. As an example:
Code: Select all
const char* list[] = { "item1", "item2", "item3", NULL };

I have not verified any of the above. It is just an educated guess. The libass documentation (if any?) will need to be consulted. Also note that the example is "const char*" and not "char*". The former can not be altered while the later implied either an error in API definition (requiring a cast) or the library will modify the string requiring dynamic allocation (malloc).


The compiler doesn't like that const char* list[], it complains with:
error: invalid conversion from ‘const char**’ to ‘char**’ [-fpermissive]

However I already got it working with a warning:
Code: Select all
char *list[] = {"Outline=0", 0};
warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]

The font outline is now disabled, but still cannot change the font.
I also tried changing sans-serif to monospace on line 533 or pointing to a font directory but that won't yield any results.

A debugging issue cropped up with subtitles. When I have a few subtitles on a test video, when I stop c2play, it seems it just waits till the scheduled subtitles are timeout?
aer
 
Posts: 4
Joined: Thu Aug 23, 2018 11:17 pm
languages_spoken: english
ODROIDs: C2

Re: Command line video player

Unread postby crashoverride » Thu Aug 30, 2018 8:30 pm

aer wrote:The compiler doesn't like that const char* list[], it complains with:
error: invalid conversion from ‘const char**’ to ‘char**’ [-fpermissive]

However I already got it working with a warning:

Code: Select all
char *list[] = {"Outline=0", 0};
warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]

That is exactly why i stated:
crashoverride wrote:Also note that the example is "const char*" and not "char*". The former can not be altered while the later implied either an error in API definition (requiring a cast) or the library will modify the string requiring dynamic allocation (malloc).


aer wrote:it seems it just waits till the scheduled subtitles are timeout?

I don't think there is any logic to flush subtitle data when prematurely stopped.
crashoverride
 
Posts: 3924
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: Command line video player

Unread postby pcarrillom » Wed Sep 12, 2018 4:24 am

Hello,

I have a working C2play-x11 in an Odroid C2 with Ubuntu 18.04. So far so good. Thanks for the hard work!.
I`m receiving some udp video streams that have one video and multiple audio programs on it. I can play the video and select which audio program to play with the command line, however, I need to play Left channel output with left channel of the first audio program and the right channel output with the right channel of the second audio program. Is this something that can be done directly with c2play?

Thanks for the suggestions.
pcarrillom
 
Posts: 2
Joined: Wed Sep 12, 2018 4:17 am
languages_spoken: english
ODROIDs: Odroid C2

Re: Command line video player

Unread postby crashoverride » Thu Sep 13, 2018 9:55 am

pcarrillom wrote:I need to play Left channel output with left channel of the first audio program and the right channel output with the right channel of the second audio program. Is this something that can be done directly with c2play?

No. It would require instantiating another audio decoder and coding an audio mixer component.

As an alternative, there is probably a ffmpeg command that could be used to perform the decoding and mixing. The output of ffmpeg could then be sent to c2play for playback.
crashoverride
 
Posts: 3924
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: Command line video player

Unread postby pcarrillom » Thu Sep 20, 2018 1:52 am

crashoverride wrote:
pcarrillom wrote:I need to play Left channel output with left channel of the first audio program and the right channel output with the right channel of the second audio program. Is this something that can be done directly with c2play?

No. It would require instantiating another audio decoder and coding an audio mixer component.

As an alternative, there is probably a ffmpeg command that could be used to perform the decoding and mixing. The output of ffmpeg could then be sent to c2play for playback.


Thanks. Yes, I could use ffmpeg, however it does not support hardware decoding on C2, as far as I know. Or do you know a way of compiling ffmpeg with hardware decoding support on C2?
pcarrillom
 
Posts: 2
Joined: Wed Sep 12, 2018 4:17 am
languages_spoken: english
ODROIDs: Odroid C2

Re: Command line video player

Unread postby mad_ady » Thu Sep 20, 2018 3:06 am

You don't need it to do hardware decoding. Only muxing the h264 video stream with the combined audio streams. It would just do software audio encoding, which is ok for real-time on the c2. The output would be a stream with 1 video stream and 1 audio stream that c2play can handle. It will probably communicate via a pipe
User avatar
mad_ady
 
Posts: 4466
Joined: Wed Jul 15, 2015 5:00 pm
Location: Bucharest, Romania
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1

Re: Command line video player

Unread postby Domi » Thu Sep 20, 2018 9:10 pm

Great work!

Works fine so far on Ubuntu 16.04, compiled from bionic branch.

This is probably more of an libav question but I thought I would ask here first: Any ideas how I can get a faster startup speed when receiving a UDP multicast stream?

Code: Select all
c2play-x11 udp://239.1.1.1:1234


Gives horrible startup speeds of 6-12 seconds (time from application start to first image) but it can be tweaked with analyzeduration:

Code: Select all
c2play-x11 --avdict 'analyzeduration:1000000' udp://239.1.1.1:1234


This significantly shortens the startup time to just 3-4 seconds, which is quite decent already but I'm wondering if there are any more tweaks I should be aware of? I also tried playing with probesize and buffer_size but I couldn't find any improvements by using them.
Domi
 
Posts: 1
Joined: Thu Sep 20, 2018 8:44 pm
languages_spoken: english, german
ODROIDs: C2, XU4

Previous

Return to Ubuntu

Who is online

Users browsing this forum: No registered users and 1 guest