[FFmpeg-trac] #488(undetermined:new): Hang on some example files

FFmpeg trac at avcodec.org
Mon Sep 19 13:37:29 CEST 2011


#488: Hang on some example files
-------------------------------------+-------------------------------------
             Reporter:  Alex__       |                    Owner:
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
              Version:  unspecified  |  undetermined
             Keywords:               |               Resolution:
             Blocking:               |               Blocked By:
Analyzed by developer:  0            |  Reproduced by developer:  0
-------------------------------------+-------------------------------------

Comment (by Alex__):

 > Is this also reproducible without external libraries?

 Can you provide me some more information on what you need exactly? E.g.
 the following command doesn't hang: "ffmpeg -i sample.mpg -vcodec copy
 -acodec copy sample-out.mpg".

 > (And please explain how you manage to produce a version number that
 looks 3000 versions old.)

 Compiling latest trunk:
 {{{
 $ git pull && ./configure --enable-zlib --disable-debug --enable-libfaac
 --enable-libx264 --enable-gpl --enable-nonfree --enable-libmp3lame
 --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libxvid
 --cc=clang && make -j3 && make install
 }}}

 Still having using the patch from #468:

 {{{
 $ git diff
 diff --git a/libavformat/movenc.c b/libavformat/movenc.c
 index 29de5b0..0a741de 100644
 --- a/libavformat/movenc.c
 +++ b/libavformat/movenc.c
 @@ -1211,7 +1211,7 @@ static int mov_write_tkhd_tag(AVIOContext *pb,
 MOVTrack *track, AVStream *st)
      (version == 1) ? avio_wb32(pb, 104) : avio_wb32(pb, 92); /* size */
      ffio_wfourcc(pb, "tkhd");
      avio_w8(pb, version);
 -    avio_wb24(pb, 0xf); /* flags (track enabled) */
 +    avio_wb24(pb, track->secondary ? 0x2 : 0xf); /* flags (first track
 enabled) */
      if (version == 1) {
          avio_wb64(pb, track->time);
          avio_wb64(pb, track->time);
 @@ -1225,8 +1225,7 @@ static int mov_write_tkhd_tag(AVIOContext *pb,
 MOVTrack *track, AVStream *st)

      avio_wb32(pb, 0); /* reserved */
      avio_wb32(pb, 0); /* reserved */
 -    avio_wb16(pb, 0); /* layer */
 -    avio_wb16(pb, st->codec->codec_type); /* alternate group) */
 +    avio_wb32(pb, track->alternative_group); /* reserved (Layer &
 Alternate group) */
      /* Volume, only for audio */
      if(track->enc->codec_type == AVMEDIA_TYPE_AUDIO)
          avio_wb16(pb, 0x0100);
 @@ -1808,6 +1807,7 @@ static int mov_write_moov_tag(AVIOContext *pb,
 MOVMuxContext *mov,
  {
      int i;
      int64_t pos = avio_tell(pb);
 +    int not_first[AVMEDIA_TYPE_NB]={0};
      avio_wb32(pb, 0); /* size placeholder*/
      ffio_wfourcc(pb, "moov");

 @@ -1835,6 +1835,14 @@ static int mov_write_moov_tag(AVIOContext *pb,
 MOVMuxContext *mov,
      //mov_write_iods_tag(pb, mov);
      for (i=0; i<mov->nb_streams; i++) {
          if(mov->tracks[i].entry > 0) {
 +            if(i < s->nb_streams){
 +                int codec_type= s->streams[i]->codec->codec_type;
 +                if(codec_type==AVMEDIA_TYPE_AUDIO ||
 codec_type==AVMEDIA_TYPE_SUBTITLE){
 +                    mov->tracks[i].alternative_group= 1 +
 (codec_type==AVMEDIA_TYPE_SUBTITLE);
 +                    mov->tracks[i].secondary= not_first[codec_type];
 +                    not_first[codec_type]= 1;
 +                }
 +            }
              mov_write_trak_tag(pb, &(mov->tracks[i]), i < s->nb_streams ?
 s->streams[i] : NULL);
          }
      }
 diff --git a/libavformat/movenc.h b/libavformat/movenc.h
 index 610683f..4676983 100644
 --- a/libavformat/movenc.h
 +++ b/libavformat/movenc.h
 @@ -78,6 +78,8 @@ typedef struct MOVIndex {
  #define MOV_TRACK_STPS         0x0002
      uint32_t    flags;
      int         language;
 +    int         alternative_group;
 +    int         secondary;
      int         trackID;
      int         tag; ///< stsd fourcc
      AVCodecContext *enc;
 }}}

-- 
Ticket URL: <https://avcodec.org/trac/ffmpeg/ticket/488#comment:2>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list