shaka-project / shaka-packager

A media packaging and development framework for VOD and Live DASH and HLS applications, supporting Common Encryption for Widevine and other DRM Systems.
https://shaka-project.github.io/shaka-packager/
Other
1.95k stars 504 forks source link

Getting error ":ERROR:packager_main.cc(470)] Packaging Error: 5 (FILE_FAILURE): Cannot open file for reading /media/test.mp4" #334

Closed priyanshugupta27 closed 6 years ago

priyanshugupta27 commented 6 years ago

System info

Operating System: <e.g. macOS Sierra, Ubuntu 14.04 trusty etc> Shaka Packager Version: <e.g. v1.6.1, commit SHA etc>

Issue and steps to reproduce the problem

Packager Command:

Extra steps to reproduce the problem? (1) i am executing the the command for running the pacakger (2)$ packager input=/media/test.mp4,stream=audio,output=/media/audio.mp4 \ input=/media/test.mp4,stream=video,output=/media/video.mp4 \ --mpd_output /media/test.mpd

What is the expected result?

What happens instead?

<Please attach the input files or email to shaka-packager-issues@google.com.>

vaage commented 6 years ago

@priyanshugupta27 Could you run stat /media/* so that we can see what permissions all the files in /media has?

There is not much we can do with just the error message and the command. The packager can't find /media/test.mp4. So I want to make sure that it is in fact in the directory with the correct permissions.

priyanshugupta27 commented 6 years ago

@vaage I again rechecked and found that the file name was wrong. Now I have corrected the file name and successfully able to do packaging for the free content. But now i am facing one more error as mentioned below: Error while running the command using –pssh value [0302/110327:ERROR:raw_key_source.cc(110)] --pssh argument should be full PSSH boxes.

Can you please help me with this error?

vaage commented 6 years ago

@priyanshugupta27 I would be happy to help, could you provide me with the full command you are running?

priyanshugupta27 commented 6 years ago

@vaage Today I tried and able to resolve the error with below mentioned steps:

1) For the pssh error we set up the environment according to the below link: https://github.com/google/shaka-packager/tree/master/packager/tools/pssh

2) After the setup we created the complete pssh box with system ID: ./pssh-box.py --widevine-system-id --pssh-data $(echo 'CAESEJlz1v1lMkV5uWldyEVq8cciEUFpcnRlbFRlc3RDb250ZW50' | xxd -r -p | base64) –hex

3) Replaced the encryption tag with “enable_raw_key_encryption” as suggested by David and provided the pssh value generated in the step 2: packager input=/media/encryption.mp4,stream=video,output=encryption-short.mp4 --clear_lead 0 --output_media_info --profile on-demand --enable_raw_key_encryption --key_id=9xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx7 --key=exxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd --pssh 000000217073736800000000EDEF8BA979D64ACEA3C827DCD51D21ED00000001CA

4) Create the mpd file mpd_generator --input "encryption-short.mp4.media_info" --output "encryption-short.mp4.mpd"

It will be really helpful if you can review these steps and confirm that the steps I followed are correct. Thanks

vaage commented 6 years ago

@kqyang Do these instructions look correct to you?

@priyanshugupta27 I haven't done much with PSSH, so I can't tell if anything is wrong, but the fact that mpd_generator is in the last step, it makes me feel that these could be outdated.

priyanshugupta27 commented 6 years ago

Using mpd_generator I am successfully able to create the required mpd

kqyang commented 6 years ago

@priyanshugupta27 Yes, the steps are correct. I am glad it works out for you. You may merge 3 and 4 into a single step, i.e.

packager input=/media/encryption.mp4,stream=video,output=encryption-short.mp4 --clear_lead 0 --profile on-demand --enable_raw_key_encryption --key_id=9xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx7 --key=exxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd --pssh 000000217073736800000000EDEF8BA979D64ACEA3C827DCD51D21ED00000001CA --mpd_output encryption-short.mp4.mpd

mpd_generator is not actively maintained (for now, though we have plan to improve it), e.g. it does not support HLS playlist output. We recommend generating manifests directly using packager, unless there is a reason to use mpd_generator.

priyanshugupta27 commented 6 years ago

Thank you for the confirmation @kqyang . My requirement is for DASH not for HLS and for future purpose I will keep in mind not to use mpd_generator. @vaage Thank you for your support. Can you also confirm what is the format for KEY ID and KEY DATA?

vaage commented 6 years ago

@kqyang Could you provide an explanation of the format of KEY ID and KEY DATA?

kqyang commented 6 years ago

They must be hex strings. These two arguments are going to be deprecated. Please see https://google.github.io/shaka-packager/html/tutorials/raw_key.html#synopsis for the updated arguments.

priyanshugupta27 commented 6 years ago

Thanks @vaage @kqyang for your quick support. Issue is resolved and the doubts are clear for now. Closing the ticket.