[FFmpeg-devel] [PATCH v2] avcodec: Add dv marker bsf

Dave Rice dave at dericed.com
Sat Mar 12 17:11:52 EET 2022



> On Mar 10, 2022, at 4:41 AM, Tobias Rapp <t.rapp at noa-archive.com> wrote:
> 
> On 09/03/2022 19:18, Michael Niedermayer wrote:
>> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
>> ---
>>  doc/bitstream_filters.texi       |  30 ++++++++
>>  libavcodec/Makefile              |   1 +
>>  libavcodec/bitstream_filters.c   |   1 +
>>  libavcodec/dv_error_marker_bsf.c | 127 +++++++++++++++++++++++++++++++
>>  4 files changed, 159 insertions(+)
>>  create mode 100644 libavcodec/dv_error_marker_bsf.c
>> diff --git a/doc/bitstream_filters.texi b/doc/bitstream_filters.texi
>> index a0092878c8..8c5d84dceb 100644
>> --- a/doc/bitstream_filters.texi
>> +++ b/doc/bitstream_filters.texi
>> @@ -132,6 +132,36 @@ the header stored in extradata to the key packets:
>>  ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
>>  @end example
>>  + at section dv_error_marker
>> +
>> +Blocks in DV which are marked as damaged are replaced by blocks of the specified color.
>> +
>> + at table @option
>> + at item color
>> +The color to replace damaged blocks by
>> + at item sta
>> +A 16 bit mask which specifies which of the 16 possible error status values are
>> +to be replaced by colored blocks. 0xFFFE is the default which replaces all non 0
>> +error status values.
>> + at table @samp
>> + at item ok
>> +No error, no concealment
>> + at item err
>> +Error, No concealment
>> + at item res
>> +Reserved
>> + at item notok
>> +Error or concealment
>> + at item notres
>> +Not reserved
>> + at item Aa, Ba, Ca, Ab, Bb, Cb, A, B, C, a, b, erri, erru
>> +The specific error status code
>> + at end table
>> +see page 44-46 or section 5.5 of
>> + at url{http://web.archive.org/web/20060927044735/http://www.smpte.org/smpte_store/standards/pdf/s314m.pdf}
>> +
>> + at end table
>> +
>>  @section eac3_core
>> [...]
> The filter options look nice to me now. Have not actually tested the bitstream filter on DV files, though.

I tested this and this works well for me. Here's a few samples that demonstrate the filter:

./ffmpeg -i https://samples.ffmpeg.org/archive/audio/pcm_s16le/dv+dvvideo+pcm_s16le++dropout.dv  -bsf dv_error_marker=sta=b -f rawvideo -c:v copy - | ffplay -
./ffmpeg -i https://archive.org/download/DvAnalyzerSampleDvVideoErrorConcealment/DV_Analyzer_Sample_Video_Error_Concealment_original.dv -bsf dv_error_marker=sta=b -f rawvideo -c:v copy - | ffplay -

Dave Rice



More information about the ffmpeg-devel mailing list