DVD Folder Playback using Xamarin.Android

This forum is about all development around libVLC.
svibs
New Cone
New Cone
Posts: 3
Joined: 16 Jun 2020 17:13

DVD Folder Playback using Xamarin.Android

Postby svibs » 16 Jun 2020 18:41

I'm porting a Windows desktop application that allows playback of ripped DVD's stored on a NAS. All of the disks are ripped with menus removed and include only the main title. This allows automatic playback without the need for the user to select anything.

I created a simple proof of concept app--if I save the ripped DVD folder to the tablet's local storage the following code automatically plays the entire movie if I specify the local path to the VIDEO_TS folder:

Code: Select all

private void InitVLC( ) { Core.Initialize(); _libVLC = new LibVLC(); VLCMediaPlayer = new MediaPlayer( _libVLC ) { EnableHardwareDecoding = true }; VLCMediaPlayer.EndReached += OnMediaPlayer_EndReached; VLCVideoView = FindViewById<VideoView>( Resource.Id.vlcVideoView ); VLCVideoView.MediaPlayer = VLCMediaPlayer; string dvdTsVideoPath = Path.Combine( AppUtilities.GetVideoFolderPath(), "Mulan (1998)" ); dvdTsVideoPath = Path.Combine( dvdTsVideoPath, "VIDEO_TS" ); // The dvdTsVideoPath for the local storage looks like this: // /storage/emulated/0/Android/data/com.companyname.mymoviespocapp/files/Movies/Mulan (1998)/VIDEO_TS var media = new Media( _libVLC, dvdTsVideoPath, FromType.FromPath ); bool playing = VLCVideoView.MediaPlayer.Play( media ); }
VLC seems to be able to identify that the VIDEO_TS folder contains .vob files and plays the entire movie; so far so good. But I need to be able to playback movies stored on a NAS. The following code *does not work* when I specify the smb path to the VIDEO_TS folder (I get no errors but the video does not play). It works if the path includes a vob file as noted in the code comments so I know that it isn't failing because of invalid path or authentication issues. Unfortunately, this doesn't do me much good since I need to play the entire movie.

Code: Select all

private void InitVLC( ) { Core.Initialize(); _libVLC = new LibVLC(); VLCMediaPlayer = new MediaPlayer( _libVLC ) { EnableHardwareDecoding = true }; VLCMediaPlayer.EndReached += OnMediaPlayer_EndReached; VLCVideoView = FindViewById<VideoView>( Resource.Id.vlcVideoView ); VLCVideoView.MediaPlayer = VLCMediaPlayer; // This doesn't work... string dvdTsVideoPath = "smb://user:password@192.168.11.100/Movies1/Mulan (1998)/"; var media = new Media( _libVLC, dvdTsVideoPath, FromType.FromLocation ); // But this does. Unfortunately, I need to play the entire disk so the ability to play a single VOB isn't useful //string dvdTsVideoPath = "smb://user:password@192.168.11.100/Movies1/Mulan (1998)/VIDEO_TS/VTS_01_1.VOB"; //var media = new Media( _libVLC, dvdTsVideoPath, FromType.FromLocation ); bool playing = VLCVideoView.MediaPlayer.Play( media ); }
I've tried using the FromType.FromLocation and FromType.FromPath flags but no joy. I can't help but think I'm missing something fundamentally simple. By the way; don't judge me for the movie title. This app is for the special needs school I work at :).

mfkl
Developer
Developer
Posts: 740
Joined: 13 Jun 2017 10:41

Re: DVD Folder Playback using Xamarin.Android

Postby mfkl » 17 Jun 2020 11:36

Hi svibs,

Can you share the logs please? https://code.videolan.org/videolan/LibVLCSharp/-/blob/3.x/docs/troubleshooting.md#debugging-with-libvlc-logs

Can you make sure it works with VLC Android?
https://mfkl.github.io

svibs
New Cone
New Cone
Posts: 3
Joined: 16 Jun 2020 17:13

Re: DVD Folder Playback using Xamarin.Android

Postby svibs » 18 Jun 2020 12:12

Hi mfkl,

Yes, this works as expected with the Android VLC. Sanitized logs below. Thanks for looking into this.

Code: Select all

libvlc Debug: creating audio output libvlc Debug: using audio output module "android_audiotrack" libvlc Debug: Copyright © 1996-2019 the VideoLAN team libvlc Error: GetStaticFieldID(AudioFormat.ENCODING_DOLBY_TRUEHD) failed libvlc Debug: looking for audio output module matching "any": 4 candidates libvlc Debug: configured with ../configure '--host=arm-linux-androideabi' '--build=x86_64-unknown-linux' '--with-contrib=/mnt/ssd/build-avlc/vlc/contrib/arm-linux-androideabi' '--prefix=/mnt/ssd/build-avlc/vlc/build-android-arm-linux-androideabi/install/' '--enable-neon' '--disable-nls' '--enable-live555' '--enable-realrtsp' '--enable-avformat' '--enable-swscale' '--enable-avcodec' '--enable-opus' '--enable-opensles' '--enable-matroska' '--enable-taglib' '--enable-dvbpsi' '--disable-vlc' '--disable-shared' '--disable-update-check' '--disable-vlm' '--disable-dbus' '--enable-lua' '--disable-vcd' '--disable-v4l2' '--enable-dvdread' '--enable-dvdnav' '--disable-bluray' '--disable-linsys' '--disable-decklink' '--disable-libva' '--disable-dv1394' '--enable-mod' '--disable-sid' '--disable-gme' '--disable-tremor' '--disable-mad' '--enable-mpg123' '--disable-dca' '--disable-sdl-image' '--enable-zvbi' '--disable-fluidsynth' '--enable-fluidlite' '--disable-jack' '--disable-pulse' '--disable-alsa' '--disable-samplerate' '--disable-xcb' '--disable-qt' '--disable-skins2' '--disable-mtp' '--disable-notify' '--enable-libass' '--disable-svg' '--disable-udev' '--enable-libxml2' '--disable-caca' '--enable-gles2' '--disable-goom' '--disable-projectm' '--enable-sout' '--enable-vorbis' '--disable-faad' '--disable-schroedinger' '--disable-vnc' '--enable-jpeg' '--enable-smb2' 'build_alias=x86_64-unknown-linux' 'host_alias=arm-linux-androideabi' 'CC=/mnt/ssd/build-avlc/vlc/build-android-arm-linux-androideabi/ndk/toolchains/bin/arm-linux-androideabi-clang' 'CFLAGS=-std=gnu11 -g -O2 -fstrict-aliasing -funsafe-math-optimizations -march=armv7-a -mfpu=neon -mcpu=cortex-a8 -mthumb -mfloat-abi=softfp -MMD -MP -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -no-canonical-prefixes -fno-integrated-as -DNDEBUG ' 'CXX=/mnt/ssd/build-avlc/vlc/build-android-arm-linux-androideabi/ndk/toolchains/bin/arm-linux-androideabi-clang++' 'CXXFLAGS=-std=gnu++11 -g -O2 -fstrict-aliasing -funsafe-math-optimizations -march=armv7-a -mfpu=neon -mcpu=cortex-a8 -mthumb -mfloat-abi=softfp -MMD -MP -fpic -ffunction-sections -funwind-tables -fstack-protector-strong -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -no-canonical-prefixes -fno-integrated-as -DNDEBUG -fexceptions -frtti -D__STDC_FORMAT_MACROS=1 -D__STDC_CONSTANT_MACROS=1 -D__STDC_LIMIT_MACROS=1' 'PKG_CONFIG_PATH=/mnt/ssd/build-avlc/vlc/contrib/arm-linux-androideabi/lib/pkgconfig' 'PKG_CONFIG_LIBDIR=/mnt/ssd/build-avlc/vlc/contrib/arm-linux-androideabi/lib/pkgconfig' libvlc Debug: revision 3.0.8-84-gc6f9f8a85e libvlc Debug: Creating an input for '(null)' libvlc Debug: using timeshift granularity of 50 MiB libvlc Debug: using default timeshift path libvlc Debug: `smb://user:password@HTPC-VA/Movies1/Mulan (1998)/VIDEO_TS/' gives access `smb' demux `any' path `user:password@HTPC-VA/Movies1/Mulan (1998)/VIDEO_TS/' libvlc Debug: creating demux: access='smb' demux='any' location='user:password@HTPC-VA/Movies1/Mulan (1998)/VIDEO_TS/' file='(null)' libvlc Debug: looking for access_demux module matching "smb": 6 candidates libvlc Debug: no access_demux modules matched libvlc Debug: creating access: smb://user:password@HTPC-VA/Movies1/Mulan (1998)/VIDEO_TS/ libvlc Debug: looking for access module matching "smb": 24 candidates libvlc Warning: Password in a URI is DEPRECATED libvlc Debug: using access module "smb2" libvlc Debug: looking for stream_filter module matching "any": 26 candidates libvlc Debug: no stream_filter modules matched libvlc Debug: looking for stream_directory module matching "any": 1 candidates libvlc Debug: attachment of directory-extractor failed for smb://user:password@HTPC-VA/Movies1/Mulan (1998)/VIDEO_TS/ libvlc Debug: no stream_directory modules matched libvlc Debug: using stream_filter module "record" libvlc Debug: creating demux: access='smb' demux='any' location='user:password@HTPC-VA/Movies1/Mulan (1998)/VIDEO_TS/' file='(null)' libvlc Debug: looking for demux module matching "any": 47 candidates libvlc Debug: cannot peek libvlc Debug: cannot peek libvlc Debug: cannot peek libvlc Debug: cannot peek libvlc Debug: using demux module "directory" libvlc Debug: looking for meta reader module matching "any": 2 candidates libvlc Debug: Trying Lua scripts in /data/user/0/com.companyname.mymoviespocapp/files/.share/lua/meta/reader libvlc Debug: Trying Lua scripts in /data/app/com.companyname.mymoviespocapp-1/lib/arm/vlc/lua/meta/reader libvlc Debug: Trying Lua scripts in /data/app/com.companyname.mymoviespocapp-1/share/vlc/lua/meta/reader libvlc Debug: no meta reader modules matched libvlc Debug: `smb://user:password@HTPC-VA/Movies1/Mulan (1998)/VIDEO_TS/' successfully opened libvlc Debug: EOF reached libvlc Debug: removing module "directory" libvlc Debug: removing module "record" libvlc Debug: removing module "smb2"

mfkl
Developer
Developer
Posts: 740
Joined: 13 Jun 2017 10:41

Re: DVD Folder Playback using Xamarin.Android

Postby mfkl » 18 Jun 2020 13:37

Not sure what you need to do exactly, as I've never attempted this before myself. It is certainly possible though I think. Few pointers:

This https://forum.videolan.org/viewtopic.php?t=148930 mentions the dvd:// option from https://wiki.videolan.org/VLC_command-line_help. There are other dvd related options, which may or may not be helpful for what you're trying to achieve. Some info on how to add libvlc options when using libvlcsharp https://code.videolan.org/videolan/LibVLCSharp/-/blob/3.x/docs/libvlc_documentation.md#libvlc-options

This https://code.videolan.org/videolan/vlc-android/-/issues/48 mentions the medialibrary, which VLC Android uses, and does some processing which may be interested to replicate. https://code.videolan.org/videolan/medialibrary/-/issues/29 also might be relevant.
https://mfkl.github.io

svibs
New Cone
New Cone
Posts: 3
Joined: 16 Jun 2020 17:13

Re: DVD Folder Playback using Xamarin.Android

Postby svibs » 18 Jun 2020 19:17

Thanks for the additional info--I'll have a look and report back.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 12 guests