Mercurial > libavformat.hg
comparison utils.c @ 197:b8a3fb61d39a libavformat
all human-readable output should go into stderr for now. We really
need a generic logging facility in ffmpeg, but this will suffice for now.
| author | romansh |
|---|---|
| date | Thu, 21 Aug 2003 21:04:19 +0000 |
| parents | 5079b6e20e91 |
| children | 64dbc0b60dbe |
comparison
equal
deleted
inserted
replaced
| 196:01bec1059bdf | 197:b8a3fb61d39a |
|---|---|
| 601 st = ic->streams[i]; | 601 st = ic->streams[i]; |
| 602 if (st->start_time != AV_NOPTS_VALUE && | 602 if (st->start_time != AV_NOPTS_VALUE && |
| 603 st->start_time < start_time) | 603 st->start_time < start_time) |
| 604 start_time = st->start_time; | 604 start_time = st->start_time; |
| 605 } | 605 } |
| 606 printf("start=%lld\n", start_time); | 606 fprintf(stderr, "start=%lld\n", start_time); |
| 607 if (start_time != MAXINT64) | 607 if (start_time != MAXINT64) |
| 608 ic->start_time = start_time; | 608 ic->start_time = start_time; |
| 609 | 609 |
| 610 /* estimate the end time (duration) */ | 610 /* estimate the end time (duration) */ |
| 611 /* XXX: may need to support wrapping */ | 611 /* XXX: may need to support wrapping */ |
| 1171 is_output ? "Output" : "Input", | 1171 is_output ? "Output" : "Input", |
| 1172 index, | 1172 index, |
| 1173 is_output ? ic->oformat->name : ic->iformat->name, | 1173 is_output ? ic->oformat->name : ic->iformat->name, |
| 1174 is_output ? "to" : "from", url); | 1174 is_output ? "to" : "from", url); |
| 1175 if (!is_output) { | 1175 if (!is_output) { |
| 1176 printf(" Duration: "); | 1176 fprintf(stderr, " Duration: "); |
| 1177 if (ic->duration != AV_NOPTS_VALUE) { | 1177 if (ic->duration != AV_NOPTS_VALUE) { |
| 1178 int hours, mins, secs, us; | 1178 int hours, mins, secs, us; |
| 1179 secs = ic->duration / AV_TIME_BASE; | 1179 secs = ic->duration / AV_TIME_BASE; |
| 1180 us = ic->duration % AV_TIME_BASE; | 1180 us = ic->duration % AV_TIME_BASE; |
| 1181 mins = secs / 60; | 1181 mins = secs / 60; |
| 1182 secs %= 60; | 1182 secs %= 60; |
| 1183 hours = mins / 60; | 1183 hours = mins / 60; |
| 1184 mins %= 60; | 1184 mins %= 60; |
| 1185 printf("%02d:%02d:%02d.%01d", hours, mins, secs, | 1185 fprintf(stderr, "%02d:%02d:%02d.%01d", hours, mins, secs, |
| 1186 (10 * us) / AV_TIME_BASE); | 1186 (10 * us) / AV_TIME_BASE); |
| 1187 } else { | 1187 } else { |
| 1188 printf("N/A"); | 1188 fprintf(stderr, "N/A"); |
| 1189 } | 1189 } |
| 1190 printf(", bitrate: "); | 1190 fprintf(stderr, ", bitrate: "); |
| 1191 if (ic->bit_rate) { | 1191 if (ic->bit_rate) { |
| 1192 printf("%d kb/s", ic->bit_rate / 1000); | 1192 fprintf(stderr,"%d kb/s", ic->bit_rate / 1000); |
| 1193 } else { | 1193 } else { |
| 1194 printf("N/A"); | 1194 fprintf(stderr, "N/A"); |
| 1195 } | 1195 } |
| 1196 printf("\n"); | 1196 fprintf(stderr, "\n"); |
| 1197 } | 1197 } |
| 1198 for(i=0;i<ic->nb_streams;i++) { | 1198 for(i=0;i<ic->nb_streams;i++) { |
| 1199 AVStream *st = ic->streams[i]; | 1199 AVStream *st = ic->streams[i]; |
| 1200 avcodec_string(buf, sizeof(buf), &st->codec, is_output); | 1200 avcodec_string(buf, sizeof(buf), &st->codec, is_output); |
| 1201 fprintf(stderr, " Stream #%d.%d", index, i); | 1201 fprintf(stderr, " Stream #%d.%d", index, i); |
