2
2
* FFplay : Simple Media Player based on the ffmpeg libraries
3
3
* Copyright (c) 2003 Fabrice Bellard
5
* This library is free software; you can redistribute it and/or
5
* This file is part of FFmpeg.
7
* FFmpeg is free software; you can redistribute it and/or
6
8
* modify it under the terms of the GNU Lesser General Public
7
9
* License as published by the Free Software Foundation; either
8
* version 2 of the License, or (at your option) any later version.
10
* version 2.1 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
12
* FFmpeg is distributed in the hope that it will be useful,
11
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
15
* Lesser General Public License for more details.
15
17
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
* License along with FFmpeg; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
21
#define HAVE_AV_CONFIG_H
20
22
#include "avformat.h"
22
26
#include "cmdutils.h"
25
29
#include <SDL_thread.h>
28
32
#undef main /* We don't want SDL to override our main() */
31
#if defined(__linux__)
45
DosGetInfoBlocks(&tib, &pib);
47
// Change flag from VIO to PM:
48
if (pib->pib_ultype==2) pib->pib_ultype = 3;
39
52
//#define DEBUG_SYNC
41
54
#define MAX_VIDEOQ_SIZE (5 * 256 * 1024)
42
55
#define MAX_AUDIOQ_SIZE (5 * 16 * 1024)
56
#define MAX_SUBTITLEQ_SIZE (5 * 16 * 1024)
44
58
/* SDL audio buffer size, in samples. Should be small to have precise
45
59
A/V sync as SDL does not have hardware buffer fullness info. */
46
60
#define SDL_AUDIO_BUFFER_SIZE 1024
48
62
/* no AV sync correction is done if below the AV sync threshold */
49
#define AV_SYNC_THRESHOLD 0.08
63
#define AV_SYNC_THRESHOLD 0.01
50
64
/* no AV correction is done if too big error */
51
65
#define AV_NOSYNC_THRESHOLD 10.0
301
366
h2 = s->height - (y + h);
304
fill_rectangle(screen,
308
fill_rectangle(screen,
309
s->xleft + s->width - w2, s->ytop,
312
fill_rectangle(screen,
313
s->xleft + w1, s->ytop,
314
s->width - w1 - w2, h1,
316
fill_rectangle(screen,
369
fill_rectangle(screen,
373
fill_rectangle(screen,
374
s->xleft + s->width - w2, s->ytop,
377
fill_rectangle(screen,
378
s->xleft + w1, s->ytop,
379
s->width - w1 - w2, h1,
381
fill_rectangle(screen,
317
382
s->xleft + w1, s->ytop + s->height - h2,
318
383
s->width - w1 - w2, h2,
391
#define ONE_HALF (1 << (SCALEBITS - 1))
392
#define FIX(x) ((int) ((x) * (1<<SCALEBITS) + 0.5))
394
#define RGB_TO_Y_CCIR(r, g, b) \
395
((FIX(0.29900*219.0/255.0) * (r) + FIX(0.58700*219.0/255.0) * (g) + \
396
FIX(0.11400*219.0/255.0) * (b) + (ONE_HALF + (16 << SCALEBITS))) >> SCALEBITS)
398
#define RGB_TO_U_CCIR(r1, g1, b1, shift)\
399
(((- FIX(0.16874*224.0/255.0) * r1 - FIX(0.33126*224.0/255.0) * g1 + \
400
FIX(0.50000*224.0/255.0) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128)
402
#define RGB_TO_V_CCIR(r1, g1, b1, shift)\
403
(((FIX(0.50000*224.0/255.0) * r1 - FIX(0.41869*224.0/255.0) * g1 - \
404
FIX(0.08131*224.0/255.0) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128)
406
#define ALPHA_BLEND(a, oldp, newp, s)\
407
((((oldp << s) * (255 - (a))) + (newp * (a))) / (255 << s))
409
#define RGBA_IN(r, g, b, a, s)\
411
unsigned int v = ((const uint32_t *)(s))[0];\
412
a = (v >> 24) & 0xff;\
413
r = (v >> 16) & 0xff;\
414
g = (v >> 8) & 0xff;\
418
#define YUVA_IN(y, u, v, a, s, pal)\
420
unsigned int val = ((const uint32_t *)(pal))[*(const uint8_t*)s];\
421
a = (val >> 24) & 0xff;\
422
y = (val >> 16) & 0xff;\
423
u = (val >> 8) & 0xff;\
427
#define YUVA_OUT(d, y, u, v, a)\
429
((uint32_t *)(d))[0] = (a << 24) | (y << 16) | (u << 8) | v;\
435
static void blend_subrect(AVPicture *dst, const AVSubtitleRect *rect)
437
int wrap, wrap3, width2, skip2;
438
int y, u, v, a, u1, v1, a1, w, h;
439
uint8_t *lum, *cb, *cr;
443
lum = dst->data[0] + rect->y * dst->linesize[0];
444
cb = dst->data[1] + (rect->y >> 1) * dst->linesize[1];
445
cr = dst->data[2] + (rect->y >> 1) * dst->linesize[2];
447
width2 = (rect->w + 1) >> 1;
448
skip2 = rect->x >> 1;
449
wrap = dst->linesize[0];
450
wrap3 = rect->linesize;
452
pal = rect->rgba_palette; /* Now in YCrCb! */
460
YUVA_IN(y, u, v, a, p, pal);
461
lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
462
cb[0] = ALPHA_BLEND(a >> 2, cb[0], u, 0);
463
cr[0] = ALPHA_BLEND(a >> 2, cr[0], v, 0);
469
for(w = rect->w - (rect->x & 1); w >= 2; w -= 2) {
470
YUVA_IN(y, u, v, a, p, pal);
474
lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
476
YUVA_IN(y, u, v, a, p + BPP, pal);
480
lum[1] = ALPHA_BLEND(a, lum[1], y, 0);
481
cb[0] = ALPHA_BLEND(a1 >> 2, cb[0], u1, 1);
482
cr[0] = ALPHA_BLEND(a1 >> 2, cr[0], v1, 1);
489
YUVA_IN(y, u, v, a, p, pal);
490
lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
491
cb[0] = ALPHA_BLEND(a >> 2, cb[0], u, 0);
492
cr[0] = ALPHA_BLEND(a >> 2, cr[0], v, 0);
494
p += wrap3 + (wrap3 - rect->w * BPP);
495
lum += wrap + (wrap - rect->w - rect->x);
496
cb += dst->linesize[1] - width2 - skip2;
497
cr += dst->linesize[2] - width2 - skip2;
499
for(h = rect->h - (rect->y & 1); h >= 2; h -= 2) {
505
YUVA_IN(y, u, v, a, p, pal);
509
lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
512
YUVA_IN(y, u, v, a, p, pal);
516
lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
517
cb[0] = ALPHA_BLEND(a1 >> 2, cb[0], u1, 1);
518
cr[0] = ALPHA_BLEND(a1 >> 2, cr[0], v1, 1);
524
for(w = rect->w - (rect->x & 1); w >= 2; w -= 2) {
525
YUVA_IN(y, u, v, a, p, pal);
529
lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
531
YUVA_IN(y, u, v, a, p, pal);
535
lum[1] = ALPHA_BLEND(a, lum[1], y, 0);
539
YUVA_IN(y, u, v, a, p, pal);
543
lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
545
YUVA_IN(y, u, v, a, p, pal);
549
lum[1] = ALPHA_BLEND(a, lum[1], y, 0);
551
cb[0] = ALPHA_BLEND(a1 >> 2, cb[0], u1, 2);
552
cr[0] = ALPHA_BLEND(a1 >> 2, cr[0], v1, 2);
556
p += -wrap3 + 2 * BPP;
560
YUVA_IN(y, u, v, a, p, pal);
564
lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
567
YUVA_IN(y, u, v, a, p, pal);
571
lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
572
cb[0] = ALPHA_BLEND(a1 >> 2, cb[0], u1, 1);
573
cr[0] = ALPHA_BLEND(a1 >> 2, cr[0], v1, 1);
579
p += wrap3 + (wrap3 - rect->w * BPP);
580
lum += wrap + (wrap - rect->w - rect->x);
581
cb += dst->linesize[1] - width2 - skip2;
582
cr += dst->linesize[2] - width2 - skip2;
584
/* handle odd height */
591
YUVA_IN(y, u, v, a, p, pal);
592
lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
593
cb[0] = ALPHA_BLEND(a >> 2, cb[0], u, 0);
594
cr[0] = ALPHA_BLEND(a >> 2, cr[0], v, 0);
600
for(w = rect->w - (rect->x & 1); w >= 2; w -= 2) {
601
YUVA_IN(y, u, v, a, p, pal);
605
lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
607
YUVA_IN(y, u, v, a, p + BPP, pal);
611
lum[1] = ALPHA_BLEND(a, lum[1], y, 0);
612
cb[0] = ALPHA_BLEND(a1 >> 2, cb[0], u, 1);
613
cr[0] = ALPHA_BLEND(a1 >> 2, cr[0], v, 1);
620
YUVA_IN(y, u, v, a, p, pal);
621
lum[0] = ALPHA_BLEND(a, lum[0], y, 0);
622
cb[0] = ALPHA_BLEND(a >> 2, cb[0], u, 0);
623
cr[0] = ALPHA_BLEND(a >> 2, cr[0], v, 0);
628
static void free_subpicture(SubPicture *sp)
632
for (i = 0; i < sp->sub.num_rects; i++)
634
av_free(sp->sub.rects[i].bitmap);
635
av_free(sp->sub.rects[i].rgba_palette);
638
av_free(sp->sub.rects);
640
memset(&sp->sub, 0, sizeof(AVSubtitle));
323
643
static void video_image_display(VideoState *is)
325
645
VideoPicture *vp;
326
648
float aspect_ratio;
327
649
int width, height, x, y;
330
653
vp = &is->pictq[is->pictq_rindex];
332
655
/* XXX: use variable in the frame */
333
aspect_ratio = is->video_st->codec.aspect_ratio;
656
if (is->video_st->codec->sample_aspect_ratio.num == 0)
659
aspect_ratio = av_q2d(is->video_st->codec->sample_aspect_ratio)
660
* is->video_st->codec->width / is->video_st->codec->height;;
334
661
if (aspect_ratio <= 0.0)
335
aspect_ratio = (float)is->video_st->codec.width /
336
(float)is->video_st->codec.height;
662
aspect_ratio = (float)is->video_st->codec->width /
663
(float)is->video_st->codec->height;
337
664
/* if an active format is indicated, then it overrides the
340
if (is->video_st->codec.dtg_active_format != is->dtg_active_format) {
341
is->dtg_active_format = is->video_st->codec.dtg_active_format;
667
if (is->video_st->codec->dtg_active_format != is->dtg_active_format) {
668
is->dtg_active_format = is->video_st->codec->dtg_active_format;
342
669
printf("dtg_active_format=%d\n", is->dtg_active_format);
346
switch(is->video_st->codec.dtg_active_format) {
673
switch(is->video_st->codec->dtg_active_format) {
347
674
case FF_DTG_AFD_SAME:
349
676
/* nothing to do */
412
766
int i, i_start, x, y1, y, ys, delay, n, nb_display_channels;
413
767
int ch, channels, h, h2, bgcolor, fgcolor;
414
768
int16_t time_diff;
416
770
/* compute display index : center on currently output samples */
417
channels = s->audio_st->codec.channels;
771
channels = s->audio_st->codec->channels;
418
772
nb_display_channels = channels;
419
773
if (!s->paused) {
420
774
n = 2 * channels;
421
775
delay = audio_write_get_buf_size(s);
424
778
/* to be more precise, we take into account the time spent since
425
779
the last buffer computation */
426
780
if (audio_callback_time) {
427
781
time_diff = av_gettime() - audio_callback_time;
428
delay += (time_diff * s->audio_st->codec.sample_rate) / 1000000;
782
delay += (time_diff * s->audio_st->codec->sample_rate) / 1000000;
431
785
delay -= s->width / 2;
432
786
if (delay < s->width)
433
787
delay = s->width;
434
i_start = compute_mod(s->sample_array_index - delay * channels, SAMPLE_ARRAY_SIZE);
789
i_start= x = compute_mod(s->sample_array_index - delay * channels, SAMPLE_ARRAY_SIZE);
792
for(i=0; i<1000; i+=channels){
793
int idx= (SAMPLE_ARRAY_SIZE + x - i) % SAMPLE_ARRAY_SIZE;
794
int a= s->sample_array[idx];
795
int b= s->sample_array[(idx + 4*channels)%SAMPLE_ARRAY_SIZE];
796
int c= s->sample_array[(idx + 5*channels)%SAMPLE_ARRAY_SIZE];
797
int d= s->sample_array[(idx + 9*channels)%SAMPLE_ARRAY_SIZE];
799
if(h<score && (b^c)<0){
435
805
s->last_i_start = i_start;
437
807
i_start = s->last_i_start;
440
810
bgcolor = SDL_MapRGB(screen->format, 0x00, 0x00, 0x00);
441
fill_rectangle(screen,
442
s->xleft, s->ytop, s->width, s->height,
811
fill_rectangle(screen,
812
s->xleft, s->ytop, s->width, s->height,
445
815
fgcolor = SDL_MapRGB(screen->format, 0xff, 0xff, 0xff);
849
1343
if (packet_queue_get(&is->videoq, pkt, 1) < 0)
1346
if(pkt->data == flush_pkt.data){
1347
avcodec_flush_buffers(is->video_st->codec);
851
1351
/* NOTE: ipts is the PTS of the _first_ picture beginning in
852
1352
this packet, if any */
855
if (is->video_st->codec.codec_id == CODEC_ID_RAWVIDEO) {
856
avpicture_fill((AVPicture *)&frame, ptr,
857
is->video_st->codec.pix_fmt,
858
is->video_st->codec.width,
859
is->video_st->codec.height);
861
if (ipts != AV_NOPTS_VALUE)
862
pts = (double)ipts * is->ic->pts_num / is->ic->pts_den;
863
frame.pict_type = FF_I_TYPE;
864
if (output_picture2(is, &frame, pts) < 0)
869
if (is->picture_start) {
871
is->picture_start = 0;
872
ipts = AV_NOPTS_VALUE;
874
len1 = avcodec_decode_video(&is->video_st->codec,
875
&frame, &got_picture, ptr, len);
880
if (is->ipts != AV_NOPTS_VALUE)
881
pts = (double)is->ipts * is->ic->pts_num / is->ic->pts_den;
882
if (output_picture2(is, &frame, pts) < 0)
884
is->picture_start = 1;
1354
if (pkt->dts != AV_NOPTS_VALUE)
1355
pts = av_q2d(is->video_st->time_base)*pkt->dts;
1357
len1 = avcodec_decode_video(is->video_st->codec,
1358
frame, &got_picture,
1359
pkt->data, pkt->size);
1363
if (output_picture2(is, frame, pts) < 0)
1366
av_free_packet(pkt);
1369
stream_pause(cur_stream);
1376
static int subtitle_thread(void *arg)
1378
VideoState *is = arg;
1380
AVPacket pkt1, *pkt = &pkt1;
1381
int len1, got_subtitle;
1384
int r, g, b, y, u, v, a;
1387
while (is->paused && !is->subtitleq.abort_request) {
1390
if (packet_queue_get(&is->subtitleq, pkt, 1) < 0)
1393
if(pkt->data == flush_pkt.data){
1394
avcodec_flush_buffers(is->subtitle_st->codec);
1397
SDL_LockMutex(is->subpq_mutex);
1398
while (is->subpq_size >= SUBPICTURE_QUEUE_SIZE &&
1399
!is->subtitleq.abort_request) {
1400
SDL_CondWait(is->subpq_cond, is->subpq_mutex);
1402
SDL_UnlockMutex(is->subpq_mutex);
1404
if (is->subtitleq.abort_request)
1407
sp = &is->subpq[is->subpq_windex];
1409
/* NOTE: ipts is the PTS of the _first_ picture beginning in
1410
this packet, if any */
1412
if (pkt->pts != AV_NOPTS_VALUE)
1413
pts = av_q2d(is->subtitle_st->time_base)*pkt->pts;
1415
len1 = avcodec_decode_subtitle(is->subtitle_st->codec,
1416
&sp->sub, &got_subtitle,
1417
pkt->data, pkt->size);
1420
if (got_subtitle && sp->sub.format == 0) {
1423
for (i = 0; i < sp->sub.num_rects; i++)
1425
for (j = 0; j < sp->sub.rects[i].nb_colors; j++)
1427
RGBA_IN(r, g, b, a, sp->sub.rects[i].rgba_palette + j);
1428
y = RGB_TO_Y_CCIR(r, g, b);
1429
u = RGB_TO_U_CCIR(r, g, b, 0);
1430
v = RGB_TO_V_CCIR(r, g, b, 0);
1431
YUVA_OUT(sp->sub.rects[i].rgba_palette + j, y, u, v, a);
1435
/* now we can update the picture count */
1436
if (++is->subpq_windex == SUBPICTURE_QUEUE_SIZE)
1437
is->subpq_windex = 0;
1438
SDL_LockMutex(is->subpq_mutex);
1440
SDL_UnlockMutex(is->subpq_mutex);
1442
av_free_packet(pkt);
1445
// stream_pause(cur_stream);
995
1550
static int audio_decode_frame(VideoState *is, uint8_t *audio_buf, double *pts_ptr)
997
1552
AVPacket *pkt = &is->audio_pkt;
1553
int n, len1, data_size;
1002
if (is->paused || is->audioq.abort_request) {
1557
/* NOTE: the audio packet can contain several frames */
1005
1558
while (is->audio_pkt_size > 0) {
1006
len1 = avcodec_decode_audio(&is->audio_st->codec,
1007
(int16_t *)audio_buf, &data_size,
1559
len1 = avcodec_decode_audio(is->audio_st->codec,
1560
(int16_t *)audio_buf, &data_size,
1008
1561
is->audio_pkt_data, is->audio_pkt_size);
1563
/* if error, we skip the frame */
1564
is->audio_pkt_size = 0;
1011
1568
is->audio_pkt_data += len1;
1012
1569
is->audio_pkt_size -= len1;
1013
if (data_size > 0) {
1015
if (is->audio_pkt_ipts != AV_NOPTS_VALUE)
1016
pts = (double)is->audio_pkt_ipts * is->ic->pts_num / is->ic->pts_den;
1017
/* if no pts, then compute it */
1019
is->audio_clock = pts;
1022
n = 2 * is->audio_st->codec.channels;
1023
is->audio_clock += (double)data_size / (double)(n * is->audio_st->codec.sample_rate);
1572
/* if no pts, then compute it */
1573
pts = is->audio_clock;
1575
n = 2 * is->audio_st->codec->channels;
1576
is->audio_clock += (double)data_size /
1577
(double)(n * is->audio_st->codec->sample_rate);
1025
1578
#if defined(DEBUG_SYNC)
1027
static double last_clock;
1028
printf("audio: delay=%0.3f clock=%0.3f pts=%0.3f\n",
1029
is->audio_clock - last_clock,
1030
is->audio_clock, pts);
1031
last_clock = is->audio_clock;
1580
static double last_clock;
1581
printf("audio: delay=%0.3f clock=%0.3f pts=%0.3f\n",
1582
is->audio_clock - last_clock,
1583
is->audio_clock, pts);
1584
last_clock = is->audio_clock;
1034
*pts_ptr = is->audio_clock;
1035
is->audio_pkt_ipts = AV_NOPTS_VALUE;
1036
/* we got samples : we can exit now */
1041
/* free previous packet if any */
1590
/* free the current packet */
1043
1592
av_free_packet(pkt);
1594
if (is->paused || is->audioq.abort_request) {
1045
1598
/* read next packet */
1046
1599
if (packet_queue_get(&is->audioq, pkt, 1) < 0)
1601
if(pkt->data == flush_pkt.data){
1602
avcodec_flush_buffers(is->audio_st->codec);
1048
1606
is->audio_pkt_data = pkt->data;
1049
1607
is->audio_pkt_size = pkt->size;
1050
is->audio_pkt_ipts = pkt->pts;
1609
/* if update the audio clock with the pts */
1610
if (pkt->pts != AV_NOPTS_VALUE) {
1611
is->audio_clock = av_q2d(is->audio_st->time_base)*pkt->pts;
1317
1971
#ifdef CONFIG_NETWORK
1318
1972
if (is->paused != is->last_paused) {
1319
1973
is->last_paused = is->paused;
1320
if (ic->iformat == &rtsp_demux) {
1327
if (is->paused && ic->iformat == &rtsp_demux) {
1979
if (is->paused && ic->iformat == &rtsp_demuxer) {
1328
1980
/* wait 10 ms to avoid trying to get another packet */
1329
1981
/* XXX: horrible */
1987
int stream_index= -1;
1988
int64_t seek_target= is->seek_pos;
1990
if (is-> video_stream >= 0) stream_index= is-> video_stream;
1991
else if(is-> audio_stream >= 0) stream_index= is-> audio_stream;
1992
else if(is->subtitle_stream >= 0) stream_index= is->subtitle_stream;
1994
if(stream_index>=0){
1995
seek_target= av_rescale_q(seek_target, AV_TIME_BASE_Q, ic->streams[stream_index]->time_base);
1998
ret = av_seek_frame(is->ic, stream_index, seek_target, is->seek_flags);
2000
fprintf(stderr, "%s: error while seeking\n", is->ic->filename);
2002
if (is->audio_stream >= 0) {
2003
packet_queue_flush(&is->audioq);
2004
packet_queue_put(&is->audioq, &flush_pkt);
2006
if (is->subtitle_stream >= 0) {
2007
packet_queue_flush(&is->subtitleq);
2008
packet_queue_put(&is->subtitleq, &flush_pkt);
2010
if (is->video_stream >= 0) {
2011
packet_queue_flush(&is->videoq);
2012
packet_queue_put(&is->videoq, &flush_pkt);
1335
2018
/* if the queue are full, no need to read more */
1336
2019
if (is->audioq.size > MAX_AUDIOQ_SIZE ||
1337
is->videoq.size > MAX_VIDEOQ_SIZE) {
2020
is->videoq.size > MAX_VIDEOQ_SIZE ||
2021
is->subtitleq.size > MAX_SUBTITLEQ_SIZE ||
2022
url_feof(&ic->pb)) {
1338
2023
/* wait 10 ms */
1342
ret = av_read_packet(ic, pkt);
2027
ret = av_read_frame(ic, pkt);
2029
if (url_ferror(&ic->pb) == 0) {
2030
SDL_Delay(100); /* wait for user event */
1346
2035
if (pkt->stream_index == is->audio_stream) {
1347
2036
packet_queue_put(&is->audioq, pkt);
1348
2037
} else if (pkt->stream_index == is->video_stream) {
1349
2038
packet_queue_put(&is->videoq, pkt);
2039
} else if (pkt->stream_index == is->subtitle_stream) {
2040
packet_queue_put(&is->subtitleq, pkt);
1351
2042
av_free_packet(pkt);
2406
void opt_seek(const char *arg)
2408
start_time = parse_date(arg, 1);
2411
static void opt_debug(const char *arg)
2417
static void opt_vismv(const char *arg)
2419
debug_mv = atoi(arg);
2422
static void opt_thread_count(const char *arg)
2424
thread_count= atoi(arg);
2425
#if !defined(HAVE_THREADS)
2426
fprintf(stderr, "Warning: not compiled with thread support, using thread emulation\n");
1647
2430
const OptionDef options[] = {
1648
2431
{ "h", 0, {(void*)show_help}, "show help" },
1649
2432
{ "x", HAS_ARG, {(void*)opt_width}, "force displayed width", "width" },
1650
2433
{ "y", HAS_ARG, {(void*)opt_height}, "force displayed height", "height" },
1652
/* disabled as SDL/X11 does not support it correctly on application launch */
2434
{ "s", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_size}, "set frame size (WxH or abbreviation)", "size" },
1653
2435
{ "fs", OPT_BOOL, {(void*)&is_full_screen}, "force full screen" },
1655
2436
{ "an", OPT_BOOL, {(void*)&audio_disable}, "disable audio" },
1656
2437
{ "vn", OPT_BOOL, {(void*)&video_disable}, "disable video" },
2438
{ "ast", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&wanted_audio_stream}, "", "" },
2439
{ "ss", HAS_ARG, {(void*)&opt_seek}, "seek to a given position in seconds", "pos" },
2440
{ "bytes", OPT_BOOL, {(void*)&seek_by_bytes}, "seek by bytes" },
1657
2441
{ "nodisp", OPT_BOOL, {(void*)&display_disable}, "disable graphical display" },
1658
2442
{ "f", HAS_ARG, {(void*)opt_format}, "force format", "fmt" },
1659
{ "img", HAS_ARG, {(void*)opt_image_format}, "force image format", "img_fmt" },
2443
{ "pix_fmt", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)opt_frame_pix_fmt}, "set pixel format", "format" },
1660
2444
{ "stats", OPT_BOOL | OPT_EXPERT, {(void*)&show_status}, "show status", "" },
2445
{ "debug", HAS_ARG | OPT_EXPERT, {(void*)opt_debug}, "print specific debug info", "" },
2446
{ "bug", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&workaround_bugs}, "workaround bugs", "" },
2447
{ "vismv", HAS_ARG | OPT_EXPERT, {(void*)opt_vismv}, "visualize motion vectors", "" },
2448
{ "fast", OPT_BOOL | OPT_EXPERT, {(void*)&fast}, "non spec compliant optimizations", "" },
2449
{ "genpts", OPT_BOOL | OPT_EXPERT, {(void*)&genpts}, "generate pts", "" },
2450
{ "lowres", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&lowres}, "", "" },
2451
{ "skiploop", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&skip_loop_filter}, "", "" },
2452
{ "skipframe", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&skip_frame}, "", "" },
2453
{ "skipidct", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&skip_idct}, "", "" },
2454
{ "idct", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&idct}, "set idct algo", "algo" },
2455
{ "er", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&error_resilience}, "set error detection threshold (0-4)", "threshold" },
2456
{ "ec", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&error_concealment}, "set error concealment options", "bit_mask" },
1661
2457
#ifdef CONFIG_NETWORK
1662
2458
{ "rtp_tcp", OPT_EXPERT, {(void*)&opt_rtp_tcp}, "force RTP/TCP protocol usage", "" },
1664
{ "sync", HAS_ARG | OPT_EXPERT, {(void*)&opt_sync}, "set audio-video sync. type (type=audio/video/ext)", "type" },
2460
{ "sync", HAS_ARG | OPT_EXPERT, {(void*)opt_sync}, "set audio-video sync. type (type=audio/video/ext)", "type" },
2461
{ "threads", HAS_ARG | OPT_EXPERT, {(void*)opt_thread_count}, "thread count", "count" },
1668
2465
void show_help(void)
1670
printf("ffplay version " FFMPEG_VERSION ", Copyright (c) 2003 Fabrice Bellard\n"
2467
printf("ffplay version " FFMPEG_VERSION ", Copyright (c) 2003-2006 Fabrice Bellard, et al.\n"
1671
2468
"usage: ffplay [options] input_file\n"
1672
2469
"Simple media player\n");