From: James Almer <jamrial@gmail.com> To: ffmpeg-devel@ffmpeg.org Subject: Re: [FFmpeg-devel] [PATCH v2] Adds DVD protocol Date: Wed, 5 Jan 2022 11:44:46 -0300 Message-ID: <a603bc18-fd0c-be8e-3a99-f03d6726dfd4@gmail.com> (raw) In-Reply-To: <e103fa32-694b-f70d-fc32-01f226981682@gmail.com> On 1/5/2022 11:04 AM, Lucien Murray-Pitts wrote: > Copies the existing Bluray protocol format to add DVD protocol support > using > libdvdnav. Since title selection is mandatory ffprobe cant provide > information > for the complete disk but a single title only. Chapter information for > probe > will also be missing. To see a complete disk catalog of > titles/chapters the > tools/dvd2concat perl script should be used. > > Signed-off-by: Lucien Murray-Pitts <lucien.murraypitts@gmail.com> > --- > configure | 4 + > libavformat/Makefile | 1 + > libavformat/dvd.c | 264 ++++++++++++++++++++++++++++++++++++++++ > libavformat/protocols.c | 1 + > 4 files changed, 270 insertions(+) > create mode 100644 libavformat/dvd.c > > diff --git a/configure b/configure > index 8392c26015..7f8b0046d2 100755 > --- a/configure > +++ b/configure > @@ -230,6 +230,7 @@ External library support: > --enable-libdavs2 enable AVS2 decoding via libdavs2 [no] > --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394 > and libraw1394 [no] > + --enable-libdvdnav enable DVD reading using libdvdnav [no] > --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no] > --enable-libflite enable flite (voice synthesis) support via > libflite [no] > --enable-libfontconfig enable libfontconfig, useful for drawtext > filter [no] > @@ -1822,6 +1823,7 @@ EXTERNAL_LIBRARY_LIST=" > libdav1d > libdc1394 > libdrm > + libdvdnav > libflite > libfontconfig > libfreetype > @@ -3539,6 +3541,7 @@ xv_outdev_deps="xlib_xv xlib_x11 xlib_xext" > # protocols > async_protocol_deps="threads" > bluray_protocol_deps="libbluray" > +dvd_protocol_deps="libdvdnav" > ffrtmpcrypt_protocol_conflict="librtmp_protocol" > ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl mbedtls" > ffrtmpcrypt_protocol_select="tcp_protocol" > @@ -6526,6 +6529,7 @@ enabled libdav1d && require_pkg_config > libdav1d "dav1d >= 0.5.0" "dav1d > enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= > 1.6.0" davs2.h davs2_decoder_open > enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 > dc1394/dc1394.h dc1394_new > enabled libdrm && require_pkg_config libdrm libdrm > xf86drm.h drmGetVersion > +enabled libdvdnav && require_pkg_config libdvdnav dvdnav > dvdnav/dvdnav.h dvdnav_open > enabled libfdk_aac && { check_pkg_config libfdk_aac fdk-aac > "fdk-aac/aacenc_lib.h" aacEncOpen || > { require libfdk_aac > fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac && > warn "using libfdk without > pkg-config"; } } > diff --git a/libavformat/Makefile b/libavformat/Makefile > index c479ea998e..5fbba89e36 100644 > --- a/libavformat/Makefile > +++ b/libavformat/Makefile > @@ -627,6 +627,7 @@ OBJS-$(CONFIG_CONCAT_PROTOCOL) += concat.o > OBJS-$(CONFIG_CONCATF_PROTOCOL) += concat.o > OBJS-$(CONFIG_CRYPTO_PROTOCOL) += crypto.o > OBJS-$(CONFIG_DATA_PROTOCOL) += data_uri.o > +OBJS-$(CONFIG_DVD_PROTOCOL) += dvd.o > OBJS-$(CONFIG_FFRTMPCRYPT_PROTOCOL) += rtmpcrypt.o rtmpdigest.o > rtmpdh.o > OBJS-$(CONFIG_FFRTMPHTTP_PROTOCOL) += rtmphttp.o > OBJS-$(CONFIG_FILE_PROTOCOL) += file.o > diff --git a/libavformat/dvd.c b/libavformat/dvd.c > new file mode 100644 > index 0000000000..b3bc1b95e4 > --- /dev/null > +++ b/libavformat/dvd.c > @@ -0,0 +1,264 @@ > +/* > + * DVD (libdvdnav) protocol based on BluRay (libbluray) protocol by > Petri Hintukainen. > + * > + * Copyright (c) 2022 Lucien Murray-Pitts <lucien.murraypitts <at> > gmail.com> > + * > + * This file is part of FFmpeg. > + * > + * FFmpeg is free software; you can redistribute it and/or > + * modify it under the terms of the GNU Lesser General Public > + * License as published by the Free Software Foundation; either > + * version 2.1 of the License, or (at your option) any later version. > + * > + * FFmpeg is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * Lesser General Public License for more details. > + * > + * You should have received a copy of the GNU Lesser General Public > + * License along with FFmpeg; if not, write to the Free Software > + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA > 02110-1301 USA > + */ > + > + > +/* > + * REFERENCES: > https://code.videolan.org/videolan/libdvdnav/-/blob/master/src/dvdnav/dvdnav.h > > + * > https://code.videolan.org/videolan/libdvdnav/-/blob/master/examples/menus.c > + * > + * EXAMPLE USE: > + * Choose Title 4, map 1/2/3 (video/audio/subtitles), copy the > subtitles as is into mkv > + * ./ffmpeg -playlist 4 -i dvd:"/mnt/MURDER_SHE_WROTE_TS.S10D1" -map > 0:1 -map 0:2 -map 0:3 -vb 20M -codec:s copy remuxed-dvd.mkv > + * > + * Probe for info > + * ./ffprobe -loglevel trace -fdebug 8 -playlist 19 -i > dvd:"/mnt/MURDER_SHE_WROTE_TS.S10D1" -threads 0 -v warning -print_format > json -show_streams -show_chapters -show_format This should be added to doc/protocols.texi, not here. > + */ > +#include <dvdnav/dvdnav.h> > + > +#include "libavutil/avstring.h" > +#include "libavformat/avformat.h" > +#include "libavformat/url.h" > +#include "libavutil/opt.h" > + > +#define DVD_PROTO_PREFIX "dvd:" > + > +typedef struct { > + const AVClass *class; > + > + dvdnav_t *dvdnav; > + > + int playlist; > + int angle; > + int chapter; > + /*int region;*/ > +} DVDContext; > + > +#define OFFSET(x) offsetof(DVDContext, x) > +static const AVOption options[] = { > +{"playlist", "DVD title to play", OFFSET(playlist), AV_OPT_TYPE_INT, { > .i64=-1 }, -1, 99999, AV_OPT_FLAG_DECODING_PARAM }, > +{"angle", "DVD Video stream angle", OFFSET(angle), > AV_OPT_TYPE_INT, { .i64=0 }, 0, 0xfe, AV_OPT_FLAG_DECODING_PARAM }, > +{"chapter", "DVD Chapter to play", OFFSET(chapter), AV_OPT_TYPE_INT, > { .i64=1 }, 1, 0xfffe, AV_OPT_FLAG_DECODING_PARAM }, > +/*{"region", "dvd player region code (1 = region A, 2 = region B, 4 = > region C)", OFFSET(region), AV_OPT_TYPE_INT, { .i64=0 }, 0, 3, > AV_OPT_FLAG_DECODING_PARAM },*/ Don't add commented out code, especially when the description doesn't even apply to this protocol. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
prev parent reply other threads:[~2022-01-05 14:44 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-01-05 14:04 Lucien Murray-Pitts 2022-01-05 14:44 ` James Almer [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=a603bc18-fd0c-be8e-3a99-f03d6726dfd4@gmail.com \ --to=jamrial@gmail.com \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git