file exist but 'no such file or directory'

1,395 views
Skip to first unread message

Robot Ijo

unread,
Dec 29, 2010, 11:48:50 PM12/29/10
to andro...@googlegroups.com
Hi,
i try to publish video stream using my android with ffmpeg.
The file that i want to publish is sample.mp4 in /sdcard/tobor
directory.
sample.mp4 is existed, but ffmpeg complained that sample.mp4 not exist.
Any idea ? maybe i missed some basic principle on android.

These are list of commands:

# ls
sample.mp4
ffa_s
# ffmpeg -i sample.mp4
FFmpeg version UNKNOWN, Copyright (c) 2000-2010 the FFmpeg developers
built on Dec 29 2010 02:04:21 with gcc 4.4.0
configuration: --target-os=linux --cross-prefix=arm-eabi- --arch=arm
--disable-armvfp --prefix=../build/ffmpeg
--soname-prefix=/data/data/com.bambuser.broadcaster/lib/
--disable-shared --enable-small --optimization-flags=-O2
--disable-encoders --disable-decoders --disable-protocols
--disable-muxers --disable-demuxers --disable-parsers --disable-devices
--disable-filters --disable-bsfs --enable-encoder=mpeg2video
--enable-encoder=nellymoser
--extra-cflags='-I/media/prog/android/android-ndk-r4b//build/platforms/android-3/arch-arm/usr/include
-fpic -mthumb-interwork -ffunction-sections -funwind-tables
-fstack-protector -fno-short-enums -march=armv5te -mtune=xscale
-msoft-float' --extra-ldflags='-nostdlib
/media/prog/android/android-ndk-r4b//build/platforms/android-3/arch-arm/usr/lib/libc.so
/media/prog/android/android-ndk-r4b//build/platforms/android-3/arch-arm/usr/lib/libm.so
-Wl,-rpath-link=/media/prog/android/android-ndk-r4b//build/platforms/android-3/arch-arm/usr/lib
-L/media/prog/android/android-ndk-r4b//build/prebuilt/linux-x86/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0'
--extra-exe-ldflags='-Wl,-dynamic-linker,/system/bin/linker
/media/prog/android/android-ndk-r4b//build/platforms/android-3/arch-arm/usr/lib/crtbegin_dynamic.o
/media/prog/android/android-ndk-r4b//build/platforms/android-3/arch-arm/usr/lib/crtend_android.o'
--extra-libs=-lgcc
libavutil 50.19. 0 / 50.19. 0
libavcodec 52.78. 0 / 52.78. 0
libavformat 52.71. 0 / 52.71. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.20. 0 / 1.20. 0
libswscale 0.11. 0 / 0.11. 0
sample.mp4: No such file or directory
#

--
Just Another Android Newbie

alan

unread,
Dec 30, 2010, 4:40:20 AM12/30/10
to android-ndk
do you have the write_external_storage permission?

Robot Ijo

unread,
Dec 30, 2010, 4:54:30 AM12/30/10
to andro...@googlegroups.com
On 12/30/2010 04:40 PM, alan wrote:
> do you have the write_external_storage permission?

Do you mean this
http://developer.android.com/reference/android/Manifest.permission.html#WRITE_EXTERNAL_STORAGE

I don't use manifest file, i copied the file directly with 'adb push'.
I have write access to /sdcard and /system.

Thanks,

elik

unread,
Dec 30, 2010, 8:41:31 AM12/30/10
to android-ndk
What are you trying to do? what do you mean by publish?

ffmpeg converts files from one format/codec to another it doesn't
publish anything as far as I know.

You need an output file for the ffmpeg command e.g:
ffmpeg -i sample.mp4 sample.mov


On Dec 30, 11:54 am, Robot Ijo <tobor....@gmail.com> wrote:
> On 12/30/2010 04:40 PM, alan wrote:
>
> > do you have the write_external_storage permission?
>
> Do you mean thishttp://developer.android.com/reference/android/Manifest.permission.ht...

Udayakumar Rayala

unread,
Dec 30, 2010, 12:49:23 AM12/30/10
to andro...@googlegroups.com
Did it work with ffmpeg -i /sdcard/tobor/sample.mp4 ?


--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


Robot Ijo

unread,
Dec 30, 2010, 12:29:00 PM12/30/10
to andro...@googlegroups.com
On 12/30/2010 08:41 PM, elik wrote:
> What are you trying to do? what do you mean by publish?

Sorry, this is the complete command:
# ffmpeg -i sample.mp4 -re -acodec copy -vcodec copy -f flv
rtmp://mydomain.com/live/myStream

But, it will produce some error message.

>
> ffmpeg converts files from one format/codec to another it doesn't
> publish anything as far as I know.

We can publish video stream using ffmpeg to some server like wowza or
redis.

http://robotijo.wordpress.com

Robot Ijo

unread,
Dec 30, 2010, 12:30:01 PM12/30/10
to andro...@googlegroups.com
On 12/30/2010 12:49 PM, Udayakumar Rayala wrote:
> Did it work with ffmpeg -i /sdcard/tobor/sample.mp4 ?
>
Nope,
i have tried:
ffmpeg -i sample.mp4
ffmpeg -i ./sample.mp4
ffmpeg -i /sdcard/tobor/sample.mp4

thanks

Brad Davis

unread,
Dec 30, 2010, 1:58:07 PM12/30/10
to android-ndk
Look at your file permissions on sample.mp4.

Robot Ijo

