rtpenc: Set a default video codec

Message ID 1318875324-90154-1-git-send-email-martin@martin.st
State Committed
Commit 9f938ca5e653c7d05d4ef22226eb61334a961e9c
Headers show

Commit Message

Martin Storsjö Oct. 17, 2011, 6:15 p.m.
avconv doesn't allow mapping video streams to a muxer if the
default video codec is CODEC_ID_NONE.
---
 libavformat/rtpenc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Anton Khirnov Oct. 17, 2011, 6:32 p.m. | #1
On Mon, 17 Oct 2011 21:15:24 +0300, Martin Storsjö <martin@martin.st> wrote:
> avconv doesn't allow mapping video streams to a muxer if the
> default video codec is CODEC_ID_NONE.

That's not correct. It allows mapping the streams manually, but doesn't
do that automatically.

> ---
>  libavformat/rtpenc.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
> index 165e444..dfd7461 100644
> --- a/libavformat/rtpenc.c
> +++ b/libavformat/rtpenc.c
> @@ -465,7 +465,7 @@ AVOutputFormat ff_rtp_muxer = {
>      .long_name         = NULL_IF_CONFIG_SMALL("RTP output format"),
>      .priv_data_size    = sizeof(RTPMuxContext),
>      .audio_codec       = CODEC_ID_PCM_MULAW,
> -    .video_codec       = CODEC_ID_NONE,
> +    .video_codec       = CODEC_ID_MPEG4,

Does it support h.264?
Martin Storsjö Oct. 17, 2011, 6:43 p.m. | #2
On Mon, 17 Oct 2011, Anton Khirnov wrote:

> On Mon, 17 Oct 2011 21:15:24 +0300, Martin Storsjö <martin@martin.st> wrote:
>> avconv doesn't allow mapping video streams to a muxer if the
>> default video codec is CODEC_ID_NONE.
>
> That's not correct. It allows mapping the streams manually, but doesn't
> do that automatically.

Amended the commit message locally.

>> ---
>>  libavformat/rtpenc.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
>> index 165e444..dfd7461 100644
>> --- a/libavformat/rtpenc.c
>> +++ b/libavformat/rtpenc.c
>> @@ -465,7 +465,7 @@ AVOutputFormat ff_rtp_muxer = {
>>      .long_name         = NULL_IF_CONFIG_SMALL("RTP output format"),
>>      .priv_data_size    = sizeof(RTPMuxContext),
>>      .audio_codec       = CODEC_ID_PCM_MULAW,
>> -    .video_codec       = CODEC_ID_NONE,
>> +    .video_codec       = CODEC_ID_MPEG4,
>
> Does it support h.264?

It does, but since lavc doesn't have such an encoder internally, mpeg4 
felt like a better default.

The default here doesn't really matter much, any user of this muxer will 
probably set a bunch of options anyway (but using the muxer via ffmpeg 
earlier, one didn't need to map the streams manually, just specifying a 
video codec with -vcodec was enough - a behaviour which this patch 
restores).

// Martin
Anton Khirnov Oct. 17, 2011, 6:52 p.m. | #3
On Mon, 17 Oct 2011 21:43:31 +0300 (EEST), Martin Storsjö <martin@martin.st> wrote:
Non-text part: MULTIPART/MIXED
> On Mon, 17 Oct 2011, Anton Khirnov wrote:
> 
> > On Mon, 17 Oct 2011 21:15:24 +0300, Martin Storsjö <martin@martin.st> wrote:
> >> avconv doesn't allow mapping video streams to a muxer if the
> >> default video codec is CODEC_ID_NONE.
> >
> > That's not correct. It allows mapping the streams manually, but doesn't
> > do that automatically.
> 
> Amended the commit message locally.
> 
> >> ---
> >>  libavformat/rtpenc.c |    2 +-
> >>  1 files changed, 1 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
> >> index 165e444..dfd7461 100644
> >> --- a/libavformat/rtpenc.c
> >> +++ b/libavformat/rtpenc.c
> >> @@ -465,7 +465,7 @@ AVOutputFormat ff_rtp_muxer = {
> >>      .long_name         = NULL_IF_CONFIG_SMALL("RTP output format"),
> >>      .priv_data_size    = sizeof(RTPMuxContext),
> >>      .audio_codec       = CODEC_ID_PCM_MULAW,
> >> -    .video_codec       = CODEC_ID_NONE,
> >> +    .video_codec       = CODEC_ID_MPEG4,
> >
> > Does it support h.264?
> 
> It does, but since lavc doesn't have such an encoder internally, mpeg4 
> felt like a better default.
> 

Some other containers use it undef #if CONFIG_LIBX264_ENCODER

> The default here doesn't really matter much, any user of this muxer will 
> probably set a bunch of options anyway (but using the muxer via ffmpeg 
> earlier, one didn't need to map the streams manually, just specifying a 
> video codec with -vcodec was enough - a behaviour which this patch 
> restores).

Ok then.

Patch

diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index 165e444..dfd7461 100644
--- a/libavformat/rtpenc.c
+++ b/libavformat/rtpenc.c
@@ -465,7 +465,7 @@  AVOutputFormat ff_rtp_muxer = {
     .long_name         = NULL_IF_CONFIG_SMALL("RTP output format"),
     .priv_data_size    = sizeof(RTPMuxContext),
     .audio_codec       = CODEC_ID_PCM_MULAW,
-    .video_codec       = CODEC_ID_NONE,
+    .video_codec       = CODEC_ID_MPEG4,
     .write_header      = rtp_write_header,
     .write_packet      = rtp_write_packet,
     .write_trailer     = rtp_write_trailer,