odrevet / yt-dlp-kivy

User interface and port to several OS (including android) of yt-dlp using the kivy framework
46 stars 7 forks source link

Cannot find ffmpeg or avconv #7

Open PacoBell opened 4 years ago

PacoBell commented 4 years ago

The app can't seem to find an installation of ffmpeg or avconv and fails. It also can't seem to write to my phone's /sdcard directory, which definitely exists.

IMG_20200718_145622

odrevet commented 4 years ago

YouTube-DL try to find a ffmpeg binary as it detects several formats for the video and will need to merge them at post processing. I dont know how android handle it's path to call a binary like a linux or windows system, or if it is even possible (maybe with termux ? )

The video can still be download by enable the ignore error in the settings menu.

There are a lot of YouTube-DL options for preferred format that the app do not yet handle, having a setting to download a single format without post processing will probably be the best option.

The sdcard error is just a side effect of the previous error as nothing was downloaded.

odrevet commented 4 years ago

I installed ffmpeg via termux but the error remains, the app cannot found ffmpeg. I do not close the issu in case someone has a solution.

As an alternative solution, the format can now be selected before the download. If the selected format do not require post processing, like DASH encoded video then we can still download videos.

odrevet commented 4 years ago

The latest version of termux allow to run command from another apps with proper authorizations : https://github.com/termux/termux-app/issues/804#issuecomment-653622200

odrevet commented 4 years ago

need to patch youtube-dl systemcal to ffmpeg with

from jnius import cast from jnius import autoclass

PythonActivity = autoclass('org.kivy.android.PythonActivity') Intent = autoclass('android.content.Intent') intent = Intent() intent.setClassName("com.termux", "com.termux.app.RunCommandService"); intent.setAction("com.termux.RUN_COMMAND") intent.putExtra("com.termux.RUN_COMMAND_PATH", "/data/data/com.termux/files/usr/bin/ffmpeg") currentActivity = cast('android.app.Activity', PythonActivity.mActivity) currentActivity.startService(intent)