@@ -44,7 +44,7 @@ private static string EscapeString(string str)
44
44
return string . IsNullOrEmpty ( str ) ? str : str . Replace ( "\" " , "'" ) . Replace ( "\\ " , "\\ \\ " ) ;
45
45
}
46
46
47
- private static int MuxByMp4box ( string videoPath , string audioPath , string outPath , string desc , string title , string author , string episodeId , string pic , string lang , List < Subtitle > ? subs , bool audioOnly , bool videoOnly , List < ViewPoint > ? points )
47
+ private static int MuxByMp4box ( string url , string videoPath , string audioPath , string outPath , string desc , string title , string author , string episodeId , string pic , string lang , List < Subtitle > ? subs , bool audioOnly , bool videoOnly , List < ViewPoint > ? points )
48
48
{
49
49
StringBuilder inputArg = new ( ) ;
50
50
StringBuilder metaArg = new ( ) ;
@@ -73,7 +73,8 @@ private static int MuxByMp4box(string videoPath, string audioPath, string outPat
73
73
metaArg . Append ( $ ":album=\" { title } \" :title=\" { episodeId } \" ") ;
74
74
else
75
75
metaArg . Append ( $ ":title=\" { title } \" ") ;
76
- metaArg . Append ( $ ":comment=\" { desc } \" ") ;
76
+ metaArg . Append ( $ ":sdesc=\" { desc } \" ") ;
77
+ metaArg . Append ( $ ":comment=\" { url } \" ") ;
77
78
metaArg . Append ( $ ":artist=\" { author } \" ") ;
78
79
79
80
if ( subs != null )
@@ -90,12 +91,12 @@ private static int MuxByMp4box(string videoPath, string audioPath, string outPat
90
91
}
91
92
92
93
//----分析完毕
93
- var arguments = ( Config . DEBUG_LOG ? " -v " : "" ) + inputArg + ( metaArg . ToString ( ) == "" ? "" : " -itags tool=" + metaArg . ToString ( ) ) + $ " -new -- \" { outPath } \" ";
94
+ var arguments = ( Config . DEBUG_LOG ? " -v " : "" ) + inputArg + ( metaArg . ToString ( ) == "" ? "" : " -itags tool=" + metaArg ) + $ " -new -- \" { outPath } \" ";
94
95
LogDebug ( "mp4box命令: {0}" , arguments ) ;
95
96
return RunExe ( MP4BOX , arguments , MP4BOX != "mp4box" ) ;
96
97
}
97
98
98
- public static int MuxAV ( bool useMp4box , string videoPath , string audioPath , List < AudioMaterial > audioMaterial , string outPath , string desc = "" , string title = "" , string author = "" , string episodeId = "" , string pic = "" , string lang = "" , List < Subtitle > ? subs = null , bool audioOnly = false , bool videoOnly = false , List < ViewPoint > ? points = null , long pubTime = 0 , bool simplyMux = false )
99
+ public static int MuxAV ( bool useMp4box , string bvid , string videoPath , string audioPath , List < AudioMaterial > audioMaterial , string outPath , string desc = "" , string title = "" , string author = "" , string episodeId = "" , string pic = "" , string lang = "" , List < Subtitle > ? subs = null , bool audioOnly = false , bool videoOnly = false , List < ViewPoint > ? points = null , long pubTime = 0 , bool simplyMux = false )
99
100
{
100
101
if ( audioOnly && audioPath != "" )
101
102
videoPath = "" ;
@@ -104,10 +105,11 @@ public static int MuxAV(bool useMp4box, string videoPath, string audioPath, List
104
105
desc = EscapeString ( desc ) ;
105
106
title = EscapeString ( title ) ;
106
107
episodeId = EscapeString ( episodeId ) ;
108
+ var url = $ "https://www.bilibili.com/video/{ bvid } /";
107
109
108
110
if ( useMp4box )
109
111
{
110
- return MuxByMp4box ( videoPath , audioPath , outPath , desc , title , author , episodeId , pic , lang , subs , audioOnly , videoOnly , points ) ;
112
+ return MuxByMp4box ( url , videoPath , audioPath , outPath , desc , title , author , episodeId , pic , lang , subs , audioOnly , videoOnly , points ) ;
111
113
}
112
114
113
115
if ( outPath . Contains ( '/' ) && ! Directory . Exists ( Path . GetDirectoryName ( outPath ) ) )
@@ -179,6 +181,7 @@ public static int MuxAV(bool useMp4box, string videoPath, string audioPath, List
179
181
argsBuilder . Append ( metaArg ) ;
180
182
if ( ! simplyMux ) {
181
183
argsBuilder . Append ( $ "-metadata title=\" { ( episodeId == "" ? title : episodeId ) } \" ") ;
184
+ argsBuilder . Append ( $ "-metadata comment=\" { url } \" ") ;
182
185
if ( lang != "" ) argsBuilder . Append ( $ "-metadata:s:a:0 language={ lang } ") ;
183
186
if ( ! string . IsNullOrWhiteSpace ( desc ) ) argsBuilder . Append ( $ "-metadata description=\" { desc } \" ") ;
184
187
if ( ! string . IsNullOrEmpty ( author ) ) argsBuilder . Append ( $ "-metadata artist=\" { author } \" ") ;
0 commit comments