[FFmpeg-devel] [PATCH v9] lavf/flv: Add XV (Xunlei Video) Support. fixes ticket #3720

Shivam Goyal shivgo at iitk.ac.in
Fri May 10 16:10:36 EEST 2019


   The patch is for ticket #3720. XV Xunlei video support. XV video is a
flv video. The flv data starts from 0x200000th byte and the next 0x400
bytes are rotated, to find the value by which the next 0x400 bytes are
rotated. I subtracted the 0x200000th byte from 0x46 ( 'F' ) ( As every
flv video starts from 'FLV' signature, So, i already know the original
0x200000th byte), So, i got the value by which the next 0x400 bytes are
rotated. In the below patch i have skipped the first packet, so that i
don't have to decrypt the encrypted 0x400 bytes. 

But i also tried to decrypt the 0x400 bytes from that rot value. but
every time i try i reached at two situations: Either this becomes too
low level ( needs modifications of the avio stuff, which a demuxer
should not do). Or it affects the flv demuxer, like adding too many 'if
else' statements to the flv_read_packet() would slow demuxing of flv
format too, which i don't want. The ways i tried - 

-> Checking if the format is xv or flv every time it reads from input
file (decrypt it if needed). 

-> decrypt the input buffer at the time of reading header 

-> Making two avio contexts and one calling the other ( I am not sure if
i implemented it in the right way, but still i reached low level ). 

In the patch i have skipped the first packet due to this it can't tell
the rate and duration of video but it plays and can be converted with no
errors. 

Please review if it is right,or there can be another approach ( i know
this is an easy task but just due to those 0x400 bytes it is tricky ). 

Thank you, 

Shivam Goyal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: add_xv_support_v9.patch
Type: text/x-diff
Size: 5132 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190510/e281229c/attachment.patch>


More information about the ffmpeg-devel mailing list