Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find ffmpeg or avconv #7

Open
PacoBell opened this issue Jul 18, 2020 · 4 comments
Open

Cannot find ffmpeg or avconv #7

PacoBell opened this issue Jul 18, 2020 · 4 comments

Comments

@PacoBell
Copy link

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
Copy link
Owner

odrevet commented Jul 19, 2020

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
Copy link
Owner

odrevet commented Jul 21, 2020

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
Copy link
Owner

odrevet commented Jul 28, 2020

The latest version of termux allow to run command from another apps with proper authorizations :
termux/termux-app#804 (comment)

@odrevet
Copy link
Owner

odrevet commented Jul 29, 2020

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants