-
-
Notifications
You must be signed in to change notification settings - Fork 331
USE FLV format for screen recording #385
Comments
Thanks @kokorin ! what about final file size, CPU usage and browser compatibility in comparison with the current setup? |
@elgalu Encdoded video & audio data occupies 99% of media file size. And it depends on codec and its configuration. So if you use the same parameters So you can only change There is one more problem in fix_videos.sh: ffmpeg has no option But with FLV format you can entirely skip conversion FLV to MP4 and hence mp4box is also not required. |
This looks good Denis!
Could you perhaps send a PR? That would be great
…On Tue, Jun 2, 2020, 8:54 AM Denis Kokorin ***@***.***> wrote:
@elgalu <https://github.com/elgalu> Encdoded video & audio data occupies
99% of media file size. And it depends on codec and its configuration.
So if you use the same parameters FFMPEG_CODEC_ARGS="-vcodec libx264
-preset ultrafast -pix_fmt yuv420p" (or FFMPEG_CODEC_VA_ARGS="-vcodec
libx264 -acodec copy -preset ultrafast") the will be no significant
difference in size or in CPU consumption. Also notice please that in
FFMPEG_CODEC_VA_ARGS there is no -pix_fmt yuv420p (it's used by default).
So you can only change VIDEO_TMP_FILE_EXTENSION="flv".
There is one more problem in *fix_videos.sh*: ffmpeg has no option -c copy,
this leads to video re-encoding, which takes time. With -c copy
conversion will be done approx 100 times faster.
But with FLV format you can entirely skip conversion FLV to MP4 and hence
mp4box is also not required.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#385 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABUBG5OETU2MZG3LAR43G3RUSO2DANCNFSM4NQCYJXA>
.
|
@kokorin, thank you for sharing those tips. My knowledge of video transcoding and FFmpeg parameters is humble. I tried to go through FFmpeg docs: https://trac.ffmpeg.org/wiki/Encode/H.264 However, the results I got are not satisfying. Could you please provide more details? Yesterday, I tried different combinations using flv/mkv/mp4 with different ffmpeg settings, I settled on:
I tried to increase the frame rate & use a slower preset to give better quality for the FLV; however, it is still far worst than mp4. For example, check this video; it is severely distorted, especially after 30th seconds. I observed that such distortion is not predictable; sometimes, I got a black background (or shadow). On the other hand, the current default with mkv->mp4 is predictable; the only problem I'm facing is videos sometimes get truncated (maybe because of what you mentioned about copying while recording). I'm not sure what I'm missing. Could you please provide a working example? If I understand your ideas better, I could work on a PR for a wider audience; however, to make it useful for others, I have those open questions?
|
2 years old should work, but it is always better to stick to recent release.
The quality should not be affected by container (MP4 or FLV)
The issue seems to be caused by keyframes. I would recommend adding
ffmpeg selects CPU or GPU encoding by specified codec:
It doesn't matter. |
Hello, thank you for this project.
I have pretty good experience with video/audio formats.
I noticed that you use MKV for stream recording (because MP4 doesn't support it) and then convert MKV to MP4.
Anyway there are issues if you try to copy MKV while recording.
FLV has no such drawbacks: it was developed essentially for streaming. And it's possible to copy a file during recording and watch it later without issues. FLV does support h264 (MP4 default video codec) so its possible to convert FLV to MP4 very fast:
ffmpeg -i recrod.flv -c copy record.mp4
.Also since docker-selenium doesn't need anything except for video and audio tracks, FLV also fits for playback.
The text was updated successfully, but these errors were encountered: