Decrypting the ts-csa encrypted file using libvlc vlm API

This forum is about all development around libVLC.
rakeshsg
New Cone
New Cone
Posts: 4
Joined: 20 Mar 2012 09:38

Decrypting the ts-csa encrypted file using libvlc vlm API

Postby rakeshsg » 21 Jun 2012 15:40

Hi Members,

I am trying to encrypt a media file and then decrypt that media file before streaming it.

So far I am able to encrypt a media file using the ts-csa key with the help of below command line.

vlc -I dummy filanme.mp4 --sout="#transcode{vcodec=h264,width=640,height=480,vb=750960,acodec=mp3,ab=32,channels=2,samplerate=44100}:std{access=file,mux=ts{csa-ck=ABBBBBBBBBBBBBBB},dst=streamEnc.flv}"

And I am trying to decrypt this file using VLM libvlc calls as shown below

Code: Select all

libvlc_instance_t *vlc; const char *url; const char *sout = "#transcode{vcodec=h264,acodec=aac,ab=128,channels=2," \ "samplerate=44100}:http{dst=:8090/testbc.flv}"; const char *media_name = "Foo"; url = argv[1]; char const *options[] = { "-I dummy", // Don't use any interface "--ts-csa-ck=ABBBBBBBBBBBBBBB", }; int numOptions = sizeof(options)/sizeof(options[0]); printf("Number of Options: %d\n",numOptions); vlc = libvlc_new(numOptions, options); libvlc_vlm_add_broadcast(vlc, media_name, url, sout, 0, NULL, true, false); libvlc_vlm_play_media(vlc, media_name);
So far it recognizes and decrypts only audio stream and the during decryption I get this below mentioned error output and there after vlc quits(after some time).

$ ./a.out streamEnc.flvNumber of Options: 2
[0x9e0e64c] [Media: Foo] main access out: creating httpd
[0x9e23cd4] [Media: Foo] ts demux error: MPEG-4 descriptor not found
[0x9e24414] [Media: Foo] packetizer_mpeg4audio decoder: AAC channels: 2 samplerate: 44100
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.1 Cache64
x264 [info]: profile High, level 3.0
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.1 Cache64
x264 [info]: profile High, level 3.1
[0x9e0f964] [Media: Foo] main mux error: cannot add a new stream (unsupported while muxing to this format). You can try increasing sout-mux-caching value
[0x9e146dc] [Media: Foo] stream_out_transcode stream out error: cannot add this stream


:(

My qustion is whether we can decrypt the encrypted media file using VLM API's.?
If yes, what is the the way to do it.
If my steps are correct, where am I making a mistake.?
If not how I can decrypt the media in c code.

Thanks for giving time to read and understand my problem.

Rakesh

rakeshsg
New Cone
New Cone
Posts: 4
Joined: 20 Mar 2012 09:38

Re: Decrypting the ts-csa encrypted file using libvlc vlm AP

Postby rakeshsg » 22 Jun 2012 10:39

Hi Members,

I am facing this problem in Ubuntu Linux. But the same code works in Windows. :- :?

Thanks
Rakesh

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Decrypting the ts-csa encrypted file using libvlc vlm AP

Postby Jean-Baptiste Kempf » 23 Jun 2012 16:34

[0x9e0f964] [Media: Foo] main mux error: cannot add a new stream (unsupported while muxing to this format). You can try increasing sout-mux-caching value
[0x9e146dc] [Media: Foo] stream_out_transcode stream out error: cannot add this stream


What is the type of the stream added?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 12 guests