[FFmpeg-devel] [PATCH] libavformat: align and correct messages regarding bitstream filters

Moritz Barsnick barsnick at gmx.net
Tue Aug 19 14:50:39 CEST 2014


Hi,

I believe the h264_mp4toannexb message could be a bit more precise, and
use the same wording as the aac_adtstoasc message.

("-bsf h264_mp4toannexb" used to give me warnings that it was ambiguous
as to which stream to apply to, i.e. wanting to have the ":v"
specifier. But I can't reproduce that right now.)

Patch attached.

Cheers,
Moritz
-------------- next part --------------
>From cd24d6fc387e7ec4e95f81b4ff8d8faf4564f6c8 Mon Sep 17 00:00:00 2001
From: Moritz Barsnick <barsnick at gmx.net>
Date: Tue, 19 Aug 2014 14:28:35 +0200
Subject: [PATCH] align and correct messages regarding bitstream filters

The messages regarding the recommended use of bitstream filters are somewhat different.
This also adds the ":v" stream specifier to "-bsf h264_mp4toannexb".
---
 libavformat/flvenc.c    | 2 +-
 libavformat/movenc.c    | 2 +-
 libavformat/mpegtsenc.c | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index dd74d4c..febc5e5 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -521,7 +521,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
                (AV_RB16(pkt->data) & 0xfff0) == 0xfff0) {
         if (!s->streams[pkt->stream_index]->nb_frames) {
         av_log(s, AV_LOG_ERROR, "Malformed AAC bitstream detected: "
-               "use audio bitstream filter 'aac_adtstoasc' to fix it "
+               "use the audio bitstream filter 'aac_adtstoasc' to fix it "
                "('-bsf:a aac_adtstoasc' option with ffmpeg)\n");
         return AVERROR_INVALIDDATA;
         }
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 2b801b7..bf61391 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -3517,7 +3517,7 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
         (AV_RB16(pkt->data) & 0xfff0) == 0xfff0) {
         if (!s->streams[pkt->stream_index]->nb_frames) {
             av_log(s, AV_LOG_ERROR, "Malformed AAC bitstream detected: "
-                   "use audio bitstream filter 'aac_adtstoasc' to fix it "
+                   "use the audio bitstream filter 'aac_adtstoasc' to fix it "
                    "('-bsf:a aac_adtstoasc' option with ffmpeg)\n");
             return -1;
         }
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 208360f..0184d87 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1193,7 +1193,8 @@ int ff_check_h264_startcode(AVFormatContext *s, const AVStream *st, const AVPack
     if (pkt->size < 5 || AV_RB32(pkt->data) != 0x0000001) {
         if (!st->nb_frames) {
             av_log(s, AV_LOG_ERROR, "H.264 bitstream malformed, "
-                   "no startcode found, use the h264_mp4toannexb bitstream filter (-bsf h264_mp4toannexb)\n");
+                   "no startcode found, use the video bitstream filter 'h264_mp4toannexb' to fix it "
+                   "('-bsf:v h264_mp4toannexb' option with ffmpeg)\n");
             return AVERROR_INVALIDDATA;
         }
         av_log(s, AV_LOG_WARNING, "H.264 bitstream error, startcode missing\n");
-- 
1.9.3



More information about the ffmpeg-devel mailing list