简体   繁体   中英

FFmpeg mp4 encoder for html-android

Hello I'm trying to put video .mp4 auto-captured by my webcam using ffmpeg into HTML (running ffmpeg in desktop-linux), and then activated my localhost so my android will able to see it.

the video.mp4 was able to run in linux, and in html-desktop.

the video in my android-browser(html-android) WAS ABLE to play too BUT it's all white and pixels error, so it's a fail.

I thought because android has difference surface because in my desktop it runs perfectly, then i keep searching and trying with ogv/webm.

In the end, I just use a downloaded another mp4 and it runs perfectly tho. now I think the problem was coming from my mp4-webcam created by ffmpeg(run in cmd)

I compare a mp4-webcam vs mp4-downloaded

5sec vs 1min,

Data-rate: 16477kbps vs 613kbps

framerate: 30frm/s vs 23frm/s

size: 9MB vs 5 MB

even tho it's only 5sec video by webcam, it still has larger data than a 1min video-downloaded maybe it was because without conversion.

but the question, is that the reason of the problem ? android-html(google chrome) wasn't able to display and make a dead pixels since in desktop it runs. it shouldn't be the problem right ?

I really need to transfer webcam-record into android-surface (my web-app).

I have no idea to fix it, any advice ? I've been searching a lot. Maybe there was another problem I do not know yet.

EDIT: my cmd ffmpeg run : ffmpeg -y -f v4l2 -i /dev/video1 -codec:v libx264 -qp 0 -t 0:00:05 hss.mp4

EDIT 2: my 2nd thought because ffmpeg encoder that I used(libx264) isnot support for android. but i still no idea

我刚刚将mp4-ffmpeg转换为webm,webm对于视频浏览器更友好

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM