You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

642 lines
18KB

  1. /*
  2. * Avi/AvxSynth support
  3. * Copyright (c) 2012 AvxSynth Team.
  4. *
  5. * This file is part of FFmpeg
  6. * FFmpeg is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * FFmpeg is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with FFmpeg; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #include "avformat.h"
  21. #include "internal.h"
  22. #include "libavcodec/internal.h"
  23. // Enable function pointer definitions for runtime loading.
  24. #define AVSC_NO_DECLSPEC
  25. // Shut up ffmpeg error messages.
  26. // avisynth_c.h contains inline functions that call these functions.
  27. #undef malloc
  28. #undef free
  29. #undef printf
  30. // Platform-specific directives for AviSynth vs AvxSynth.
  31. #ifdef _WIN32
  32. #include <windows.h>
  33. #undef EXTERN_C
  34. #include "compat/avisynth/avisynth_c.h"
  35. #define AVISYNTH_LIB "avisynth"
  36. #else
  37. #include <dlfcn.h>
  38. #include "compat/avisynth/avxsynth_c.h"
  39. #if defined (__APPLE__)
  40. #define AVISYNTH_LIB "libavxsynth.dylib"
  41. #else
  42. #define AVISYNTH_LIB "libavxsynth.so"
  43. #endif
  44. #define LoadLibrary(x) dlopen(x, RTLD_NOW | RTLD_GLOBAL)
  45. #define GetProcAddress dlsym
  46. #define FreeLibrary dlclose
  47. #endif
  48. // AvxSynth doesn't have these colorspaces, so disable them
  49. #ifndef _WIN32
  50. #define avs_is_yv24(vi) 0
  51. #define avs_is_yv16(vi) 0
  52. #define avs_is_yv411(vi) 0
  53. #define avs_is_y8(vi) 0
  54. #endif
  55. typedef struct {
  56. void *library;
  57. #define AVSC_DECLARE_FUNC(name) name##_func name
  58. AVSC_DECLARE_FUNC(avs_create_script_environment);
  59. AVSC_DECLARE_FUNC(avs_delete_script_environment);
  60. AVSC_DECLARE_FUNC(avs_get_error);
  61. AVSC_DECLARE_FUNC(avs_clip_get_error);
  62. AVSC_DECLARE_FUNC(avs_invoke);
  63. AVSC_DECLARE_FUNC(avs_release_value);
  64. AVSC_DECLARE_FUNC(avs_get_video_info);
  65. AVSC_DECLARE_FUNC(avs_take_clip);
  66. AVSC_DECLARE_FUNC(avs_release_clip);
  67. AVSC_DECLARE_FUNC(avs_bit_blt);
  68. AVSC_DECLARE_FUNC(avs_get_audio);
  69. AVSC_DECLARE_FUNC(avs_get_frame);
  70. AVSC_DECLARE_FUNC(avs_release_video_frame);
  71. #undef AVSC_DECLARE_FUNC
  72. } AviSynthLibrary;
  73. struct AviSynthContext {
  74. AVS_ScriptEnvironment *env;
  75. AVS_Clip *clip;
  76. const AVS_VideoInfo *vi;
  77. // avisynth_read_packet_video() iterates over this.
  78. int n_planes;
  79. const int *planes;
  80. int curr_stream;
  81. int curr_frame;
  82. int64_t curr_sample;
  83. int error;
  84. // Linked list pointers.
  85. struct AviSynthContext *next;
  86. };
  87. typedef struct AviSynthContext AviSynthContext;
  88. static const int avs_planes_packed[1] = {0};
  89. static const int avs_planes_grey[1] = {AVS_PLANAR_Y};
  90. static const int avs_planes_yuv[3] = {AVS_PLANAR_Y, AVS_PLANAR_U, AVS_PLANAR_V};
  91. // A conflict between C++ global objects, atexit, and dynamic loading requires
  92. // us to register our own atexit handler to prevent double freeing.
  93. static AviSynthLibrary *avs_library = NULL;
  94. static int avs_atexit_called = 0;
  95. // Linked list of AviSynthContexts. An atexit handler destroys this list.
  96. static AviSynthContext *avs_ctx_list = NULL;
  97. static av_cold void avisynth_atexit_handler(void);
  98. static av_cold int avisynth_load_library(void) {
  99. avs_library = av_mallocz(sizeof(AviSynthLibrary));
  100. if (!avs_library)
  101. return AVERROR_UNKNOWN;
  102. avs_library->library = LoadLibrary(AVISYNTH_LIB);
  103. if (!avs_library->library)
  104. goto init_fail;
  105. #define LOAD_AVS_FUNC(name, continue_on_fail) \
  106. { \
  107. avs_library->name = (void*)GetProcAddress(avs_library->library, #name); \
  108. if(!continue_on_fail && !avs_library->name) \
  109. goto fail; \
  110. }
  111. LOAD_AVS_FUNC(avs_create_script_environment, 0);
  112. LOAD_AVS_FUNC(avs_delete_script_environment, 0);
  113. LOAD_AVS_FUNC(avs_get_error, 1); // New to AviSynth 2.6
  114. LOAD_AVS_FUNC(avs_clip_get_error, 0);
  115. LOAD_AVS_FUNC(avs_invoke, 0);
  116. LOAD_AVS_FUNC(avs_release_value, 0);
  117. LOAD_AVS_FUNC(avs_get_video_info, 0);
  118. LOAD_AVS_FUNC(avs_take_clip, 0);
  119. LOAD_AVS_FUNC(avs_release_clip, 0);
  120. LOAD_AVS_FUNC(avs_bit_blt, 0);
  121. LOAD_AVS_FUNC(avs_get_audio, 0);
  122. LOAD_AVS_FUNC(avs_get_frame, 0);
  123. LOAD_AVS_FUNC(avs_release_video_frame, 0);
  124. #undef LOAD_AVS_FUNC
  125. atexit(avisynth_atexit_handler);
  126. return 0;
  127. fail:
  128. FreeLibrary(avs_library->library);
  129. init_fail:
  130. av_freep(&avs_library);
  131. return AVERROR_UNKNOWN;
  132. }
  133. // Note that avisynth_context_create and avisynth_context_destroy
  134. // do not allocate or free the actual context! That is taken care of
  135. // by libavformat.
  136. static av_cold int avisynth_context_create(AVFormatContext *s) {
  137. AviSynthContext *avs = (AviSynthContext *)s->priv_data;
  138. int ret;
  139. if (!avs_library) {
  140. if (ret = avisynth_load_library())
  141. return ret;
  142. }
  143. if (!avs)
  144. return AVERROR_UNKNOWN;
  145. if (!avs_ctx_list) {
  146. avs_ctx_list = avs;
  147. } else {
  148. avs->next = avs_ctx_list;
  149. avs_ctx_list = avs;
  150. }
  151. avs->env = avs_library->avs_create_script_environment(3);
  152. if (avs_library->avs_get_error) {
  153. const char *error = avs_library->avs_get_error(avs->env);
  154. if (error) {
  155. av_log(s, AV_LOG_ERROR, "%s\n", error);
  156. av_free(avs);
  157. return AVERROR_UNKNOWN;
  158. }
  159. }
  160. return 0;
  161. }
  162. static av_cold void avisynth_context_destroy(AviSynthContext *avs) {
  163. if (avs_atexit_called)
  164. return;
  165. if (avs == avs_ctx_list) {
  166. avs_ctx_list = avs->next;
  167. } else {
  168. AviSynthContext *prev = avs_ctx_list;
  169. while (prev->next != avs)
  170. prev = prev->next;
  171. prev->next = avs->next;
  172. }
  173. if (avs->clip) {
  174. avs_library->avs_release_clip(avs->clip);
  175. avs->clip = NULL;
  176. }
  177. if (avs->env) {
  178. avs_library->avs_delete_script_environment(avs->env);
  179. avs->env = NULL;
  180. }
  181. }
  182. static av_cold void avisynth_atexit_handler(void) {
  183. AviSynthContext *avs = avs_ctx_list;
  184. while (avs) {
  185. AviSynthContext *next = avs->next;
  186. avisynth_context_destroy(avs);
  187. avs = next;
  188. }
  189. FreeLibrary(avs_library->library);
  190. av_freep(&avs_library);
  191. avs_atexit_called = 1;
  192. }
  193. // Create AVStream from audio and video data.
  194. static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st) {
  195. AviSynthContext *avs = s->priv_data;
  196. int planar = 0; // 0: packed, 1: YUV, 2: Y8
  197. st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
  198. st->codec->codec_id = CODEC_ID_RAWVIDEO;
  199. st->codec->width = avs->vi->width;
  200. st->codec->height = avs->vi->height;
  201. st->time_base = (AVRational) {avs->vi->fps_denominator, avs->vi->fps_numerator};
  202. st->avg_frame_rate = (AVRational) {avs->vi->fps_numerator, avs->vi->fps_denominator};
  203. st->start_time = 0;
  204. st->duration = avs->vi->num_frames;
  205. st->nb_frames = avs->vi->num_frames;
  206. switch (avs->vi->pixel_type) {
  207. #ifdef _WIN32
  208. case AVS_CS_YV24:
  209. st->codec->pix_fmt = PIX_FMT_YUV444P;
  210. planar = 1;
  211. break;
  212. case AVS_CS_YV16:
  213. st->codec->pix_fmt = PIX_FMT_YUV422P;
  214. planar = 1;
  215. break;
  216. case AVS_CS_YV411:
  217. st->codec->pix_fmt = PIX_FMT_YUV411P;
  218. planar = 1;
  219. break;
  220. case AVS_CS_Y8:
  221. st->codec->pix_fmt = PIX_FMT_GRAY8;
  222. planar = 2;
  223. break;
  224. #endif
  225. case AVS_CS_BGR24:
  226. st->codec->pix_fmt = PIX_FMT_RGB24;
  227. break;
  228. case AVS_CS_BGR32:
  229. st->codec->pix_fmt = PIX_FMT_RGB32;
  230. break;
  231. case AVS_CS_YUY2:
  232. st->codec->pix_fmt = PIX_FMT_YUYV422;
  233. break;
  234. case AVS_CS_YV12:
  235. st->codec->pix_fmt = PIX_FMT_YUV420P;
  236. planar = 1;
  237. break;
  238. case AVS_CS_I420: // Is this even used anywhere?
  239. st->codec->pix_fmt = PIX_FMT_YUV420P;
  240. planar = 1;
  241. break;
  242. default:
  243. av_log(s, AV_LOG_ERROR, "unknown AviSynth colorspace %d\n", avs->vi->pixel_type);
  244. avs->error = 1;
  245. return AVERROR_UNKNOWN;
  246. }
  247. switch (planar) {
  248. case 2: // Y8
  249. avs->n_planes = 1;
  250. avs->planes = avs_planes_grey;
  251. break;
  252. case 1: // YUV
  253. avs->n_planes = 3;
  254. avs->planes = avs_planes_yuv;
  255. break;
  256. default:
  257. avs->n_planes = 1;
  258. avs->planes = avs_planes_packed;
  259. }
  260. return 0;
  261. }
  262. static int avisynth_create_stream_audio(AVFormatContext *s, AVStream *st) {
  263. AviSynthContext *avs = s->priv_data;
  264. st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
  265. st->codec->sample_rate = avs->vi->audio_samples_per_second;
  266. st->codec->channels = avs->vi->nchannels;
  267. st->time_base = (AVRational) {1, avs->vi->audio_samples_per_second};
  268. switch (avs->vi->sample_type) {
  269. case AVS_SAMPLE_INT8:
  270. st->codec->codec_id = CODEC_ID_PCM_U8;
  271. break;
  272. case AVS_SAMPLE_INT16:
  273. st->codec->codec_id = CODEC_ID_PCM_S16LE;
  274. break;
  275. case AVS_SAMPLE_INT24:
  276. st->codec->codec_id = CODEC_ID_PCM_S24LE;
  277. break;
  278. case AVS_SAMPLE_INT32:
  279. st->codec->codec_id = CODEC_ID_PCM_S32LE;
  280. break;
  281. case AVS_SAMPLE_FLOAT:
  282. st->codec->codec_id = CODEC_ID_PCM_F32LE;
  283. break;
  284. default:
  285. av_log(s, AV_LOG_ERROR, "unknown AviSynth sample type %d\n", avs->vi->sample_type);
  286. avs->error = 1;
  287. return AVERROR_UNKNOWN;
  288. }
  289. return 0;
  290. }
  291. static int avisynth_create_stream(AVFormatContext *s) {
  292. AviSynthContext *avs = s->priv_data;
  293. AVStream *st;
  294. int ret;
  295. int id = 0;
  296. if (avs_has_video(avs->vi)) {
  297. st = avformat_new_stream(s, NULL);
  298. if (!st)
  299. return AVERROR_UNKNOWN;
  300. st->id = id++;
  301. if (ret = avisynth_create_stream_video(s, st))
  302. return ret;
  303. }
  304. if (avs_has_audio(avs->vi)) {
  305. st = avformat_new_stream(s, NULL);
  306. if (!st)
  307. return AVERROR_UNKNOWN;
  308. st->id = id++;
  309. if (ret = avisynth_create_stream_audio(s, st))
  310. return ret;
  311. }
  312. return 0;
  313. }
  314. static int avisynth_open_file(AVFormatContext *s) {
  315. AviSynthContext *avs = (AviSynthContext *)s->priv_data;
  316. AVS_Value arg, val;
  317. int ret;
  318. if (ret = avisynth_context_create(s))
  319. return ret;
  320. arg = avs_new_value_string(s->filename);
  321. val = avs_library->avs_invoke(avs->env, "Import", arg, 0);
  322. if (avs_is_error(val)) {
  323. av_log(s, AV_LOG_ERROR, "%s\n", avs_as_error(val));
  324. ret = AVERROR_UNKNOWN;
  325. goto fail;
  326. }
  327. if (!avs_is_clip(val)) {
  328. av_log(s, AV_LOG_ERROR, "%s\n", "AviSynth script did not return a clip");
  329. ret = AVERROR_UNKNOWN;
  330. goto fail;
  331. }
  332. avs->clip = avs_library->avs_take_clip(val, avs->env);
  333. avs->vi = avs_library->avs_get_video_info(avs->clip);
  334. // Release the AVS_Value as it will go out of scope.
  335. avs_library->avs_release_value(val);
  336. if (ret = avisynth_create_stream(s))
  337. goto fail;
  338. return 0;
  339. fail:
  340. avisynth_context_destroy(avs);
  341. return ret;
  342. }
  343. static void avisynth_next_stream(AVFormatContext *s, AVStream **st, AVPacket *pkt, int *discard) {
  344. AviSynthContext *avs = s->priv_data;
  345. pkt->stream_index = avs->curr_stream++;
  346. avs->curr_stream %= s->nb_streams;
  347. *st = s->streams[pkt->stream_index];
  348. if ((*st)->discard == AVDISCARD_ALL)
  349. *discard = 1;
  350. else
  351. *discard = 0;
  352. return;
  353. }
  354. // Copy AviSynth clip data into an AVPacket.
  355. static int avisynth_read_packet_video(AVFormatContext *s, AVPacket *pkt, int discard) {
  356. AviSynthContext *avs = s->priv_data;
  357. AVS_VideoFrame *frame;
  358. unsigned char* dst_p;
  359. const unsigned char* src_p;
  360. int i, plane, rowsize, planeheight, pitch, bits;
  361. const char* error;
  362. if (avs->curr_frame >= avs->vi->num_frames)
  363. return AVERROR_EOF;
  364. // This must happen even if the stream is discarded to prevent desync.
  365. avs->curr_frame++;
  366. if (discard)
  367. return 0;
  368. pkt->pts = avs->curr_frame;
  369. pkt->dts = avs->curr_frame;
  370. pkt->duration = 1;
  371. // Define the bpp values for the new AviSynth 2.6 colorspaces
  372. if (avs_is_yv24(avs->vi)) {
  373. bits = 24;
  374. } else if (avs_is_yv16(avs->vi)) {
  375. bits = 16;
  376. } else if (avs_is_yv411(avs->vi)) {
  377. bits = 12;
  378. } else if (avs_is_y8(avs->vi)) {
  379. bits = 8;
  380. } else {
  381. bits = avs_bits_per_pixel(avs->vi);
  382. }
  383. // Without cast to int64_t, calculation overflows at about 9k x 9k resolution.
  384. pkt->size = (((int64_t)avs->vi->width * (int64_t)avs->vi->height) * bits) / 8;
  385. if (!pkt->size)
  386. return AVERROR_UNKNOWN;
  387. pkt->data = av_malloc(pkt->size);
  388. if (!pkt->data)
  389. return AVERROR_UNKNOWN;
  390. frame = avs_library->avs_get_frame(avs->clip, avs->curr_frame);
  391. error = avs_library->avs_clip_get_error(avs->clip);
  392. if (error) {
  393. av_log(s, AV_LOG_ERROR, "%s\n", error);
  394. avs->error = 1;
  395. av_freep(&pkt->data);
  396. return AVERROR_UNKNOWN;
  397. }
  398. dst_p = pkt->data;
  399. for (i = 0; i < avs->n_planes; i++) {
  400. plane = avs->planes[i];
  401. src_p = avs_get_read_ptr_p(frame, plane);
  402. rowsize = avs_get_row_size_p(frame, plane);
  403. planeheight = avs_get_height_p(frame, plane);
  404. pitch = avs_get_pitch_p(frame, plane);
  405. // Flip RGB video.
  406. if (avs_is_rgb24(avs->vi) || avs_is_rgb(avs->vi)) {
  407. src_p = src_p + (planeheight - 1) * pitch;
  408. pitch = -pitch;
  409. }
  410. avs_library->avs_bit_blt(avs->env, dst_p, rowsize, src_p, pitch, rowsize, planeheight);
  411. dst_p += rowsize * planeheight;
  412. }
  413. avs_library->avs_release_video_frame(frame);
  414. return 0;
  415. }
  416. static int avisynth_read_packet_audio(AVFormatContext *s, AVPacket *pkt, int discard) {
  417. AviSynthContext *avs = s->priv_data;
  418. AVRational fps, samplerate;
  419. int samples;
  420. const char* error;
  421. if (avs->curr_sample >= avs->vi->num_audio_samples)
  422. return AVERROR_EOF;
  423. fps.num = avs->vi->fps_numerator;
  424. fps.den = avs->vi->fps_denominator;
  425. samplerate.num = avs->vi->audio_samples_per_second;
  426. samplerate.den = 1;
  427. if (avs_has_video(avs->vi)) {
  428. if (avs->curr_frame < avs->vi->num_frames)
  429. samples = av_rescale_q(avs->curr_frame, samplerate, fps) - avs->curr_sample;
  430. else
  431. samples = av_rescale_q(1, samplerate, fps);
  432. } else {
  433. samples = 1000;
  434. }
  435. // After seeking, audio may catch up with video.
  436. if (samples <= 0) {
  437. pkt->size = 0;
  438. pkt->data = NULL;
  439. return 0;
  440. }
  441. if (avs->curr_sample + samples > avs->vi->num_audio_samples)
  442. samples = avs->vi->num_audio_samples - avs->curr_sample;
  443. // This must happen even if the stream is discarded to prevent desync.
  444. avs->curr_sample += samples;
  445. if (discard)
  446. return 0;
  447. pkt->pts = avs->curr_sample;
  448. pkt->dts = avs->curr_sample;
  449. pkt->duration = samples;
  450. pkt->size = avs_bytes_per_channel_sample(avs->vi) * samples * avs->vi->nchannels;
  451. if (!pkt->size)
  452. return AVERROR_UNKNOWN;
  453. pkt->data = av_malloc(pkt->size);
  454. if (!pkt->data)
  455. return AVERROR_UNKNOWN;
  456. avs_library->avs_get_audio(avs->clip, pkt->data, avs->curr_sample, samples);
  457. error = avs_library->avs_clip_get_error(avs->clip);
  458. if (error) {
  459. av_log(s, AV_LOG_ERROR, "%s\n", error);
  460. avs->error = 1;
  461. av_freep(&pkt->data);
  462. return AVERROR_UNKNOWN;
  463. }
  464. return 0;
  465. }
  466. static av_cold int avisynth_read_header(AVFormatContext *s) {
  467. int ret;
  468. // Calling library must implement a lock for thread-safe opens.
  469. if (ret = avpriv_lock_avformat())
  470. return ret;
  471. if (ret = avisynth_open_file(s)) {
  472. avpriv_unlock_avformat();
  473. return ret;
  474. }
  475. avpriv_unlock_avformat();
  476. return 0;
  477. }
  478. static int avisynth_read_packet(AVFormatContext *s, AVPacket *pkt) {
  479. AviSynthContext *avs = s->priv_data;
  480. AVStream *st;
  481. int discard = 0;
  482. int ret;
  483. if (avs->error)
  484. return AVERROR_UNKNOWN;
  485. pkt->destruct = av_destruct_packet;
  486. // If either stream reaches EOF, try to read the other one before giving up.
  487. avisynth_next_stream(s, &st, pkt, &discard);
  488. if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
  489. ret = avisynth_read_packet_video(s, pkt, discard);
  490. if (ret == AVERROR_EOF && avs_has_audio(avs->vi)) {
  491. avisynth_next_stream(s, &st, pkt, &discard);
  492. return avisynth_read_packet_audio(s, pkt, discard);
  493. }
  494. return ret;
  495. } else {
  496. ret = avisynth_read_packet_audio(s, pkt, discard);
  497. if (ret == AVERROR_EOF && avs_has_video(avs->vi)) {
  498. avisynth_next_stream(s, &st, pkt, &discard);
  499. return avisynth_read_packet_video(s, pkt, discard);
  500. }
  501. return ret;
  502. }
  503. }
  504. static av_cold int avisynth_read_close(AVFormatContext *s) {
  505. if (avpriv_lock_avformat())
  506. return AVERROR_UNKNOWN;
  507. avisynth_context_destroy(s->priv_data);
  508. avpriv_unlock_avformat();
  509. return 0;
  510. }
  511. static int avisynth_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) {
  512. AviSynthContext *avs = s->priv_data;
  513. AVStream *st;
  514. AVRational fps, samplerate;
  515. if (avs->error)
  516. return AVERROR_UNKNOWN;
  517. fps = (AVRational) {avs->vi->fps_numerator, avs->vi->fps_denominator};
  518. samplerate = (AVRational) {avs->vi->audio_samples_per_second, 1};
  519. st = s->streams[stream_index];
  520. if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
  521. // AviSynth frame counts are signed int.
  522. if ((timestamp >= avs->vi->num_frames) || (timestamp > INT_MAX) || (timestamp < 0))
  523. return AVERROR_EOF;
  524. avs->curr_frame = timestamp;
  525. if (avs_has_audio(avs->vi))
  526. avs->curr_sample = av_rescale_q(timestamp, samplerate, fps);
  527. } else {
  528. if ((timestamp >= avs->vi->num_audio_samples) || (timestamp < 0))
  529. return AVERROR_EOF;
  530. // Force frame granularity for seeking.
  531. if (avs_has_video(avs->vi)) {
  532. avs->curr_frame = av_rescale_q(timestamp, fps, samplerate);
  533. avs->curr_sample = av_rescale_q(avs->curr_frame, samplerate, fps);
  534. } else {
  535. avs->curr_sample = timestamp;
  536. }
  537. }
  538. return 0;
  539. }
  540. AVInputFormat ff_avisynth_demuxer = {
  541. .name = "avisynth",
  542. .long_name = NULL_IF_CONFIG_SMALL("AviSynth script"),
  543. .priv_data_size = sizeof(AviSynthContext),
  544. .read_header = avisynth_read_header,
  545. .read_packet = avisynth_read_packet,
  546. .read_close = avisynth_read_close,
  547. .read_seek = avisynth_read_seek,
  548. .extensions = "avs",
  549. };