file /home/wsh/frescor/demo/build-no-frsh/_compiled/bin/recorder
-b url_fopen
-b url_fdopen
-b file_open
-b av_interleaved_write_frame
-# b file_write
-# b av_interleaved_write_frame
-run -s 640x480 -r 15 -f video4linux2 -i /dev/video0
-#run -s 320x240 -f video4linux2 -i /dev/video0
+#b url_fopen
+#b url_fdopen
+#b file_open
+#b av_interleaved_write_frame
+#b file_write
+b file_read
+#run -s 640x480 -r 15 -f video4linux2 -i /dev/video0
+run -i snapshot%02d.png -y stream.mp4
+
SUBDIRS=$(sort $(ALL_OMK_SUBDIRS) ffmpeg)
+
+test:
+ ./_compiled/bin/recorder -i snapshot%02d.png -y test_normal.mp4
+ ./_compiled/bin/recorder -i snapshot%02d.png -y -direct test_direct.mp4
+ hexdump -C test_normal.mp4 > test_normal.hex
+ hexdump -C test_direct.mp4 > test_direct.hex
+ kdiff3 test_normal.hex test_direct.hex
+
static int64_t rec_timestamp = 0;
static int64_t input_ts_offset = 0;
static int file_overwrite = 0;
+static int o_direct = 0;
static int metadata_count;
static AVMetadataTag *metadata;
static int do_benchmark = 0;
}
/* open the file */
- if (url_fopen(&oc->pb, filename, URL_WRONLY|URL_DIRECT) < 0) {
+ if (url_fopen(&oc->pb, filename, o_direct ? URL_RDWR|URL_DIRECT : URL_WRONLY) < 0) {
fprintf(stderr, "Could not open '%s'\n", filename);
av_exit(1);
}
{ "f", HAS_ARG, {(void*)opt_format}, "force format", "fmt" },
{ "i", HAS_ARG, {(void*)opt_input_file}, "input file name", "filename" },
{ "y", OPT_BOOL, {(void*)&file_overwrite}, "overwrite output files" },
+ { "direct", OPT_BOOL, {(void*)&o_direct}, "write to output file using direct I/O (O_DIRECT)" },
{ "map", HAS_ARG | OPT_EXPERT, {(void*)opt_map}, "set input stream mapping", "file:stream[:syncfile:syncstream]" },
{ "map_meta_data", HAS_ARG | OPT_EXPERT, {(void*)opt_map_meta_data}, "set meta data information of outfile from infile", "outfile:infile" },
{ "t", OPT_FUNC2 | HAS_ARG, {(void*)opt_recording_time}, "record or transcode \"duration\" seconds of audio/video", "duration" },