The mpeg 1/2 video packetizer already does the job of setting private data.
Besides, the function does not seem to return a sequence header reliably,
which is why the private data is malformed even when the packetizer calls
it before it calls remove_stuffing_bytes_and_handle_sequence_headers().
(Maybe that is why there is the remark "BE VERY CAREFUL WITH THIS CALL".)
remove_stuffing_bytes_and_handle_sequence_headers() sets private data with a
malformed sequence header as it takes in all kinds of extensions, while only
the extensions of the sequence (i.e. before a pic / gop) should be included
(which is why ffmpeg complains about a "pic cod ext after 0").
Which file name they're based on depends on the tool & situation:
• For multiplex settings the destination file name is used if set,
otherwise the first source file's file name.
• For saving info tool output the name of the file currently open in
the info tool is used.
• For saving attachments in the header editor the attachment's name is
used.
Implements #3012.
Exmaples:
• `La.vie.en.rose.(fr).avi` — French (`fr`) instead of English (`en`)
• `The.man.with.the.golden.gun[ger].srt` — German (`ger`) instead of
Mandingo (`man`)
Implements #3013.
It's much faster than using the initializer lists. Here's the result
from a micro benchmark I ran:
2021-01-25T23:49:20+01:00
Running ./bench.g++
Run on (8 X 4500 MHz CPU s)
CPU Caches:
L1 Data 32 KiB (x4)
L1 Instruction 32 KiB (x4)
L2 Unified 256 KiB (x4)
L3 Unified 8192 KiB (x1)
Load Average: 1.08, 0.72, 0.60
-------------------------------------------------------------
Benchmark Time CPU Iterations
-------------------------------------------------------------
BM_InitializerList 59667 ns 59625 ns 70526
BM_EmplaceBack 24515 ns 24497 ns 176817
BM_EmplaceBack2 16970 ns 16961 ns 247652
BM_PushBack 52831 ns 52796 ns 79202
BM_PushBack2 52858 ns 52823 ns 79004
The five benchmarks were:
• BM_InitializerList — the old way with initializer lists. Basically
the same code currently being replaced.
• BM_EmplaceBack — Reserving space & adding each entry with
g_languages.emplace_back(). A constructor was added to language_t
struct taking the std::strings as const references (std::string
const &), assigning them to the member variables normally.
• BM_EmplaceBack2 — Reserving space & adding each entry with
g_languages.emplace_back(). A constructor was added to language_t
struct taking the std::strings as rvalue references (std::string &&)
assigning them to the member variables using std::move().
• BM_PushBack — Reserving space & adding each entry with
g_languages.push_back(). A constructor was added to language_t
struct taking the std::strings as const references (std::string
const &), assigning them to the member variables normally.
• BM_PushBack2 — Reserving space & adding each entry with
g_languages.push_back(). A constructor was added to language_t
struct taking the std::strings as rvalue references (std::string &&)
assigning them to the member variables using std::move().