You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-13Lines changed: 21 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,14 @@
2
2
3
3
[简体中文 | Simplified Chinese](README_CN.md)
4
4
5
+
------
6
+
7
+
[TOC]
8
+
9
+
------
10
+
11
+
12
+
5
13
## Feature
6
14
7
15
Solve the problem of recording file [missing frame](#Problem description), eliminates the process of [manual operation](#Solution optimization)
@@ -25,15 +33,15 @@ Since I did not go to a large number of live broadcasts of other anchors to veri
25
33
26
34
### Initial Solution
27
35
28
-
To solve this problem, the more brainless solution is to recode and suppress (Format Factory/Maruko's Toolbox), but this solution takes a long time and consumes a lot of resources, which is not suitable for my thin and light notebook. Non-destructive cutting is the solution that suits me. Using the `-ss` and `-c copy` parameters of FFmpeg, the missing frame can be quickly cut off (just cut the missing frame at the beginning, if there is a missing frame at the end, it will not cause the video, audio and picture of station B to be out of sync, and generally there is no), then the value of the `-ss` parameter is the time when the screen just started moving.
36
+
To solve this problem, the more brainless solution is to recode and suppress (Format Factory/Maruko's Toolbox), but this solution takes a long time and consumes a lot of resources, which is not suitable for my thin and light notebook. Non-destructive cutting is the solution that suits me. Using the `-ss` and `-c copy` parameters of FFmpeg, the missing frame can be **quickly** cut off (just cut the missing frame at the beginning, if there is a missing frame at the end, it will not cause the video, audio and picture of station B to be out of sync, and generally there is no), then the value of the `-ss` parameter is the time when the screen just started moving.
29
37
30
38
### Principle Explanation
31
39
32
40
The above sentence is easy to understand. Start wherever there is no problem, but this will involve another problem, that is, why the video will start to move at this value position, which needs to explain the principle of key frames. The video frame is offset according to the data of the previous frame, and the source is traced forward one by one, and the previous key frame will be found. If the key frame is not found, the player will not know how to deal with the frame data before the next key frame, which causes frame loss. The key frame here refers to the key frame of the original video, not the key frame (file header) automatically marked after the video is cut (the player will not recognize the key frame without the key frame at the beginning of the video). Then a cut on the non-key frames will inevitably cause the missing frames of the video, which refers to [cv4373238](https://www.bilibili.com/read/cv4373238).
33
41
34
42
### Advanced Solutions
35
43
36
-
In the beginning, I saw it with the naked eye, adding and subtracting in units of `1s` (a few tenths of a second is difficult to estimate with the naked eye). Sometimes it will be corrected by FFmpeg (The `-ss` parameter is to let FFmpeg find (seeking) keyframes **around here**, which refers to [FFmpeg official documentation](http://trac.ffmpeg.org/wiki/Seeking)), most of the time it will cause new missing frames, that is, FFmpeg did not find the key frame in a limited range. If it is earlier than the actual key frame, the duration of the missing frame will be a little shorter; if it is cut after the key frame, then the generated video will miss the frame to the next key frame. If you fine-tune it at this time, it will undoubtedly be a waste of time. So, how to get the accurate key frame position? With Genteure's fib (see [Project Dependence](#Project Dependency)), you can find the location of the **second** key frame in the parsed XML file, and then use FFmpeg to cut this location ( Assign the second key frame time to the `-ss` parameter).
44
+
In the beginning, I saw it with the naked eye, adding and subtracting in units of `1s` (a few tenths of a second is difficult to estimate with the naked eye). Sometimes it will be corrected by FFmpeg (The `-ss` parameter is to let FFmpeg find (seeking) keyframes **around here**, which refers to [FFmpeg official documentation](http://trac.ffmpeg.org/wiki/Seeking)), most of the time it will cause new missing frames, that is, FFmpeg did not find the key frame in a limited range. If it is earlier than the actual key frame, the duration of the missing frame will be a little shorter; if it is cut after the key frame, then the generated video will miss the frame to the next key frame. If you fine-tune it at this time, it will undoubtedly be a waste of time. So, how to get the accurate key frame position? With Genteure's fib (see [Project Dependence](#Project Dependency)), you can find the location of the **second** key frame in the parsed XML file, and then use FFmpeg to cut this location (Assign the second key frame time to the `-ss` parameter).
37
45
38
46
### Solution Optimization
39
47
@@ -54,8 +62,8 @@ So, how to combine these two tools through programming, avoid the tedious operat
54
62
55
63
Most (almost all) operating environments of this project have been packaged into compressed packages and Setup, just pay attention to the operating system.
56
64
57
-
- Windows(Currently)
58
-
- JDK(Optional)`1.8`(`jar`) / `1.6+`(`exe`) ,See [Assets description](#Assets description) here for details
65
+
- Windows (Currently)
66
+
- JDK (Optional) `1.8`(`jar`) / `1.6+`(`exe`) ,See [Assets description](#Assets description) here for details
59
67
60
68
## installation
61
69
### Assets
@@ -99,7 +107,7 @@ The program must be placed in the following structure to ensure the relative pos
- Use a simple text file as the command format for manual editing...
128
136
- ...At the same time, it is convenient to write scripts and realize automatic processing
129
137
- The command file is relatively small and easy to transfer, which is convenient for people who do not understand the details of FLV to repair the file
130
-
+ Main software usage(Assuming the software file name is fib):
131
-
1.**Read FLV files and generate command files**(This project depends on)
138
+
+ Main software usage (Assuming the software file name is fib) :
- repair: Because of `indexOf`, the file name with multiple English periods cannot be handled correctly. See [issue#2](https://github.com/Aric-Sun/FirstKeyFrameFilter/issues/2)
180
188
- optimization: Extract the method of obtaining the file name without extension into `Utils` for easy calling
181
-
- repair: Calling FFmpeg to cut the video is recognized by PotPlayer as an audio problem, which is **relatively compatible**, so the version number is increased to 1.1.0. See [issue#3](https://github.com/Aric-Sun/FirstKeyFrameFilter/issues/3)
189
+
- repair: Calling FFmpeg to cut the video is recognized by PotPlayer as an audio problem, which is **relatively** compatible, so the version number is increased to 1.1.0. See [issue#3](https://github.com/Aric-Sun/FirstKeyFrameFilter/issues/3)
182
190
- optimization: The method of converting timestamp to seconds is transferred to `Utils`, which is convenient to call and conforms to the specification
1.`TypicalFLV` is the recorded video file in question. It is unprocessed and will be exported directly from [BililiveRecorder](https://rec.danmuji.org/) and will be **continuously updated**. A small number of files that do not have missing frames but have other problems are also included and have been specially marked.
205
213
2.`TypicalXML` are files generated by fib (see [Project Dependency](#Project Dependency)) analysis, which is a sample left over from the development of XML parsing and is no longer updated. The files with the word `TypicalCase` in them come from the missing frame video (i.e. `TypicalFLV`).
206
-
3.`DanmakuXML` are newly added danmaku files in BililiveRecorder 1.1.20. The danmaku files that have not been suppressed and submitted are archived here, which has nothing to do with this project...
214
+
3.`DanmakuXML` are newly added danmaku files in [BililiveRecorder](https://rec.danmuji.org/) 1.1.20. The danmaku files that have not been suppressed and submitted are archived here, which has nothing to do with this project...
0 commit comments