简体   繁体   English

用于html-android的FFmpeg mp4编码器

[英]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. 您好,我正在尝试将使用ffmpeg的网络摄像头自动捕获的视频.mp4放入HTML(在台式机Linux中运行ffmpeg),然后激活本地主机,以便我的android能够看到它。

the video.mp4 was able to run in linux, and in html-desktop. video.mp4能够在linux和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. 我的android-browser(html-android)中的视频可以播放,但是all white和像素错误,所以失败了。

I thought because android has difference surface because in my desktop it runs perfectly, then i keep searching and trying with ogv/webm. 我认为是因为android具有差异性表面,因为它在我的桌面上可以完美运行,然后我继续搜索并尝试使用ogv / webm。

In the end, I just use a downloaded another mp4 and it runs perfectly tho. 最后,我只是使用下载的另一个mp4,它可以完美运行。 now I think the problem was coming from my mp4-webcam created by ffmpeg(run in cmd) 现在我认为问题出在ffmpeg创建的mp4-webcam(在cmd中运行)

I compare a mp4-webcam vs mp4-downloaded 我比较了mp4-网络摄像头和mp4-下载的

5sec vs 1min, 5秒1分钟,

Data-rate: 16477kbps vs 613kbps 数据速率:16477kbps和613kbps

framerate: 30frm/s vs 23frm/s 帧率:30frm / s和23frm / s

size: 9MB vs 5 MB 大小:9MB和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. 即使是仅5秒钟的网络摄像头视频,它仍然比下载1分钟的视频具有更大的数据量,这也许是因为没有进行转换。

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. android-html(google chrome)无法显示并显示坏点,因为它在桌面上运行。 it shouldn't be the problem right ? 这不应该是问题吗?

I really need to transfer webcam-record into android-surface (my web-app). 我真的需要将摄像头记录转移到android-surface(我的网络应用)中。

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 编辑:我的cmd ffmpeg运行: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. 编辑2:我的第二个想法,因为我使用的ffmpeg编码器(libx264)不支持android。 but i still no idea 但我还是不知道

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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