Revision 53ffdd14

View differences:

libavformat/mov.c
773 773
    //MOVStreamContext *sc = (MOVStreamContext *)st->priv_data;
774 774
    int entries, frames_per_sample;
775 775
    uint32_t format;
776
    uint8_t codec_name[32];
776 777

  
777 778
    /* for palette traversal */
778 779
    int color_depth;
......
845 846
#ifdef DEBUG
846 847
	    av_log(NULL, AV_LOG_DEBUG, "frames/samples = %d\n", frames_per_sample);
847 848
#endif
848
	    get_buffer(pb, (uint8_t *)st->codec.codec_name, 32); /* codec name */
849
        get_buffer(pb, codec_name, 32); /* codec name, pascal string (FIXME: true for mp4?) */
850
        if (codec_name[0] <= 31) {
851
            memcpy(st->codec.codec_name, &codec_name[1],codec_name[0]);
852
            st->codec.codec_name[codec_name[0]] = 0;
853
        }
849 854

  
850 855
	    st->codec.bits_per_sample = get_be16(pb); /* depth */
851 856
            st->codec.color_table_id = get_be16(pb); /* colortable id */
libavformat/movenc.c
451 451
static int mov_write_video_tag(ByteIOContext *pb, MOVTrack* track)
452 452
{
453 453
    int pos = url_ftell(pb);
454
    char compressor_name[32];
454 455
    int tag;
455 456

  
456 457
    put_be32(pb, 0); /* size */
......
467 468
    put_be16(pb, 0); /* Reserved */
468 469
    put_be16(pb, 1); /* Data-reference index */
469 470

  
470
    put_be32(pb, 0); /* Reserved (= 02000c) */
471
    put_be32(pb, 0); /* Reserved ("SVis")*/
472
    put_be32(pb, 0); /* Reserved */
473
    put_be32(pb, 0); /* Reserved (400)*/
471
    put_be16(pb, 0); /* Codec stream version */
472
    put_be16(pb, 0); /* Codec stream revision (=0) */
473
    put_tag(pb, "FFMP"); /* Vendor */
474
    if(track->enc->codec_id == CODEC_ID_RAWVIDEO) {
475
        put_be32(pb, 0); /* Temporal Quality */
476
        put_be32(pb, 0x400); /* Spatial Quality = lossless*/
477
    } else {
478
        put_be32(pb, 0x200); /* Temporal Quality = normal */
479
        put_be32(pb, 0x200); /* Spatial Quality = normal */
480
    }
474 481
    put_be16(pb, track->enc->width); /* Video width */
475 482
    put_be16(pb, track->enc->height); /* Video height */
476
    put_be32(pb, 0x00480000); /* Reserved */
477
    put_be32(pb, 0x00480000); /* Reserved */
483
    put_be32(pb, 0x00480000); /* Horizontal resolution 72dpi */
484
    put_be32(pb, 0x00480000); /* Vertical resolution 72dpi */
478 485
    put_be32(pb, 0); /* Data size (= 0) */
479 486
    put_be16(pb, 1); /* Frame count (= 1) */
480 487
    
481
    put_be32(pb, 0); /* Reserved */
482
    put_be32(pb, 0); /* Reserved */
483
    put_be32(pb, 0); /* Reserved */
484
    put_be32(pb, 0); /* Reserved */
485
    put_be32(pb, 0); /* Reserved */
486
    put_be32(pb, 0); /* Reserved */
487
    put_be32(pb, 0); /* Reserved */
488
    put_be32(pb, 0); /* Reserved */
488
    memset(compressor_name,0,32);
489
    if (track->enc->codec->name)
490
        strncpy(compressor_name,track->enc->codec->name,31);
491
    put_byte(pb, FFMAX(strlen(compressor_name),32) );
492
    put_buffer(pb, compressor_name, 31);
489 493
    
490 494
    put_be16(pb, 0x18); /* Reserved */
491 495
    put_be16(pb, 0xffff); /* Reserved */

Also available in: Unified diff