300 continue; |
300 continue; |
301 AVCodecContext* pCodec = pContext->streams[i]->codec; |
301 AVCodecContext* pCodec = pContext->streams[i]->codec; |
302 if (!pCodec) |
302 if (!pCodec) |
303 continue; |
303 continue; |
304 |
304 |
|
305 |
|
306 AVCodec* pDecoder = avcodec_find_decoder(pCodec->codec_id); |
|
307 QString decoderName = pDecoder ? pDecoder->name : tr("unknown"); |
305 if (pCodec->codec_type == AVMEDIA_TYPE_VIDEO) |
308 if (pCodec->codec_type == AVMEDIA_TYPE_VIDEO) |
306 { |
309 { |
307 desc += QString(tr("Video: %1x%2")).arg(pCodec->width).arg(pCodec->height) + ", "; |
|
308 if (pStream->avg_frame_rate.den) |
310 if (pStream->avg_frame_rate.den) |
309 { |
311 { |
310 float fps = float(pStream->avg_frame_rate.num)/pStream->avg_frame_rate.den; |
312 float fps = float(pStream->avg_frame_rate.num)/pStream->avg_frame_rate.den; |
311 desc += QString(tr("%1 FPS")).arg(fps, 0, 'f', 2) + ", "; |
313 //: Video metadata. %1 = video width, %2 = video height, %3 = frames per second = %4 = decoder name |
|
314 desc += QString(tr("Video: %1x%2, %3 FPS, %4")).arg(pCodec->width).arg(pCodec->height).arg(QLocale().toString(fps, 'f', 2)).arg(decoderName); |
312 } |
315 } |
|
316 else |
|
317 { |
|
318 //: Video metadata. %1 = video width, %2 = video height, %3 = decoder name |
|
319 desc += QString(tr("Video: %1x%2, %3")).arg(pCodec->width).arg(pCodec->height).arg(decoderName); |
|
320 } |
313 } |
321 } |
314 else if (pCodec->codec_type == AVMEDIA_TYPE_AUDIO) |
322 else if (pCodec->codec_type == AVMEDIA_TYPE_AUDIO) |
|
323 { |
315 desc += tr("Audio: "); |
324 desc += tr("Audio: "); |
|
325 desc += decoderName; |
|
326 } |
316 else |
327 else |
317 continue; |
328 continue; |
318 AVCodec* pDecoder = avcodec_find_decoder(pCodec->codec_id); |
|
319 desc += pDecoder? pDecoder->name : tr("unknown"); |
|
320 desc += "\n"; |
329 desc += "\n"; |
321 } |
330 } |
322 AVDictionaryEntry* pComment = av_dict_get(pContext->metadata, "comment", NULL, 0); |
331 AVDictionaryEntry* pComment = av_dict_get(pContext->metadata, "comment", NULL, 0); |
323 if (pComment) |
332 if (pComment) |
324 { |
333 { |