Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 7th January 2016, 16:21   #1  |  Link
mushahidh
Registered User
 
Join Date: Nov 2015
Posts: 29
Add FEC/ECC at the end of each frame

Hi experts,
I have encoded video using JM reference software. The H.264 file is encoded using RTP stream. Then using the same JM reference software i have applied rtp_loss on the encoded video. But now decoder is unable to decode video with rtp_loss applied. Now i want to add some Error correcting code or forward error correction code like Reed Solomon code at the frame or GOP level. My question is that, in JM reference software where in the encoder code i can stuff my redundant bits ? In image.c encode_one_frame (VideoParameters *p_Vid, InputParameters *p_Inp) is the function which is encoding one frame. but i am unable to get how and where to add redundant bits at the encoder end so that i would be able to recover packet loss during rtp_loss process.
Also what could be an alternates you can suggest to test SSIM using different redundany values? for example should i take in matlab h.264 as an input-> add some redundant bits-> apply packet loss -> recover packet loss and then decode using JM. This is a reference paper i am using http://ieeexplore.ieee.org/stamp/sta...number=5729366

Last edited by mushahidh; 8th January 2016 at 09:48.
mushahidh is offline   Reply With Quote
Old 10th January 2016, 11:56   #2  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,413
If the data isn't H.264 data, then it should be placed in a custom SEI packet. You don't need to change the internals of the encoder for that, just the way you call them from lencod.c (probably by modifying the main loop in encode_sequence()) by adding the SEI after each frame. The SEI will be skipped by decoders that don't understand it, but available to those that do.

Isn't FEC usually done at the RTP level, though?
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order.
foxyshadis is offline   Reply With Quote
Old 10th January 2016, 13:23   #3  |  Link
mushahidh
Registered User
 
Join Date: Nov 2015
Posts: 29
Quote:
Originally Posted by foxyshadis View Post
If the data isn't H.264 data, then it should be placed in a custom SEI packet. You don't need to change the internals of the encoder for that, just the way you call them from lencod.c (probably by modifying the main loop in encode_sequence()) by adding the SEI after each frame. The SEI will be skipped by decoders that don't understand it, but available to those that do.
Thanks for your answer.The data is H.264 data with the OutFileMode set to 1 which means RTP not Annex. So in any case how much redundant bits could i add as a SEI message ? For example i divide the frame into 16 packets and add 2 more redundant packets for error recovery. Is it possible?

Quote:
Isn't FEC usually done at the RTP level, though?
I need your kind suggestion on this too. I wonder not even a single code snippet i have seen which is applying FEC at any level so that newbies can get help from it. So if i want to add FEC at RTP level what would be your suggestion?
Apply Encode file using JM as RTP add FEC inside JM apply rtp_loss and Decode it?
or Take H.264 file as an input in matlab apply FEC pass it through noisy channel Recover packet loss and decode using JM?
Thanks
mushahidh is offline   Reply With Quote
Old 11th January 2016, 12:40   #4  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,413
Quote:
Originally Posted by mushahidh View Post
Thanks for your answer.The data is H.264 data with the OutFileMode set to 1 which means RTP not Annex. So in any case how much redundant bits could i add as a SEI message ? For example i divide the frame into 16 packets and add 2 more redundant packets for error recovery. Is it possible?
There's no arbitrary limit on the size of an SEI, so you're only constrained by the bitrate or buffer. That can be rather difficult, and is a delicate balancing act if you're already using your full bandwidth on regular frames, so you will need to keep a running track (if it's a real application).

Quote:
Originally Posted by mushahidh View Post
I need your kind suggestion on this too. I wonder not even a single code snippet i have seen which is applying FEC at any level so that newbies can get help from it. So if i want to add FEC at RTP level what would be your suggestion?
Apply Encode file using JM as RTP add FEC inside JM apply rtp_loss and Decode it?
or Take H.264 file as an input in matlab apply FEC pass it through noisy channel Recover packet loss and decode using JM?
Thanks
There are no full standards on RTP FEC, but there are several proposed standards: rfc6363 is now used fairly widespread as a baseline for FEC in RTP, and rfc6682 and rfc6865 are implementations of error correction within those frames. These being completely independent of the contained data, they can be generated completely out-of-band and inserted separately from the encoder entirely. I don't have experience writing that code, I only work with reliable transport media.

There probably isn't much code for JM because no one uses it for anything but experiments and research, and hardly any students publish their research code.
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order.
foxyshadis is offline   Reply With Quote
Old 11th January 2016, 17:06   #5  |  Link
mushahidh
Registered User
 
Join Date: Nov 2015
Posts: 29
Quote:
Originally Posted by foxyshadis View Post
There probably isn't much code for JM because no one uses it for anything but experiments and research, and hardly any students publish their research code.
My work is actually research oriented but i don't have any hard constraints of using JM as far as addition of FEC is concern. Is there a better way you can suggest so that i can add redundant bits to encoded bitstream then apply packet loss and then remove redundant bits and decode the file? What is better way to achieve this cycle ?
mushahidh is offline   Reply With Quote
Reply

Tags
h264, redundancy errors, rtp, video

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:04.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.