unread,
Dec 30, 2010, 2:05:18 PM12/30/10
to andro...@googlegroups.com
On 12/31/2010 01:58 AM, Brad Davis wrote:
> Look at your file permissions on sample.mp4.
# ls -l
----rwxr-x system sdcard_rw 39115156 2010-11-28 11:42 sample.mp4
d---rwxr-x system sdcard_rw 2011-01-01 01:59 ffa_din
d---rwxr-x system sdcard_rw 2010-12-31 10:44 ffa_s
----rwxr-x system sdcard_rw 317 2011-01-01 02:04 wek.txt

I can read another file with same permission (wek.txt).

Btw, why the owner of these files is not 'root' ?

Dianne Hackborn

unread,
Dec 30, 2010, 2:07:00 PM12/30/10
to andro...@googlegroups.com
On Thu, Dec 30, 2010 at 11:05 AM, Robot Ijo <tobo...@gmail.com> wrote:
Btw, why the owner of these files is not 'root' ?

Why do you want it to be root?

This is a uid used to control write access; you need to be in this group to be able to write to the SD card.  This is how the write permission is implemented.

--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

Robot Ijo

unread,
Dec 30, 2010, 2:18:46 PM12/30/10
to andro...@googlegroups.com
On 12/31/2010 02:07 AM, Dianne Hackborn wrote:
> On Thu, Dec 30, 2010 at 11:05 AM, Robot Ijo <tobo...@gmail.com
> <mailto:tobo...@gmail.com>> wrote:
>
> Btw, why the owner of these files is not 'root' ?
>
>
> Why do you want it to be root?

Just want to know :).Because this is what happen in linux. When 'root'
create the file, then the file will owned by 'root'

>
> This is a uid used to control write access; you need to be in this group
> to be able to write to the SD card. This is how the write permission is
> implemented.
>
> --
> Dianne Hackborn
> Android framework engineer

> hac...@android.com <mailto:hac...@android.com>

Dianne Hackborn

unread,
Dec 30, 2010, 2:33:09 PM12/30/10
to andro...@googlegroups.com
On Thu, Dec 30, 2010 at 11:18 AM, Robot Ijo <tobo...@gmail.com> wrote:
Just want to know :).Because this is what happen in linux. When 'root' create the file, then the file will owned by 'root'

The SD card is a FAT filesystem, which doesn't support owners or permissions.

--
Dianne Hackborn
Android framework engineer
hac...@android.com

Yashaswini Prakash

unread,
Jan 18, 2011, 4:46:14 AM1/18/11
to android-ndk
Hi,
I have a similar problem as mentioned in this discussion.

I am trying to run following command in android emulator:
ffmpeg -i /data/sample_music.wma /data/out_music.mp3

and the output is as follows:

FFmpeg version UNKNOWN, Copyright (c) 2000-2010 the FFmpeg developers
built on Jan 18 2011 14:21:08 with gcc 4.4.0
configuration: --target-os=linux --cross-prefix=arm-eabi- --arch=arm
--disable-armvfp --prefix=../build/ffmpeg --soname-prefix=/system/lib/
--enable-shared --enable-small --optimization-flags=-O2 --disable-
encoders --disable-decoders --disable-protocols --disable-muxers --
disable-demuxers --disable-parsers --disable-devices --disable-filters
--disable-bsfs --enable-encoder=mpeg2video --enable-encoder=nellymoser
--extra-cflags='-I/localhome/user/Android/android-ndk-r4b/build/
platforms/android-3/arch-arm/usr/include -fpic -mthumb-interwork -
ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -
march=armv5te -mtune=xscale -msoft-float' --extra-ldflags='-nostdlib /
localhome/user/Android/android-ndk-r4b/build/platforms/android-3/arch-
arm/usr/lib/libc.so /localhome/user/Android/android-ndk-r4b/build/
platforms/android-3/arch-arm/usr/lib/libm.so -Wl,-rpath-link=/
localhome/user/Android/android-ndk-r4b/build/platforms/android-3/arch-
arm/usr/lib -L/localhome/user/Android/android-ndk-r4b/build/prebuilt/
linux-x86/arm-eabi-4.4.0/lib/gcc/arm-eabi/4.4.0' --extra-exe-ldflags='-
Wl,-dynamic-linker,/system/bin/linker /localhome/user/Android/android-
ndk-r4b/build/platforms/android-3/arch-arm/usr/lib/crtbegin_dynamic.o /
localhome/user/Android/android-ndk-r4b/build/platforms/android-3/arch-
arm/usr/lib/crtend_android.o' --extra-libs=-lgcc
libavutil 50.19. 0 / 50.19. 0
libavcodec 52.78. 0 / 52.78. 0
libavformat 52.71. 0 / 52.71. 0
libavdevice 52. 2. 0 / 52. 2. 0
libavfilter 1.20. 0 / 1.20. 0
libswscale 0.11. 0 / 0.11. 0
/data/sample_music.wma: No such file or directory

What am I doing wrong? Kindly reply.

Thanks,
Yashaswini

On Dec 31 2010, 12:33 am, Dianne Hackborn <hack...@android.com> wrote:
> On Thu, Dec 30, 2010 at 11:18 AM, Robot Ijo <tobor....@gmail.com> wrote:
> > Just want to know :).Because this is what happen in linux. When 'root'
> > create the file, then the file will owned by 'root'
>
> The SD card is a FAT filesystem, which doesn't support owners or
> permissions.
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com

Yashaswini Prakash

unread,
Jan 19, 2011, 7:06:59 AM1/19/11
to android-ndk
Solved the issue by using statically compiled ffmpeg.

On Jan 18, 2:46 pm, Yashaswini Prakash <info.collecto...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages