mirror of
https://github.com/mpv-player/mpv
synced 2024-09-09 01:16:56 +02:00
new options: -dumpaudio and -dumpvideo
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@550 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
26c1bdbe2d
commit
46075de1f5
@ -62,6 +62,11 @@ struct config conf[]={
|
|||||||
{"noni", &force_ni, CONF_TYPE_FLAG, 0, 1, 0},
|
{"noni", &force_ni, CONF_TYPE_FLAG, 0, 1, 0},
|
||||||
{"aid", &audio_id, CONF_TYPE_INT, CONF_RANGE, 0, 256},
|
{"aid", &audio_id, CONF_TYPE_INT, CONF_RANGE, 0, 256},
|
||||||
{"vid", &video_id, CONF_TYPE_INT, CONF_RANGE, 0, 256},
|
{"vid", &video_id, CONF_TYPE_INT, CONF_RANGE, 0, 256},
|
||||||
|
|
||||||
|
{"dumpfile", &stream_dump_name, CONF_TYPE_STRING, 0, 0, 0},
|
||||||
|
{"dumpaudio", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 1},
|
||||||
|
{"dumpvideo", &stream_dump_type, CONF_TYPE_FLAG, 0, 0, 2},
|
||||||
|
|
||||||
// {"auds", &avi_header.audio_codec, CONF_TYPE_STRING, 0, 0, 0},
|
// {"auds", &avi_header.audio_codec, CONF_TYPE_STRING, 0, 0, 0},
|
||||||
// {"vids", &avi_header.video_codec, CONF_TYPE_STRING, 0, 0, 0},
|
// {"vids", &avi_header.video_codec, CONF_TYPE_STRING, 0, 0, 0},
|
||||||
{"mc", &default_max_pts_correction, CONF_TYPE_FLOAT, CONF_RANGE, 0, 10},
|
{"mc", &default_max_pts_correction, CONF_TYPE_FLOAT, CONF_RANGE, 0, 10},
|
||||||
|
20
mplayer.c
20
mplayer.c
@ -497,6 +497,8 @@ char *sub_name=NULL;
|
|||||||
float sub_delay=0;
|
float sub_delay=0;
|
||||||
float sub_fps=0;
|
float sub_fps=0;
|
||||||
int sub_auto = 1;
|
int sub_auto = 1;
|
||||||
|
char stream_dump_name=NULL;
|
||||||
|
int stream_dump_type=0;
|
||||||
//int user_bpp=0;
|
//int user_bpp=0;
|
||||||
|
|
||||||
#include "mixer.h"
|
#include "mixer.h"
|
||||||
@ -929,6 +931,24 @@ printf("[V] filefmt:%d fourcc:0x%X size:%dx%d fps:%5.2f ftime:=%6.4f\n",
|
|||||||
|
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
|
if(stream_dump_type){
|
||||||
|
FILE *f;
|
||||||
|
int len;
|
||||||
|
demux_stream_t *ds=(stream_dump_type==1)?d_audio:d_video;
|
||||||
|
demux_stream_t *ds2=(stream_dump_type!=1)?d_audio:d_video;
|
||||||
|
ds_free_packs(ds2); ds2->id=-2; // ignore this stream!
|
||||||
|
f=fopen(stream_dump_name?stream_dump_name:"stream.dump","wb");
|
||||||
|
if(!f){ printf("Can't open dump file!!!\n");exit(1); }
|
||||||
|
while(!ds->eof){
|
||||||
|
char* start;
|
||||||
|
int in_size=ds_get_packet(ds,&start);
|
||||||
|
if(in_size>0) fwrite(start,in_size,1,f);
|
||||||
|
}
|
||||||
|
fclose(f);
|
||||||
|
printf("core dumped :)\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
//================== Init AUDIO (codec) ==========================
|
//================== Init AUDIO (codec) ==========================
|
||||||
if(has_audio){
|
if(has_audio){
|
||||||
// Go through the codec.conf and find the best codec...
|
// Go through the codec.conf and find the best codec...
|
||||||
|
Loading…
Reference in New Issue
Block a user