From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id A491448663 for ; Mon, 15 Jan 2024 16:14:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CFEC668CDBE; Mon, 15 Jan 2024 18:14:55 +0200 (EET) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04olkn2081.outbound.protection.outlook.com [40.92.73.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A4DCF68CB29 for ; Mon, 15 Jan 2024 18:14:48 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GLbWdK4IHZ7axGCh2vVpSFZsdJc1zA4XDxmaNlje7yzL8X8NXUfkJf4QdvBz7Ed36HmT4+muXX4hwO4ZNPECt7jAG4gCLSHPr94N9ieszu0qWJJZqhmol8OCApngQcVX2z+x7LBr3TnfZxieim4LmhUr+waW9oxH2Qjr9zPjPAxkAsVr9+bIp2cA23rvDuLkqH+FBjTVQOtJGAv/AWAusrCCjmpzzCb+JqXl6w8RRmL2lq+EBz43aEs2Ql7FOjvdfsN+MBaI8QZv1XanEy/a5J7/xCVdn3C76pxFUk9a8WWHBAKPOK1gCTOM98ynV3PujR/z2Z0/qt3g4jOniZHKXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=128kayfsoIYytXTYo109a9Jg9+pa9rbza1NGMGk7RgE=; b=IZunD87LhSOzwIuJfIp5KPeEM2IbFqPYUSO7oPNT9SdJfKy3hD32AAJhelEacSej02RwD/QBkCs/H6Zckl19j/8ztYd8Iw6qH28qom+NlAydXOfS/4FhB5xlowZTQqyO77R5Aum0Yzo2/fSpdjZJTFxEJVBt3SuLxh/r5/LYCfB23fX6chuyBWakIoTGyF3KZFb/8ut4e5OBwMkcCF7jo9L8PLVDHXz1HejKHN6mtxMni6+4HTMuJUC1zj66lr+pO0jJriKt7fdW1py/Ooa9i64Hh3nGPF/Y1T1PZi6Dk8Rs1GPvSzr9FYBEEv/i0PQ8YpuIsag8bglttEnx/j6cBg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=128kayfsoIYytXTYo109a9Jg9+pa9rbza1NGMGk7RgE=; b=ms1cZGhrD/vVsImIGJCHISgku+kvwTPUZWoSjjsDhdVpYjl8N8J002JfzfQdJb0xib7Hv9Y4ifJpJJF2y5lY2lyxvzR36VrZAujhtCuHYHHo4sLMbRO7rCyUgrxcx1N5Aerh+dA7BcjV4dMH4gDE9fra2KieTM90O5jb6sxeZNaJKD3PNLfmiCWbtGoOywmRSs+sxIVR4Dq1ANHoIKz+QdDFnlNb/oZd5qOEfmVVff7amSIk6tICAKmgkYqwv694Lkm4PxwwfyQvLVyFRHlD23/hbO/H83j3DfrKl8XsFbYHajFvcVXePkHQfWKyIVlVKf1VTxEbVWRSOic/htVhnQ== Received: from PAVPR08MB9795.eurprd08.prod.outlook.com (2603:10a6:102:31f::12) by GVXPR08MB7704.eurprd08.prod.outlook.com (2603:10a6:150:6a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.23; Mon, 15 Jan 2024 16:14:46 +0000 Received: from PAVPR08MB9795.eurprd08.prod.outlook.com ([fe80::83f1:da95:eae9:6b96]) by PAVPR08MB9795.eurprd08.prod.outlook.com ([fe80::83f1:da95:eae9:6b96%7]) with mapi id 15.20.7181.022; Mon, 15 Jan 2024 16:14:46 +0000 From: aybe aybe To: FFmpeg development discussions and patches Thread-Topic: Re[2]: [FFmpeg-devel] [PATCH 1/4] avcodec/mdec: DC reading for STRv1 is like STRv2 Thread-Index: AQHaRymd45qluzHeeUuwZ/rHBLOGC7DbDYuA Date: Mon, 15 Jan 2024 16:14:46 +0000 Message-ID: References: <20240110024602.GQ6420@pb2> <20240114203806.GF6420@pb2> In-Reply-To: <20240114203806.GF6420@pb2> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [ssLEcrmqSg29Vggc6923QWnUUEMnxaPMl5ONeiU9z2SZ6cy2lNafNA==] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PAVPR08MB9795:EE_|GVXPR08MB7704:EE_ x-ms-office365-filtering-correlation-id: 4578249f-f292-4277-6fb5-08dc15e51740 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: gIfK2ZSbvaI07RTb8ErqUkGJYCYAdOg45YSC9hiXALfqmA3lmcSkf6nNByIeZe7Bc+s8S2ILn4xupi5+HlZEY73GBoVw2hDCcwKPFweEtWFPnTe3SpQk981W+1B8/9um1VmZweXp/yfZtxCYYBfU8Ol7i6EYsB6l8tjQm41VBZFpICMeMe8qqiklpSctigdWzInIaOn7Ltn5RWmrobK48q6kSyZZTfQdy/DbI7vQMZmmpsX+lWNKA6kEMAK3KwBCw/hzhJXhf+Zv7Hs+GzmFIkCNzE+v1AdW7WHtrp1C+7HadM5Yvv3vsVhRWx4WIHoRQZHg66XkO0u+t/cacRVSpF3zLau93w0jhffE7lV0hGZscL+n3vjx9r3PzUdHBbYVBus+9Yeuc65q+EdCCxny0MJGUPeprlW5OVUtZKr9AP/9icfJDw/UEPfCsAVWgbHVPoOU250mOQwSl7fN64+niRccwyB8+WNLRHyvsiQaH5Ssf+6X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yeGFreVBpQ1ZnN1VrVVV4OWxxSC8vWmpVVDFPclB6?= =?utf-8?B?bkYweHlVYjhwd1BDb1RUQS9xc0NWWFY3YTZMdTNxM1hoY0NVanJXTHBJQ1Y1?= =?utf-8?Q?wdhGANAwT15jT/mdgOFn?= MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-83b42.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PAVPR08MB9795.eurprd08.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 4578249f-f292-4277-6fb5-08dc15e51740 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Jan 2024 16:14:46.0941 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB7704 X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [FFmpeg-devel] [PATCH 1/4] avcodec/mdec: DC reading for STRv1 is like STRv2 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Hi! I just tried what you've suggested, using 150 and setting AVPacket->pts using sector MSF as LBA. The results are somewhat mixed: - NTSC video: A/V synchronized but is now seen as 120 FPS by VLC - PAL video: A/V not synchronized anymore but still seen as 25 FPS by VLC Not sure about 150, we assume videos play at 2x CD-ROM, not 100% exact but is likely to be the case for 99% of them. ------ Original Message ------ >From "Michael Niedermayer via ffmpeg-devel" > To "FFmpeg development discussions and patches" > Cc "Michael Niedermayer" > Date 1/14/2024 9:38:06 PM Subject Re: [FFmpeg-devel] [PATCH 1/4] avcodec/mdec: DC reading for STRv1 is like STRv2 Hi aybe On Sat, Jan 13, 2024 at 02:28:52AM +0000, aybe aybe wrote: Here are the two STR files I have used when writing this patch: https://github.com/aybe/FFmpeg-PSX-STR-tests ok, i can confirm the version patch fixes these, i will apply it Fanatics would probably say that 30 FPS for NTSC is wrong (i.e. should be 29.97)... However, as the reversed-engineered docs in jpsxdec mentions, it is sort of impossible to figure out which value to snap to from how frames spans across CD-ROM sectors. The sector count per video frame always seem to juggle between two values, e.g. 6 sectors, then 7 sectors, rinse/repeat. i.e. it's never constant. Also, as one can see in the various code samples online on writing a PSX program that plays MDEC videos, it is the responsibility of the coder to present the frames on screen. i.e. there is not definitive way on how to do so, and even if there was, you can be sure some folks did not play by the rules back then. The only way to figure out how a movie was intended to be played is to reverse engineer a game to see what values they did cram in. In short, the computed frame rate is 99% good, not 100%. But for mere mortals, they are unlikely to notice it at all. Well, with the subset of samples i have, i dont feel confident that i could write and test timestamping/fps. The docuemnt you linked says "Data is read from the disc one sector at a time at either 75 sectors per second (single speed) or 150 sectors per second (double speed). The video and audio are spaced out over these sectors so they can be delivered at the appropriate times." what i would suggest to try is: avpriv_set_pts_info(st, 64, 1, 150); (or 75 for single speed) and then set AVPacket->pts to the sector number you never set fps, leave it to libavformat to figure it out. can you try that ? (i assume you have many samples to easily check) As for the movies in the samples repository, they are corrupt and FFmpeg fails at them, obviously. I figured these ones were by checking them in a hex-editor but also by loading them in https://github.com/m35/jpsxdec which has great logging. Not sure why these samples were corrupt in first instance, maybe it was intentional for testing? I can't tell. Thats very strange, anyone remembers where these samples are from originally ? thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Modern terrorism, a quick summary: Need oil, start war with country that has oil, kill hundread thousand in war. Let country fall into chaos, be surprised about raise of fundamantalists. Drop more bombs, kill more people, be surprised about them taking revenge and drop even more bombs and strip your own citizens of their rights and freedoms. to be continued _______________________________________________ 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".