Azure / azure-media-migration

Azure Media Migration Tool
https://github.com/Azure/azure-media-migration
MIT License
11 stars 15 forks source link

Migration fails if asset or track source names contains spaces or commas #257

Open schuettecarsten opened 4 months ago

schuettecarsten commented 4 months ago

ShakaPackager fails if the track source names contain spaces or other special characters. Unfortunately, packager does not support quotes, so it looks like we need to rename the downloaded files?

2024-06-03 08:49:50.740 +02:00 [INF] Migrating asset: 295b91e8-4a61-4ede-950b-be7566595cc6 (container asset-295b91e8-4a61-4ede-950b-be7566595cc6) ...
2024-06-03 08:49:55.000 +02:00 [VRB] Found manifest 452 - Brennecke, Lukas - Immer a.ism of format mp4-v3 in container asset-295b91e8-4a61-4ede-950b-be7566595cc6
2024-06-03 08:49:55.003 +02:00 [VRB] Template test/${AssetId} expanded to test/295b91e8-4a61-4ede-950b-be7566595cc6
2024-06-03 08:49:56.667 +02:00 [VRB] Template test/${AssetId} expanded to test/295b91e8-4a61-4ede-950b-be7566595cc6
2024-06-03 08:49:56.668 +02:00 [VRB] Asset 295b91e8-4a61-4ede-950b-be7566595cc6 is in format: mp4-v3.
2024-06-03 08:49:56.972 +02:00 [DBG] Begin downloading 452 - Brennecke, Lukas - Immer a_1280x720_3000.mp4
2024-06-03 08:49:56.972 +02:00 [VRB] Uploading to 295b91e8-4a61-4ede-950b-be7566595cc6/452 - Brennecke, Lukas - Immer a_manifest.xml in container test of account: werdertv...
2024-06-03 08:49:57.063 +02:00 [DBG] Begin downloading 452 - Brennecke, Lukas - Immer a_1920x1080_6000.mp4
2024-06-03 08:49:57.112 +02:00 [VRB] Uploading to 295b91e8-4a61-4ede-950b-be7566595cc6/4d7cbfd6-1164-4fd8-bda7-d7ea1a2920a5_metadata.xml in container test of account: werdertv...
2024-06-03 08:49:57.115 +02:00 [DBG] Begin downloading 452 - Brennecke, Lukas - Immer a_320x180_400.mp4
2024-06-03 08:49:57.143 +02:00 [DBG] Begin downloading 452 - Brennecke, Lukas - Immer a_640x360_650.mp4
2024-06-03 08:49:57.173 +02:00 [DBG] Begin downloading 452 - Brennecke, Lukas - Immer a_960x540_1500.mp4
2024-06-03 08:49:58.241 +02:00 [VRB] Uploaded 0 bytes to 295b91e8-4a61-4ede-950b-be7566595cc6/452 - Brennecke, Lukas - Immer a_manifest.xml
2024-06-03 08:49:58.241 +02:00 [VRB] Uploaded 0 bytes to 295b91e8-4a61-4ede-950b-be7566595cc6/4d7cbfd6-1164-4fd8-bda7-d7ea1a2920a5_metadata.xml
2024-06-03 08:50:01.586 +02:00 [DBG] Finished download of 452 - Brennecke, Lukas - Immer a_320x180_400.mp4
2024-06-03 08:50:03.646 +02:00 [DBG] Finished download of 452 - Brennecke, Lukas - Immer a_640x360_650.mp4
2024-06-03 08:50:06.242 +02:00 [DBG] Finished download of 452 - Brennecke, Lukas - Immer a_960x540_1500.mp4
2024-06-03 08:50:09.546 +02:00 [DBG] Finished download of 452 - Brennecke, Lukas - Immer a_1280x720_3000.mp4
2024-06-03 08:50:16.843 +02:00 [DBG] Finished download of 452 - Brennecke, Lukas - Immer a_1920x1080_6000.mp4
2024-06-03 08:50:17.922 +02:00 [VRB] Starting static packaging for asset 295b91e8-4a61-4ede-950b-be7566595cc6...
2024-06-03 08:50:41.999 +02:00 [DBG] Starting packager D:\NoAV\Tools\Microsoft\azure-media-migration\migrationTool\bin\Debug\net6.0\packager-win-x64.exe...
2024-06-03 08:50:42.001 +02:00 [VRB] Packager arguments: "stream=0,in="R:\Work\295b91e8-4a61-4ede-950b-be7566595cc6\452 - Brennecke, Lukas - Immer a_1920x1080_6000.mp4",out="R:\Work\295b91e8-4a61-4ede-950b-be7566595cc6\output\452 - Brennecke, Lukas - Immer a_0.mp4",playlist_name="R:\Work\295b91e8-4a61-4ede-950b-be7566595cc6\output\452 - Brennecke, Lukas - Immer a_0.m3u8"" "stream=0,in="R:\Work\295b91e8-4a61-4ede-950b-be7566595cc6\452 - Brennecke, Lukas - Immer a_1280x720_3000.mp4",out="R:\Work\295b91e8-4a61-4ede-950b-be7566595cc6\output\452 - Brennecke, Lukas - Immer a_1.mp4",playlist_name="R:\Work\295b91e8-4a61-4ede-950b-be7566595cc6\output\452 - Brennecke, Lukas - Immer a_1.m3u8"" "stream=0,in="R:\Work\295b91e8-4a61-4ede-950b-be7566595cc6\452 - Brennecke, Lukas - Immer a_960x540_1500.mp4",out="R:\Work\295b91e8-4a61-4ede-950b-be7566595cc6\output\452 - Brennecke, Lukas - Immer a_2.mp4",playlist_name="R:\Work\295b91e8-4a61-4ede-950b-be7566595cc6\output\452 - Brennecke, Lukas - Immer a_2.m3u8"" "stream=0,in="R:\Work\295b91e8-4a61-4ede-950b-be7566595cc6\452 - Brennecke, Lukas - Immer a_640x360_650.mp4",out="R:\Work\295b91e8-4a61-4ede-950b-be7566595cc6\output\452 - Brennecke, Lukas - Immer a_3.mp4",playlist_name="R:\Work\295b91e8-4a61-4ede-950b-be7566595cc6\output\452 - Brennecke, Lukas - Immer a_3.m3u8"" "stream=0,in="R:\Work\295b91e8-4a61-4ede-950b-be7566595cc6\452 - Brennecke, Lukas - Immer a_320x180_400.mp4",out="R:\Work\295b91e8-4a61-4ede-950b-be7566595cc6\output\452 - Brennecke, Lukas - Immer a_4.mp4",playlist_name="R:\Work\295b91e8-4a61-4ede-950b-be7566595cc6\output\452 - Brennecke, Lukas - Immer a_4.m3u8"" --temp_dir "R:\Work" --mpd_output "R:\Work\295b91e8-4a61-4ede-950b-be7566595cc6\output\master.mpd" --hls_master_playlist_output "R:\Work\295b91e8-4a61-4ede-950b-be7566595cc6\output\master.m3u8"
2024-06-03 08:50:44.934 +02:00 [ERR] Packager D:\NoAV\Tools\Microsoft\azure-media-migration\migrationTool\bin\Debug\net6.0\packager-win-x64.exe finished with exit code 1
2024-06-03 08:50:44.959 +02:00 [INF] E0603 06:50:42.081055   24584 stream_descriptor.cc:281] Unknown field in stream descriptor ("-").
duggaraju commented 4 months ago

Shaka packager works fine with spaces in folder/file names. Below is the example with spaces that works fine:

.\packager-win-x64.exe "in=D:\temp\space folder\file space.mp4,stream=audio,out=audio space.mp4" "in=D:\temp\space folder\test.mp4,stream=video,out=video space.mp4"

Looks like the way escaping in the tool is incorrect. The entire argument must be put in quotes instead of multiple quotes.

schuettecarsten commented 4 months ago

@duggaraju Yes, you're right for spaces. We have assets that have a comma in the file name, this breaks the packager.

duggaraju commented 4 months ago

Yes ',' is a special variable for Shaka packager since ',' is used as separator for name value pairs. If your file has , in the name you will have to change the tool to remove , when downloading the file locally. How common is this scenario? https://github.com/shaka-project/shaka-packager/issues/1174